Confusion with a hard quant question

The question: A biased coin (that is, one with an unequal chance of getting heads or tails) is tossed three times in a row. If the probability of getting two heads in a row and then a tails is 3/64 and the probability of getting two tails in a row and then a heads is 9/64, what is the probability of getting a heads on the fourth flip of the coin?

In the solution, it gives an equation which is this: 3x^2(1−x)=(1−x)^2 \times x

And I’m not too sure where the left side of the equation came from.
Can someone help me with this please?

Think about what x and (1 - x) mean in the context of this question.

X refers to head and (1-x) is tails. And I know (1-x)^2 * x equals 9/64 but how does 3x^2 (1-x) also equal 9/64? Like where did 3x^2 (1-x) come from?

Notice that x^2(1 - x) is the probability of getting two heads and a tail. This is \frac{3}{64}. If we multiply by 3 on both sides, we get

3x^2(1 - x) = \frac{9}{64}

Does that help?

Oh I see! Thank you :slight_smile: