FastPrepStrictly More Heads with Fewer Coins
Problems/Strictly More Heads with Fewer Coins

Strictly More Heads with Fewer Coins

Susquehanna International Group (SIG) logoSusquehanna International Group (SIG)● EasyNEW GRADPHONE SCREEN

Updated Nov 2026

QuestionFunctionExamplesConstraints

Problem statement

Source note: A new grad report from early 2017 describes an HR screen with SIG, after which a quant asked three questions. One of them: one person tosses eight coins, another tosses ten, and the task is the chance that the person with eight coins ends up with more heads.

The report gives no input format or required precision and does not say the coins are fair. Here, the coins are fair. Both coin counts are inputs from 0 to 1000. "More" means strictly more, so a tie does not count. The eight-against-ten case is the first example. Answers within 10^-9 (absolute or relative) are accepted.

Our version is about 90% the same as the reported question.

You toss n fair coins, and the other player tosses m fair coins. Every coin lands heads or tails with chance 1/2, independently of all the others.

Return the probability that you get strictly more heads than the other player. A tie does not count as a win.

Your answer is accepted if its absolute error or its relative error is at most 10^-9.

Function

moreHeadsProbability(n: int, m: int) → double

Examples

Example 1

n = 8m = 10return = 0.2403411865234375

This is the interview case: 8 coins against 10.

Your heads are more than theirs exactly when your heads plus their tails is at least 11, and that sum behaves like the number of heads in 18 fair coins. So the answer is (C(18, 11) + C(18, 12) + ... + C(18, 18)) / 2^18 = 63004 / 262144 = 15751 / 65536, about 0.24034.

Example 2

n = 11m = 10return = 0.5

With one coin more than the other player, the answer is exactly 1/2. Your heads plus their tails counts heads in 21 fair coins, and you win when it is at least 11. Of 21 fair coins, at least 11 heads and at most 10 heads are equally likely, by symmetry.

Example 3

n = 1m = 1return = 0.25

One coin each. You win only if your coin is heads and theirs is tails: 1/2 × 1/2 = 1/4. Both heads or both tails is a tie, which does not count.

Constraints

  • 0 <= n, m <= 1000

More Susquehanna International Group (SIG) Phone Screen questions

  • Dice Sum That Is a Multiple of mPHONE SCREEN · Seen Nov 2026
  • Find Median from Data StreamPHONE SCREEN · Seen Nov 2026
  • Painting Arcs to Nearest Neighbors on a CirclePHONE SCREEN · Seen Sep 2026
  • Filter Movies by Inclusive Year RangePHONE SCREEN · Seen Jul 2026
  • Best Single Reroll for Five DicePHONE SCREEN · Seen Feb 2026
  • Catching the Bus to the MoviePHONE SCREEN · Seen Jan 2026
  • Two Dice Summing to a TargetPHONE SCREEN · Seen Jan 2026
  • Median of Uniform Draws in an IntervalPHONE SCREEN · Seen Oct 2025
  • One Number Is the Average of the Other TwoPHONE SCREEN · Seen Jun 2025
  • Which Coin Pattern Shows Up FirstPHONE SCREEN · Seen May 2025

Similar questions at other companies

  • Biased Coin: Probability of Exactly h HeadsAkuna Capital · PHONE SCREENAkuna Capital interview questions
  • Probability of Consecutive HeadsSquarepoint Capital · PHONE SCREENSquarepoint Capital interview questions
  • Count Routes Through a City GridIMC Trading · PHONE SCREENIMC Trading interview questions
  • Count Clean Attendance LogsRippling · PHONE SCREENRippling interview questions
  • Count Array DerangementsInMobi · PHONE SCREENInMobi interview questions
  • Count Staircases with Strictly Increasing StepseBay · ONSITE INTERVIEWeBay interview questions
  • Count Nondecreasing Digit-Sum ArraysMicrosoft · OAMicrosoft interview questions
  • Stable Workload Redistribution TreesTower Research Capital · OA
  • Count Valid A-B-C Sequences Under a Modulo-Four RuleInfosys · OAInfosys interview questions
  • Count Shipment SchedulesMorgan Stanley · OAMorgan Stanley interview questions

Interview reports that mention this question

  • SIG Quant Researcher New Grad Interviews: 49 Experiences

Susquehanna International Group (SIG) interview experiences

  • SIG Quant Researcher Experienced Hire Interviews: 11 Experiences
  • SIG Quant Research Intern Interviews: 60 Experiences
  • SIG Quant Researcher Intern Interviews: 1 Experience
  • SIG Quant Second-Round Tech Screen: 1 Experience
All Susquehanna International Group (SIG) interview questionsSee Susquehanna International Group (SIG) hiring insights
Saved
class Solution {
    public double moreHeadsProbability(int n, int m) {
        // Write your code here.
    }
}
Checking account…