# Easy Coin Flip Problem ???

#### fergferg

##### New Member
Hi, I need help.

Assume the probability of flipping a coin to heads 20 times in a row is 1:1,000,000

Q: Each day you wake up and flip a coin exactly 20 times. What are the odds that on one of these mornings you flip exactly 20 heads in a row?

A: I believe the answer is 1:20,000,000

The odds increase due to the 20 consecutive (Heads) having to perfectly correspond with the 20 flips on any given morning. Which would be 1:20.
Is this correct?

Now this is where my brain starts hurting.

Q: Assume that answer is correct, and I could attain such an age. What is the probability that after 20 Million mornings I would have accomplished this feat at least once?

A: I am at a loss. It seems like the answer is somewhere in between "very likely" and 100%. How does one arrive at a more precise number?

#### Con-Tester

##### Member
Assuming a fair coin, the chance of flipping 20 consecutive heads (or tails) is not 1:1,000,000.

Your thinking is faulty. Why on earth would the probability change from P to P/20? Each coin flip is an independent event, which means a coin flip does not depend on the outcome of any prior flips. What you’re implying is that the probability of a single head is 1/4 because you have to get it on a specific flip. So no, your answer to the first question is not correct.

For the second question, consider each morning’s 20 flips as a single daily event (for example, you could have a machine that flips 20 separate coins simultaneously). The probability of success on any morning is P, say. Consequently, the probability of failure on any given morning is 1 – P. What is the probability of n consecutive failures, bearing in mind that each morning’s flip result is an independent outcome? And once you know the probability of n consecutive failures, you should know how to calculate the probability of at least one success (because “at least one success” is equivalent to “not n consecutive failures”).

#### ArtK

##### New Member
I set P = 0.5 ^ 21 and calculated p for n = 1,000,000 and got p = 0.38

Using run calculator programs the result for a run of 20 in 1,000,000
trials is about 0.38 (but not exactly numerically the same as above).

So it appears that the "cost" of synchronizing is 20 to 1 (which makes
sense).

Art

#### fergferg

##### New Member
Hey guys, thanks for the replies. I appreciate your time.

Con-Tester, My fault for not being more clear. Flipping a coin "Heads" 20 times in a row would be 1:1,048,576. I just rounded it. So, I guess a better way for me to ask the question would be:

Q: Given one long coin flipping session of 1,048,576 flips; How many times would you expect 20 consecutive "Heads" to be found along the sequence of 1,048,576 flips?
A: 1, obviously

2nd Q: If the above sequence of 1,048,576 flips was sectioned into 52,428 equal and consecutive sets of 20 and 1 remaining set of 16 at the end, what would be the odds of finding 20 consecutive "Heads" in one of the 52,428 consecutive sets of 20 contained within the now sectioned 1,048,576 consecutive flips? Ignore the remaining set of 16 for simplicity.
A: Wouldn't the odds change? Wouldn't they be worse? About 1:21,000,000?

Basically, a string of 20 "Heads" are in the sequence somewhere. Wouldn't it be more likely to find it anywhere as opposed to in one of the sets of 20?

ArtK, I believe you were answering my very last question. That is, given the process was repeated 21,000,000 times, what would be the odds of success? Your answer of .38 looks kind of like mine. I used 1/e and got .37 for failure and so .63 for success. Did you use the mathematical constant "e"?

Thanks again!

#### ArtK

##### New Member
ArtK, I believe you were answering my very last question. That is, given the process was repeated 21,000,000 times, what would be the odds of success? Your answer of .38 looks kind of like mine. I used 1/e and got .37 for failure and so .63 for success. Did you use the mathematical constant "e"?
No, I did what Con-Tester suggested and found the probability for 1,000,000
mornings of twenty tosses. I discovered that the probability is the same for
that 20,000,000 tosses as for simply doing 1,000,000 tosses .... hence my
remark about the "cost" of the synchronization being 20 to 1.

Art

#### Con-Tester

##### Member
I set P = 0.5 ^ 21 and
Why 21?

Q: Given one long coin flipping session of 1,048,576 flips; How many times would you expect 20 consecutive "Heads" to be found along the sequence of 1,048,576 flips?
A: 1, obviously
No! To see why, consider the numerically far simpler case of getting two (or more) consecutive heads in five flips. That is, enumerate all 32 possible outcomes and count how many of them have two or more consecutive heads. Even if you add the constraint that it must be exactly two heads, you will find that the probability is still better than 1/5, and therefore in any run of five flips, you can expect more than one occurrence of two heads. The same principle extends to 20 consecutive heads in a run of 1,048,576 flips.

Basically, a string of 20 "Heads" are in the sequence somewhere. Wouldn't it be more likely to find it anywhere as opposed to in one of the sets of 20?
The question was about getting 20 consecutive heads in a run of 20 flips, not about getting 20 consecutive heads in a run of 1,048,576 flips. Those two situations are clearly different, and as explained in the preceding point, the second situation will on average produce (considerably) more than one set of 20 consecutive heads. So yes, it’s more likely to occur anywhere than on a “border” but your thinking goes wrong in equating the probability of “20 in 20” with “20 anywhere exactly at a border in 1,048,576”.

Finally, the apparent occurrence of e (=2.71828…) is as a result of the fact that in the limit as n → ∞, the expression (1 – 1/n)^n → 1/e. Using e is therefore not exact. It’s an approximation, a very good one to be sure, but an approximation nonetheless.

Last edited:

#### ArtK

##### New Member
Con-Tester asked why I set P = 0.5 ^ 21 instead of 0.5 ^ 20
Halving P makes the result consistent with RUNS calculator programs which find the p of
heads or tails exclusively and not inclusively. Insisting that a run be heads, for example,
and not tails means excluding half of the possible runs.

Art

#### fergferg

##### New Member
Con-Tester, the odds of flipping 20 consecutive Heads are 1 in 1,048,576 (1/2^20), wouldn't we expect one occurrence in 1,048,576 flips? Or is it one occurrence in 1,048,576 runs of 20 flips?

thanks again