Find expected tosses to see a coin pattern
BnpData Scientist · Technical ScreenLast updated
Assesses probabilistic reasoning and stochastic-process modeling skills, focusing on expected stopping times for pattern occurrences in repeated independent trials and related concepts like state-space representation and overlap effects.
A fair coin is tossed repeatedly until a target length-3 pattern appears as a consecutive substring (e.g., HHH, HTH, HTT, etc.).
- Describe a general method to compute the expected number of tosses to see a given pattern.
- Compute the expected number of tosses for HHH and for HTH.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.