# Coin flipping (Markov chain)

Suppose that coin 1 has probability 0.7 of coming up heads, and coin 2 has probability 0.6 of coming up heads.

If the coin flipped today comes up heads, then we select coin 1 to flip tomorrow, and if it comes up tails, then we select coin 2 to flip tomorrow.

If the coin initially flipped is equally likely to be coin 1 or coin 2, then

a)what is the probability that the coin flipped on the third day after the initial flip is coin 1?

b)Suppose that the coin flipped on Monday comes up heads. What is the probability that the coin flipped on Friday of the same week also comes up heads?

My attempt to answer this question:

The probability that coin 1 show head on tossing = 0.7

The probability that coin 2 show head on tossing = 0.6.

If coin initially flipped is equally likely to be coin 1 or coin 2, then the probability that head will come up on tossing the coin = $$\frac12 \times 0.7 + \frac12 \times 0.6 = 0.65.$$

Similarly the probability that tail will come up on flipping coin initially $$= \frac12 \times 0.3 + \frac12 \times 0.4 = 0.35$$ So, X is a random variable whose value depends upon the experiment having the output coin 1 or coin 2. $$\{X_n, n\geqslant 0\}$$ is a Markov chain and indicates random variable X's value after nth steps.

The transition probability matrix is $$P = \begin{bmatrix} 0.65 & 0.35 \\ 0.35 & 0.65 \end{bmatrix}$$

a)The probability that the coin flipped on third day is coin 1 after the initial flip is coin 1 = 0.545 where $$P^{(2)} = \begin{bmatrix} 0.545 & 0.455 \\ 0.455 & 0.545 \end{bmatrix}$$

b) The probability that the coin flipped on friday of the same week also comes up heads given that the coin flipped on monday comes up head = 0.5135 where $$P^{(3)} = \begin{bmatrix} 0.5135 & 0.4865 \\ 0.4865 & 0.5135 \end{bmatrix}$$

You are making it more complicated than it needs to be. The transition probabilities are

$$P = \begin{bmatrix} 0.7 & 0.3 \\ 0.6 & 0.4 \end{bmatrix}$$

Because from the first coin there's a 70 % chance you end up with the first coin again, and 30 % you end up with the second coin. Same for the second coin but 60/40.

Take this to the dth power for d days of flipping. Then multiply by the (0.5, 0.5) vector to indicate that the first flip may happen with either coin.

So this would be the probabilities after the second day's flip: https://www.wolframalpha.com/input?i=%7B.5%2C.5%7D++%7B%7B.7%2C.3%7D%2C%7B.6%2C.4%7D%7D%5E2

This gives the third day a 67 % chance of flipping coin 1.

• @DhamnekarWinod no, that's what the multiplication with (0.5,0.5) accomplishes.
– kqr
Jul 30, 2022 at 7:17
• @DhamnekarWinod The transition matrix you wrote in the comment is wrong because the first column indicates probability of heads, which for the second coin (second row) was 0.6 according to the setup.
– kqr
Jul 30, 2022 at 13:18
• @DhamnekarWinod the first row is coin 1, the second row is coin 2. The first column is probability of heads, the second is probability of tails.
– kqr
Jul 30, 2022 at 13:19
• @DhamnekarWinod the Markov chain interpretation of this is that the first column is the probability of going to state 1 and the second column is the probability of going to state 2, depending on which state you're in (one row for each).
– kqr
Jul 30, 2022 at 13:27
• Yes, since both coins are so similar and the starting state Is so close to the stationary state, the two answers are basically the same up to rounding error.
– kqr
Jul 30, 2022 at 16:49