Quoto

Learn / Library / Expected value

Long coin pattern

Expected valueHard

A fair coin is flipped repeatedly. What is the expected number of flips until the pattern (heads, heads, tails, heads, heads) first appears?

Checking an answer needs JavaScript. The hint and the solution open without it.

A whole number, a decimal, a fraction like 3/8 or a percent.

Hint

Check which prefixes of the pattern are also suffixes of it.

Solution
  1. The expected waiting time for a pattern is the sum of over every length for which the first flips equal the last flips.
  2. Here length matches ( and ) and length matches ( and ), and length matches trivially.
  3. Lengths ( against ) and ( against ) do not match.
  4. So the expectation is .

Answer: