Expected Tosses Until HHT Given HHT Appears Before HTH

Read the full interview experience this question came from →

Quick Overview

Coin-pattern race question in which a fair coin is tossed until HTH or HHT appears. Asks for the expected number of tosses given that HHT appears first, testing Markov chain modeling of pattern matching, win probabilities, and the correct computation of conditional expectations.

Expected Tosses Until HHT Given HHT Appears Before HTH

Company: DRW

Role: Quantitative Researcher

Category: Statistics & Math

Difficulty: hard

Interview Round: Onsite

A fair coin is tossed repeatedly until either the pattern HTH or the pattern HHT appears in three consecutive tosses. Given that HHT appears first, what is the expected number of tosses, including the final toss? ```hint Keep only the tosses that still matter Describe the process with a small set of states based on how much of either pattern the most recent tosses could still begin or continue. Conditioning on the winning pattern changes how much each path through those states should count. ``` ### Constraints and Clarifications - A pattern is detected in any three consecutive tosses, so it may reuse tosses from an earlier partial match. - The process stops at the first toss that completes either pattern. - Let $N$ be the total number of tosses. The quantity asked for is the conditional expectation $E[N \mid \text{HHT appears before HTH}]$, not the unconditional $E[N]$. - Give an exact value. ### What a Strong Answer Covers - A correct and minimal state space for the two-pattern race, including the transitions after a partial match fails. - The probability that HHT appears before HTH. - A sound way to condition on the winning pattern, rather than reporting an unconditional expected number of tosses. - A consistency check that combines the conditional expectations into the unconditional expected number of tosses. ### Follow-up Questions 1. What is the unconditional expected number of tosses, and what is the expected number given that HTH appears first? 2. Do HHT and HTH have equal chances of appearing first, even though each has probability $\tfrac{1}{8}$ in any fixed window of three tosses? Explain. 3. How would you generalize the method to a race between two arbitrary head/tail patterns of length $k$?

Overview: Coin-pattern race question in which a fair coin is tossed until HTH or HHT appears. Asks for the expected number of tosses given that HHT appears first, testing Markov chain modeling of pattern matching, win probabilities, and the correct computation of conditional expectations.

Read the full DRW Quantitative Researcher interview experience this question came from

|Home/Statistics & Math/DRW
DRW logo
DRW
Sep 13, 2026
hardQuantitative ResearcherOnsiteStatistics & Math
1
0

A fair coin is tossed repeatedly until either the pattern HTH or the pattern HHT appears in three consecutive tosses.

Given that HHT appears first, what is the expected number of tosses, including the final toss?

Constraints and Clarifications

  • A pattern is detected in any three consecutive tosses, so it may reuse tosses from an earlier partial match.
  • The process stops at the first toss that completes either pattern.
  • Let NN be the total number of tosses. The quantity asked for is the conditional expectation E[NHHT appears before HTH]E[N \mid \text{HHT appears before HTH}] , not the unconditional E[N]E[N] .
  • Give an exact value.

What a Strong Answer Covers Guidance

  • A correct and minimal state space for the two-pattern race, including the transitions after a partial match fails.
  • The probability that HHT appears before HTH.
  • A sound way to condition on the winning pattern, rather than reporting an unconditional expected number of tosses.
  • A consistency check that combines the conditional expectations into the unconditional expected number of tosses.

Follow-up Questions Guidance

  1. What is the unconditional expected number of tosses, and what is the expected number given that HTH appears first?
  2. Do HHT and HTH have equal chances of appearing first, even though each has probability 18\tfrac{1}{8} in any fixed window of three tosses? Explain.
  3. How would you generalize the method to a race between two arbitrary head/tail patterns of length kk ?
Loading comments...