probability of consecutive heads

galactus

Super Moderator
Staff member
Joined
Sep 28, 2005
Messages
7,216
I have a probability problem I was wondering if there is a cool generating function or something to deal with it.

Suppose you flip a fair coin 20 times, what's the probability that you get at least 6 consecutive heads?. at least 10 consecutive heads?. Exactly 8 consecutive heads?. And so forth.

The operative word here is consecutive

If it weren't for the 'consecutive', a binomial could easily be used.

I know that the expected number of flips before one gets 6 consecutive heads is 126. Perhaps that can be used somehow.

I set up a Markov chain for smaller numbers of trials, but this is rather large. I suppose I could for this also, but the matrix would be bigger. Is there a cool way to tackle it?.
 
I dont have a function but the way I tried to find is this:
suppose you have an information which is 20 bit (because of the importance of order)
6 consecutive ones can be in 15 different position
ones from 1 to 6
ones from 2...7
.....
ones from 15...20

this becomes a set of possibilities and at first I tried to find an information(which is coded in 20 bit by 1 and 0) which includes only one 6 consecutive series.
when we have one consecutive series the other 14 blanks can be filled in 2^14 ways and the whole possibility of filling is 2^20 and also we dont need the other consecutive series therefore we should disable the series after number six
7..12
8..13
9..14
...
15..20
are disabled so 8 of them are disabled
the result of reaching only one consecutive series in first 6 position is:
(2^14-8)/(2^20)
reaching only one consecutive series in another six places should be found, and this process changes the number 8 to another number in each time. the possibilities in which we have two consecutive series in two positions and three consecutive series in three positions,should be found and added to the whole possibility value for once so we can find the compound set.
 
I beleive it may be some sort of Bernoulli trial. Thaks for the input.

I ran the first one through a Markov and got the prob. of at least 6 heads in 20 tosses as 128257/1048576.

The closed-form for this is rather difficult, I think.
 
galactus said:
I ran the first one through a Markov and got the prob. of at least 6 heads in 20 tosses as 128257/1048576.
128257 / 1048576 = .1223154.....

I ran a simulation for 1 million tries, 10 times, and got 10 results
all of them over 122,200 and below 122,400; so your ~122,315 looks good :?:
 
Top