Probability - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Probability

Description:

Coins don't remember ... 0.5 probability means that the ratio of heads to tails tends to 0.5 the more coins we flip ... Challenge Problem Part 2 ... – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 20
Provided by: alanab2
Category:

less

Transcript and Presenter's Notes

Title: Probability


1
Probability
  • MATH 224

2
Flip a coin
  • A fair coin has a 50 (0.5) probability of
    turning up heads, which means
  • The number of heads and tails will even out in
    the long run
  • The ratio of heads to tails will tend towards
    50/50 in the long run

3
Experiment
  • Generate 1000 random numbers (evenly between 0
    and 1)
  • nums rand(1, 1000)
  • Turn those gt 0.5 into 1s (heads) (and lt 0.5 into
    zeros (tails))
  • heads (nums gt 0.5)
  • Count heads
  • sum(heads)
  • Count tails

4
Graph experiment
  • Graph of running head vs. tail count
  • start at (0, 0)
  • heads get 1, tails get -1
  • move right in x as you keep flipping coins

5
Graph Sketches
6
Simulation
  • N 100000
  • heads rand(1, N) gt 0.5
  • tails heads logical NOT, flips 1s 0s
  • diff heads - tails for each coin, make 1
    for heads, -1 for tails
  • running_total cumsum(diff) cumsum means
    cumulative sum
  • e.g. cumsum( 3 4 5) would be 3 7 12
  • plot(running_total) plots the running total
    against x 1N

7
Graph and Observations
8
Coins dont remember
  • seeing a long streak of heads or tails doesnt
    change probability of next flip
  • We expect that, after 1,000 flips, there will be
    more heads than tails (or vice-versa), but almost
    certainly not equal numbers
  • So what good is 50 / 0.5 probability statement?

9
Ratio or Fraction of Heads
  • In first graph, we took raw sums of heads tails
  • 0.5 probability means that the ratio of heads to
    tails tends to 0.5 the more coins we flip
  • Difference dividing by N, the number of flips

10
New Graph
  • Graph of running head vs. tail count
  • start at (0, 0)
  • heads get 1, tails get -1
  • Divide total by N

11
Simulation 2
  • N 1000000
  • heads rand(1, N) gt 0.5
  • tails heads logical NOT, flips 1s 0s
  • diff heads - tails for each coin, make 1
    for heads, -1 for tails
  • running_total cumsum(diff) cumsum means
    cumulative sum
  • e.g. cumsum( 3 4 5) would be 3 7 12
  • flips 1N generates the vector 1, 2, 3, ,
    N
  • running_ratio running_total ./ flips note
    ./ instead of /
  • plot(running_ratio ) plots the running ratio
    against x 1N
  • hold on
  • plot(0, N, 0, 0) plot a straight line from
    (0, 0) to (0, N)

12
Graph and Observations
13
Probability is subtle
  • There are many ways in which probability issues
    can surprise or catch you
  • Statistics is based on probability, and involves
    can be even more tricky

14
Probability is also fun
  • A population starts with a single amoeba. For
    this one and for the generations thereafter,
    there is a probability of 3/4 that an individual
    amoeba will split to create two amoebas, and a
    1/4 probability that it will die out without
    producing offspring. What is the probability that
    the family tree of the original amoeba will go on
    for ever?

15
Solution approaches
16
Solution approaches 2
17
In this example we saw
  • Sums of probabilities
  • Total probabilities for mutually exclusive events
    must sum to 1
  • Products of probabilities
  • Conditional probabilities
  • Read the formal presentation in textbook 2.1,
    2.2, 2.4

18
Challenge problem
  • 100 prisoners have been captured by a devious
    evil villain. They are mostly kept in solitary
    confinement, except every day, one prisoner,
    selected randomly, is brought to the common area.
    The common area contains a single light bulb
    connected to a switch. Once in the room, the
    prisoner can
  • do nothing, or
  • flip the light switch (on to off, or off to on),
    or
  • declare the incarceration over
  • The second option is risky
  • If all 100 prisoners have visited the common room
    before that day, all the prisoners are freed
  • If not, all the prisoners are sentenced to death

19
Challenge Problem Part 2
  • If the prisoners are allowed to agree on a
    strategy before being put into solitary
    confinement, what strategy should they use?
  • Problem will be posted on WebCT as puzzle for
    week 2.
  • Prize to the solution which would free the
    prisoners most quickly with at least 99 chance
    of having the prisoners released. No tricks
    allowed!
Write a Comment
User Comments (0)
About PowerShow.com