# Probability of a run

1. Dec 3, 2009

What is the probability that a run of exactly L consecutive heads (or tails) appears in N independent tosses of a coin?

Please help me with this one... I 've searched everywhere but I can't find a general answer, for example P(L,N) = ....

2. Dec 3, 2009

### fatra2

$$2^{-n}$$

3. Dec 3, 2009

That's not correct.

Let's suppose we toss a coin 3 times (N = 3) and we want a run of exactly 2 heads (L = 2). Then the combinations that include runs of HH are only two: THH and HHT
The total combinations are 2N=3=8

So, P(2,3) = 2/8 = 1/4

4. Dec 3, 2009

### fatra2

Hi there,

I am sorry. I misunderstood your question. I thought you asked what is the probably of having N consecutive heads, on N toss.

I'll look into it a bit deeper, and give you a more precise answer.

Cheers

5. Dec 3, 2009

Thank you

6. Dec 3, 2009

You can look in probability texts for discussions of "runs". There is other information here

http://mathworld.wolfram.com/Run.html

- with a "formula" that gives probabilities as coefficients from a particular generating function.

7. Dec 3, 2009

Well, I 've already seen that but I don't understand how these formulas work. Could you explain a little bit more if you can understand them?

8. Dec 3, 2009

Hi , i think this is the answer P(n,l) = C$$^{l}_{n}$$ / 2$$^{n}$$

9. Dec 3, 2009

Thank you for your answer but what exactly is C?

10. Dec 3, 2009

Oh , i made a mistake , sorry. Let me fix it . C$$^{l}_{n}$$ = $$\left(^{l}_{n}\right)$$

11. Dec 3, 2009

HOpe i'm not wrong this time .

P ( N , L ) =
$$\left\{2/2^{N} , if N = L + 1$$

$$\left\{( 2^{ N-L+1} + 2^{N-L-2} + 2 ) / 2^{N} , if N = L + 2$$

$$\left\{( 2^{N-L-1} + 2^{N-L-2} + \Sigma^{N-L-2}_{K=1}( 2^{N-L-2-K} * 2^{K} ) + 2^{N-L-1} ) / 2^{N}$$

12. Dec 4, 2009