# Coin Tossings probability

I want to find the probability that in ten tossings a coin falls heads at least five times in succession. Is there any formula to compute this probability?

Answer provided is $$\frac{7}{2^6}$$

• Is it a homework?
– Tim
Commented Sep 28, 2018 at 11:55
• @Tim You may say it is homework. Because I have taken this question from Williams Feller's book on Probability. Commented Sep 28, 2018 at 11:59
• There's a cute algorithm to find the probability when "ten" is replaced by $n\gt 5.$ Start with the sequence $0,0,0,0,0,1.$ Grow it to the right by appending three times the last value minus the sum of the previous five minus the sixth from the right, until there are $n+1$ numbers. Divide the last by $2^n.$ The sequence is $0,0,0,0,1,3,8,20,48,112,255,571,1262,2760,\ldots$ For instance, the value $571 = 3(255) - (112+48+20+8+3) -3.$ Your answer is, of course, $112/2^{10} = 7/2^6.$ Similar formulas apply when "five" is replaced by any whole number.
– whuber
Commented Dec 13, 2018 at 23:20

To avoid double counting, we can calculate how many outcomes give us EXACTLY $$5$$ sequential heads, then add number of outcomes which give us exactly $$6$$ heads and so on.

H is the head, T is the tail, X is any (either H or T)

• Exactly $$5$$ sequential heads:

H H H H H T X X X X..........2^4
T H H H H H T X X X..........2^3
X T H H H H H T X X..........2^3..........Total: 2*2^4 + 4*2^3 = 64
X X T H H H H H T X..........2^3
X X X T H H H H H T..........2^3
X X X X T H H H H H..........2^4

• Exactly $$6$$ sequential heads:

H H H H H H T X X X..........2^3
T H H H H H H T X X..........2^2
X T H H H H H H T X..........2^2...........Total: 2*2^3 + 3*2^2 = 28
X X T H H H H H H T..........2^2
X X X T H H H H H H..........2^3

• Exactly $$7$$ sequential heads:

H H H H H H H T X X..........2^2
T H H H H H H H T X..........2............Total: 2*2^2 + 4 = 12
X T H H H H H H H T..........2
X X T H H H H H H H..........2^2

• Exactly $$8$$ sequential heads:

H H H H H H H H T X..........2
T H H H H H H H H T..........1............Total: 5
X T H H H H H H H H..........2

• Exactly $$9$$ sequential heads:

H H H H H H H H H T..........1............Total: 2
T H H H H H H H H H..........1

• Exactly $$10$$ sequential heads:

H H H H H H H H H H..........1............Total: 1


Now we add all values that marked as "Total" and divide them by $$2^{10}$$. We GUARANTEE that all listed outcomes do not intersect, so there is no double counting.

So the answer is $$7/64$$.

During writing this answer I saw that the question has already been answered but I will post my solution nonetheless.

The options are:

$$(X,X,X,X,X,-,-,-,-,)$$

$$(-,X,X,X,X,X,-,-,-,-,)$$

$$(-,-,X,X,X,X,X,-,-,-,)$$

$$(-,-,-,X,X,X,X,X,-,-)$$

$$(-,-,-,-,X,X,X,X,X,-)$$

$$(-,-,-,-,-,X,X,X,X,X)$$

where $$X$$ denotes heads and $$-$$ is a placeholder.

1. Line: there are $$2^5$$ options of obtaining at least those 5 heads at the first 5 tosses: $$2^5$$

2. Line: There are $$2^4$$ possibilities for the last 4, but only 1 for the first (which must be tails) because if the first was $$X$$ we would be in line 1: therefore $$2^4$$

3. Line: There are $$2^3$$ possibilities for the last three, but we can vary only the first one, the second one has to be tails as otherwise we are again in one of the upper cases: $$2^3\cdot 2^1$$

4. Line: There are $$2^2$$ for the last two and $$2^2$$ for the first 3, as we can vary the first and the second one without falling into one of the upper cases (the fourth one being tails again)

5. Line: $$2^1$$ for the last one and $$2^3$$ for the first, the second and the third

6. Line: We can vary the first, second, third and fourth arbitrarily (as long as fifth is tails) without falling into the upper cases.

therefore we obtain $$\frac{2^5+5\cdot2^4}{2^{10}}= \frac{7}{2^6}$$

Corrected answer after Orangetree pointed out I forgot to take into account events were not mutually exclusive.

You need to think about how many different coin tossing sequences give at least $$5$$ consecutive heads, and how many coin tossing sequences there are in total, and then take the ratio of the two.

Clearly there is $$2^{10}$$ coin tossing sequences in total, since each of $$10$$ coins have $$2$$ possible outcomes.

To see how many sequences have $$5$$ consecutive heads consider the following. In any sequence

$$X-X-X-X-X-X-X-X-X-X$$

We can put the $$5$$ consecutive heads in $$5$$ places. This can be seen by putting it at the start of thee sequence, and then moving it over step by step.

$$H-H-H-H-H-X-X-X-X-X$$ $$X-H-H-H-H-H-X-X-X-X$$ $$X-X-H-H-H-H-H-X-X-X$$ $$X-X-X-H-H-H-H-H-X-X$$ $$X-X-X-X-H-H-H-H-H-X$$ $$X-X-X-X-X-H-H-H-H-H$$

For the first scenario, we have $$2^5$$ possible sequences since the remaining coins can be either heads or tails without affecting the result.

For the second scenario, we can only take $$2^4$$ since we need to fix the first coin as tails to avoid counting sequences more than once.

Similarly, for the third scenario we can count $$2^4$$ un-counted sequences, as we fix the coin preceeding the sequence as tails.. and so on

This gives total number of ways

$$2^5 + 2^4 + 2^4 + 2^4 + 2^4 + 2^4 = 2^4(2+1+1+1+1+1) = 2^4\times 7$$

Hence the probability should be

$$\frac{2^4 \times 7}{2^{10}} = \frac{7}{2^6}$$

To actually answer your question if a general formula exists, the reasoning above can be extended to give the probability of at least $$m$$ heads out of $$n$$ coin tosses as

$$\frac{2^{m-1}(2+(n-m))}{2^n} = \frac{2+n-m}{2^{n-m+1}}$$

• Not "five times in succession". At least five times in succession. Commented Sep 28, 2018 at 12:19
• Why would that affect the result? The remaining 5 coins can also be heads. The above gives the probability of at least 5 heads, not 5 heads exactly. Commented Sep 28, 2018 at 12:19
• the events are not mutually exclusive so you cannot simply add their probabilities Commented Sep 28, 2018 at 12:24
• Oh I see your logic. But you're counting some results more than once, as @0rangetree points out. Commented Sep 28, 2018 at 12:26
• I think this is correct now Commented Sep 28, 2018 at 12:50