# Probability of a run

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) = ....

## Answers and Replies

$$2^{-n}$$

$$2^{-n}$$

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

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

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

Thank you

Homework Helper
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.

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.

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?

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

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

Thank you for your answer but what exactly is C?

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

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}$$

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}$$

Sorry mate but both your solutions are wrong. You can easily prove this if you try to find P(2,5) or P(1,5) or whatever you want...

Does anybody know if such a formula even exists?