Extra Coin Win Probability
Updated
Problem statement
Player A flips n + 1 independent fair coins, and player B flips n independent fair coins. Return the probability that A obtains strictly more heads than B.
Function
extraCoinWinProbability(n: int) → doubleExamples
Example 1
n = 1return = 0.5A's two coins beat B's one coin with probability one half.
Example 2
n = 100return = 0.5The symmetry argument is independent of n.
Constraints
0 <= n <= 10^9- Results use absolute tolerance
1e-12
More Microsoft Phone Screen questions
- Config Store with Priority OverridesPHONE SCREEN · Seen Nov 2026
- Corporation Reporting LinesPHONE SCREEN · Seen Oct 2026
- Random Forest Classifier from ScratchPHONE SCREEN · Seen Oct 2026
- Least Recently Used CacheOA · PHONE SCREEN · ONSITE INTERVIEW · Seen Oct 2026
- Greedy and Beam Sentence DecodingPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
- Top K Frequent ElementsPHONE SCREEN · Seen Sep 2026
- 3SumPHONE SCREEN · ONSITE INTERVIEW · Seen Sep 2026
- Arithmetic Expression EvaluatorPHONE SCREEN · Seen Sep 2026
- Employee Hierarchy Cycle and Depth AnalysisPHONE SCREEN · Seen Sep 2026
- Most Visited String SectorsPHONE SCREEN · Seen Sep 2026
Similar questions at other companies
- Biased Coin: Probability of Exactly h HeadsAkuna Capital · PHONE SCREENAkuna Capital interview questions
- Revolver: Will the Next Shot Fire?Tower Research Capital · PHONE SCREEN
- Probability of Consecutive HeadsSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
- Expected Fake-Name CollisionsMercor · PHONE SCREENMercor interview questions
- Painted Cube: Count and RollJane Street · PHONE SCREENJane Street interview questions
- One Number Is the Average of the Other TwoSusquehanna International Group (SIG) · PHONE SCREENSusquehanna International Group (SIG) interview questions
- Count Routes Through a City GridIMC Trading · PHONE SCREENIMC Trading interview questions
- Mean vs Median: Chance of Missing the CenterHudson River Trading · PHONE SCREENHudson River Trading interview questions
- Count Clean Attendance LogsRippling · PHONE SCREENRippling interview questions
- Count Array DerangementsInMobi · PHONE SCREENInMobi interview questions