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. Biased Coin to Fair Bit (Von Neumann)

VLSI DV Interview Puzzles · All levels

Biased Coin to Fair Bit (Von Neumann)

Given a biased coin with unknown P(H)=p, generate an unbiased bit and compute expected tosses per fair bit.

On this page

    Puzzle

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

    Given a biased coin with unknown P(H)=p, generate an unbiased bit and compute expected tosses per fair bit.

    Hint

    Use two-toss ordered pairs and keep only anti-symmetric outcomes.

    Step-by-step solution

    Diagram
    1) Toss twice; outcomes are HH, HT, TH, TT.
    2) Emit 1 for HT, emit 0 for TH, reject HH and TT.
    3) Fairness: P(HT)=p(1-p) and P(TH)=(1-p)p, so both outputs are equiprobable.
    4) Acceptance probability per 2-toss trial is P(HT or TH)=2p(1-p).
    5) Expected accepted-trial count is 1/[2p(1-p)].
    6) Multiply by 2 tosses per trial => expected tosses = 1/[p(1-p)].

    Answer

    Answer: Use HT/TH mapping; expected tosses per unbiased bit are 1/(p(1-p)).

    Why candidates get it wrong

    Using single toss plus threshold is impossible when p is unknown.

    Interviewer follow-up

    Can you design a streaming variant that wastes fewer tosses on average?

    Related topics

    • Back to Probability Puzzles

    • Logic & Aptitude Puzzles section

    Previous

    161 / 210

    Next: Expected Tosses Until First HH

    Up next

    Up nextExpected Tosses Until First HH

    Sign in to save progress

    Practice this lessonReport an error

    See also

    • Two Children, At Least One Boy
    • Monty Hall Switching Odds
    • Birthday Collision Threshold