Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Coin Flip

Options
  • 08-04-2009 12:22pm
    #1
    Closed Accounts Posts: 99 ✭✭


    How do I calculate the probability of a coin flip landing on a certain side a certain amount of times in a row given the total number of flips.

    My Question: Flipping a coin 352 times, what is the probability of the result being heads 30 times in a row at some stage over the 352 flips? Obviously small but how small


Comments

  • Registered Users Posts: 111 ✭✭getting worse


    Hi, I think the answer is along these line probability of 30 coin flips is a row landing on heads say is 1/2 to the power 30. but if you are tossing coin 352 times you give yourself 322 chances of tossing 30 in a row so the anwers is 322 divided by 1/2 to the power 30.


  • Registered Users Posts: 170 ✭✭.50 (MOA)


    not sure if this is right but i'll give it a stab anyway.

    (.5^30) x (352-30) = 299.885869 x10^-9 or .000000299885869 in 1

    you would neet to toss the coin 1,073,741,824 times to get 30 in a row,- one billion, seventy three million, seven hundred and forty one tousand, eight hundred and twenty four.

    seems logical to me at least

    .5^30 is the probabiliity of getting 30 of one side (heads or tails) in a row

    352-30 (322) is the number of instances of 30 coin flips in a row that occur over a collection of 352 tosses

    multiplying the two makes this happening more likely (322 times more likely) as is the case.


  • Registered Users Posts: 170 ✭✭.50 (MOA)


    on reflection, as long as you only wanted 30 of any side in a row i.e. 30 heads or 30 tails, then you only need 29 of the same in a row.
    the first toss would be lets say a head and the next 29 need to be a head. but if a tail was first then you'd still only need 29 in a row.

    it could be written for 5 flips in 10 as this sum


    (1/1 x 1/2 x 1/2 x 1/2 x 1/2) x (10-5) = .3125 or 1 in 3.2

    the first can be either (heads or tails), the rest have to be the same.

    however if you needed 30 heads in a row then it would still be 1/2 to the power of 30


  • Registered Users Posts: 1,595 ✭✭✭MathsManiac


    You might find this link useful:

    http://mathworld.wolfram.com/Run.html


  • Registered Users Posts: 1,163 ✭✭✭hivizman


    It's good to see that there is a solution, though actually calculating what the answer is to the particular question must be highly complex.

    At first, I thought that the question could be solved easily by (1) calculating the probability of getting 30 heads in 30 tosses (0.5^30), (2) determining the probability of NOT getting 30 heads in 30 tosses (1 - 0.5^30), (3) noting that there are 352-30+1 = 323 sequences of 30 tosses in a series of 352 tosses, (4) calculating the probability that none of these sequences consists of 30 heads [(1 - 0.5^30)^323], and then calculating the probability of at least one sequence of 30 heads 1 - [(1 - 0.5^30)^323].

    But this is a fallacious calculation, because it assumes that each sequence of 30 tosses within the overall set of 352 tosses is independent of any other sequence, but as the sequences overlap, this condition of independence doesn't hold. Hence the calculation breaks down at step (4)

    Although this approach works for the trivial case of sequences of one head (because in that case each toss is independent of other tosses), I confirmed that the method doesn't work in general by looking at the special case of sequences of 2 heads. I actually worked out the formula shown in the linked site, involving the difference between a power of 2 and a Fibonacci number. But I couldn't generalise this to sequences of 3 heads, and as a result I gave up. So thanks to MathsManiac for saving me from a frustrating Easter.


  • Advertisement
  • Registered Users Posts: 1,595 ✭✭✭MathsManiac


    You might also be interested to know that analysing the probabilities of sequences of runs like this leads to a useful hypothesis test of randomness in a sequence, called the "runs test", (not to be confused with the similarly titled criterion for determining whether the curry you had on Saturday night was dodgy;)).

    This is hinted at in the Wolfram article, (since he refers to the distribution of runs,) but there's a bit more here: http://en.wikipedia.org/wiki/Wald-Wolfowitz_runs_test


  • Closed Accounts Posts: 99 ✭✭getonyourboots


    Got this equation from another site.
    Whats the result as an odds?

    (232 * 2^322) / 2^352 = 323/ 2^30


Advertisement