# Probability of getting a streak

1. Dec 17, 2012

### Biosyn

1. The problem statement, all variables and given/known data

If a coin is tossed 200 times, what is the probability of getting 5 heads in a row?

2. Relevant equations

3. The attempt at a solution

I know that the probability of getting 5 heads in a row for the first 4 flips is 0. I don't know what to do with that information.

1 - [(0.5)^5 * (0.5)^195] ?

I used this streak simulator:
http://www.pulcinientertainment.com/info/Streak-Calculator-enter.html#ev-runs

And the probability is 0.965903381259682.

2. Dec 17, 2012

### haruspex

Are you familiar with Markov chains?

3. Dec 17, 2012

### Biosyn

No, I am not.

We are starting binomial distributions in our stats class this week.

4. Dec 18, 2012

### haruspex

Then this rather an advanced problem. See e.g. http://math.stackexchange.com/quest...ngth-of-the-longest-run-in-n-bernoulli-trials, http://mathworld.wolfram.com/Run.html.
You can get a crude lower bound by chopping the 200 into 22 blocks of 9 (and 2 left over). (9, because 9 = 5*2-1, so there cannot be two separate runs of 5 in the same block.) This allows us to break it into 5 disjoint cases:
- HHHHHxxxx
- THHHHHxxx
- xTHHHHHxx
- xxTHHHHHx
- xxxTHHHHH
for a tot prob of 3/32.
The prob that none of the 22 blocks have such a run is therefore (1-3/32)22 ≈ 0.11. But 0.89 is some way short of the 0.96 you found.

5. Dec 18, 2012

### Biosyn

Oh you posted this before I was going to edit my first post.
I asked this question earlier today and someone answered it. Would you mind explaining his solution to me?

What is (1/32)(1/2).
Is this the probability of getting 5 heads for the first 5 flips multiplied by the probability of getting a head the next flip?

Last edited by a moderator: May 6, 2017
6. Dec 18, 2012

### haruspex

It considers the last 5 toss outcomes at any point. If you've not had a run of 5Hs yet, the mutually exclusive possibilities can be categorised as:
xxxxT
xxxTH
xxTHH
xTHHH
THHHH
the probs being 1/2, 1/4, 1/8..., 1/32. It treats this as a 'steady state', i.e., so long as you've still not had a run of 5Hs this always represents the current state. (It's clearly not quite right because it does not add up to 1.)
The prob of completing a run of 5Hs at the next toss is therefore 1/64. If we do not complete such a run, either because we toss a T or were not yet in the '4H' state, the assumption is that we remain in the 'steady state' distribution. So the prob of getting no run is (1-1/64)196 ≈ 4.6%

7. Dec 18, 2012

### Biosyn

Ah I see. Thank you.

[STRIKE]
So let me summarize what I get out of this. And then would you correct me?

If we have not completed a run of 5H, then it can be assumed that we remain in 'steady state' distribution meaning it can be either of those mutually exclusive categories (P(0)-P(4)).

And 1/64 is the probability of completing a run. So to find out the probability of not completing a run, we subtract 1/64 from 1. And take it to the power of 196 because we subtract the first 4 flips which have a probability of 0 of flipping 5 heads consecutively.
[/STRIKE]

I'm confused here:

xxxxT_ The probability of getting a head next: 1/2
xxxTH_ The probability of getting a head next: 1/4
xxTHH_ The probability of getting a head next: 1/8
xTHHH_ The probabilit of getting head next: 1/16
THHHH_ The probability of getting a head next: 1/32

And the probability of getting a run of 5H is 1/64.

But isn't the probability of getting 5 heads .5^5? Or is it because you flipped a Tails first.

Last edited: Dec 18, 2012
8. Dec 18, 2012

### haruspex

No, those are the probabilities of being in those states. In each case, the prob of a head next is 1/2.