# Thread: Came across a very difficult problem...

1. ## Came across a very difficult problem...

I really thought hard over this problem for about a hour or two. Here's the problem:

A coin has P(head) = p. Keep tossing until you finish a run of 5 heads (i.e., until you get a 5 heads in a row). Find the expected number of tosses it takes.

So's here's my work. I don't know if I am doing it correctly.

Using the definition of expected value:

EX = sum(x*P(X=x))

Where X is the number of tosses to get a run of 5 heads.

The probability of getting a run of 5 heads at

5 tosses (HHHHH): p^5
6 tosses (THHHHH): q*p^5
7 tosses (☐THHHHH) : (p+q)*q*p^5 = q*p^5 (since p+q=1)
8 tosses (☐☐THHHHH): (p+q)^2*q*p^5 = q*p^5

So, the expected value is:

EX = 5*p^5 + 6*q*p^5 + 7*q*p^5 + 8*q*p^5 + ...

Looks like the answer diverges, so I must be doing something wrong here.

2. ## Re: Came across a very difficult problem...

If you're assuming independence, then the number of replications (N) would be N = E{X)/p based on 5 tosses.

3. ## Re: Came across a very difficult problem...

Originally Posted by Dragan
If you're assuming independence, then the number of replications (N) would be N = E{X)/p based on 5 tosses.
I'm don't follow what you are trying to say. What I am looking for is the expected value, and I don't see how I can use the number of trials (N) in the equation.

4. ## Re: Came across a very difficult problem...

This is a very well-known, commonly asked Markov Chain problem. The number of tosses itself will follows a discrete phase-type distribution.

Without touching the notion of Markov Chain, you may just need the following "idea of regeneration" to solve this problem.

1. Note that forms a partition.

denotes equal in distribution; and those sequence are from results beginning from first toss.

Now you may use Law of total expectation to calculate .

5. ## The Following User Says Thank You to BGM For This Useful Post:

hlsmith (09-12-2013)

6. ## Re: Came across a very difficult problem...

BGM - answering probability problems, all day, everyday, with authority. I always look forward to your cryptic looking resolutions of countless (well maybe 2,500) probability problems. Some day I am going to invest some time and try to read all of your posts, so I can acquire a sound and well versed education in the ways.

Keep up the solid work (of having me scratch my head and say "what now")!

 Tweet

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts