# Markov chain for tossing coins

• Jul 5th 2011, 09:36 PM
CountingPenguins
Markov chain for tossing coins
Question:
A coin is tossed until five consecutive heads appear. Model this process as a Markov chain where the states are the numbers of consecutive heads. (0,1,...,5).
a. Find the probability that it takes 10 or fewer tosses to observe five consecutive heads.
b. Find the mean number of tosses it takes to obtain five consecutive heads.

What I know - the probability of getting 5 H in a row is 1/32
I also know I shouldn't be confused about this, but I'm missing something.

Can you help?
• Jul 5th 2011, 09:47 PM
TKHunny
Re: Markov chain for tossing coins
Start - State 0

Flip a Tails = Stay in State 0 probability is 50%
Flip a Heads = Move to State 1 probability is 50%

Next?
• Jul 5th 2011, 09:55 PM
CountingPenguins
Re: Markov chain for tossing coins
Thanks for answering. So, if I flip a tails I have to start again, right? But if I get heads I flip again and I either end up with a tails and have to start again or get heads and keep going. How do I summarize this in a chart does it have 0-10 on the top and on the side and then just work on the probabilities within it?
• Jul 5th 2011, 11:45 PM
CountingPenguins
Re: Markov chain for tossing coins
After working on this for some time, I am wondering what the matrix looks like.
• Jul 6th 2011, 12:17 AM
CaptainBlack
Re: Markov chain for tossing coins
Quote:

Originally Posted by CountingPenguins
Question:
A coin is tossed until five consecutive heads appear. Model this process as a Markov chain where the states are the numbers of consecutive heads. (0,1,...,5).
a. Find the probability that it takes 10 or fewer tosses to observe five consecutive heads.
b. Find the mean number of tosses it takes to obtain five consecutive heads.

What I know - the probability of getting 5 H in a row is 1/32
I also know I shouldn't be confused about this, but I'm missing something.

Can you help?

The states are 0,1,2,3,4,5 the probability of transition from n to state n+1, n=0,1,2,3,4 is 0.5,from state n to state 0 , n=1,2,3,4 is 0.5. State 5 is absorbing (the transition probability from 5 to 5 is 1),the transition probability from state 0 to state 0 is 0.5. All other transition probabilities are 0.

Now write this as a transition matrix.

CB
• Jul 6th 2011, 12:37 AM
CountingPenguins
Re: Markov chain for tossing coins
Thank you! I got .015625 for part a using .5^(5+1) and 62 coin flips on average to get 5 in a row - using 2^(5+1)-2.
• Jul 6th 2011, 05:37 AM
CaptainBlack
Re: Markov chain for tossing coins
Quote:

Originally Posted by CountingPenguins
Thank you! I got .015625 for part a using .5^(5+1) and 62 coin flips on average to get 5 in a row - using 2^(5+1)-2.

How to you argue that those are the answers.

Post what you have for the transition matrix A and given that before the first flip you are in state 0 what is [1,0,0,0,0,0]A^10?

CB