Joe flips a coin 20 times, find the probability that he never gets 2 consecutive heads or 3 consecutive tails.
Consider the simpler problem of no consecutive heads and also no consecutive tails. After the first flip, the next 19 flips are fully determined. So there are only 2 possible patterns.
Suppose you do 18 flips under these new rules. There are only 2 ways. There are 9 Heads and 9 Tails. If you select any 2 of those Heads and double them, you have accounted for a way of doing 20 flips under the actual rules. So if we, somewhat arbitrarily select 18, this accounts for 2*Combin(9,2) ways of achieving our goal of 20 flips.
For an odd number 2k+1, there might be k Heads or k+1 Heads.
We can figure this for numbers from 20 down until there are not enough Heads to double to construct 20:
20+0 2*C(10,0)
19+1 C(10,1) + C(9,1)
18+2 2*C(9,2)
17+3 C(9,3) + C(8,3)
16+4 2*C(8,4)
15+5 C(8,5) + C(7,5)
14+6 2*C(7,6)
13+7 C(7,7)
for 13 there is only one way, 1st coin must have been Heads
The sum of all these combinations should be the answer: 465
465 is in agreement with Charlie's result which is always a good sign.
|
Posted by Larry
on 2024-11-12 13:19:32 |