Skip to content
DenseChip
Learn
PracticeCode labInterview

DenseChip

Navigate

Menu

LearnPracticeCode labInterview

Tools

All toolsSV editorCode repoResume
DenseChip

Practice, courses, and chip-design tools in one focused workspace.

LearnPracticeCode labInterviewToolsLearning paths

© 2026 DenseChip

AboutContactPrivacyTerms
Skip to lesson

Course contents

  • How to Use This Puzzle Bank
  • SystemVerilog Language Puzzles25
  • Difficulty Guide
  • Full Topic Map
  • Interview-Day Tips
  • OOP & Testbench Puzzles25
  • Concurrency & Timing Puzzles25
  • Randomization & Constraint Puzzles25
  • SVA Assertion Puzzles25
  • Functional Coverage Puzzles25
  • Logic & Aptitude Puzzles25
    • Classic Brain Teasers
    • Probability Puzzles
      • Biased Coin to Fair Bit (Von Neumann)
      • Expected Tosses Until First HH
      • Two Children, At Least One Boy
      • Monty Hall Switching Odds
      • Birthday Collision Threshold
      • Bayes on Failing Test Alerts
    • Digital Logic Puzzles
    • Debugging Riddles
    • Logic & Aptitude Puzzles: Tricky Q&A
  • Scenario & Debug Puzzles25
  • Interview Prep: Puzzle Rounds5
  • DV Puzzle Cheatsheet
Loading lesson

‹Probability Puzzles
  1. Topics
  2. DV Interview Puzzles
  3. Logic & Aptitude Puzzles
  4. Probability Puzzles
  5. Expected Tosses Until First HH

VLSI DV Interview Puzzles · All levels

Expected Tosses Until First HH

For a fair coin, what is the expected number of tosses until two consecutive heads first appear?

On this page

    Puzzle

    Difficulty: Medium · Puzzle 2 of 6 · Topic: Probability Puzzles

    For a fair coin, what is the expected number of tosses until two consecutive heads first appear?

    Hint

    Define states by suffix memory: start and 'last toss was H'.

    Step-by-step solution

    Diagram
    1) Let E be expectation from start, and E_H from state 'last toss was H'.
    2) From start: E = 1 + 0.5*E_H + 0.5*E.
    3) From E_H: one toss occurs. With prob 0.5 get H and finish, with prob 0.5 get T and return to start.
    4) So E_H = 1 + 0.5*0 + 0.5*E = 1 + 0.5E.
    5) Rearranging first equation: 0.5E = 1 + 0.5E_H => E = 2 + E_H.
    6) Substitute: E = 2 + 1 + 0.5E => 0.5E = 3 => E = 6.

    Answer

    Answer: Expected tosses to first HH are 6.

    Why candidates get it wrong

    Counting only the HH pattern itself and ignoring restarts after HT.

    Interviewer follow-up

    What is the expected toss count until first HT?

    Related topics

    • Back to Probability Puzzles

    • Logic & Aptitude Puzzles section

    Previous

    162 / 210

    Next: Two Children, At Least One Boy

    Up next

    Up nextTwo Children, At Least One Boy

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Monty Hall Switching Odds
    • Birthday Collision Threshold
    • Bayes on Failing Test Alerts