Tail of a Sum of Correlated Normals
Updated
Problem statement
Three random variables X, Y and Z are jointly normal. Each has mean 0 and variance 1, and every pair has the same correlation rho = corrPercent / 100.
Return the probability that X + Y > Z + c.
Every corrPercent in the allowed range gives a valid set of three variables. Your answer is accepted if its absolute error or its relative error is at most 10^-9.
Function
tailProbability(corrPercent: int, c: int) → doubleExamples
Example 1
corrPercent = 50c = 2return = 0.07864960352514257This is the interview case: every correlation is 0.5, and we want P(X + Y > Z + 2), which is P(X + Y - Z > 2).
X + Y - Z is normal with mean 0 and variance 1 + 1 + 1 + 2(0.5) - 2(0.5) - 2(0.5) = 2. So the answer is the chance that a standard normal is above 2 / sqrt(2) = sqrt(2), about 1.414. That is about 0.07865.
Example 2
corrPercent = 0c = 3return = 0.0416322583317752With correlation 0 the three variables are independent, and X + Y - Z has variance 3. The answer is the chance that a standard normal is above 3 / sqrt(3) = sqrt(3), about 0.04163.
Example 3
corrPercent = 100c = -1return = 0.8413447460685429With correlation 1, the three variables are the same variable, so X + Y - Z = X, with variance 1. The answer is P(X > -1), about 0.84134.
Constraints
-50 <= corrPercent <= 100-20 <= c <= 20
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
- Integers With Multiple Sum of Two CubesCharta Health · PHONE SCREEN · ONSITE INTERVIEWCharta Health interview questions
- Dice-Walk Winning ProbabilityGoogle · PHONE SCREEN · ONSITE INTERVIEWGoogle interview questions
- Logistic Regression with Gradient DescentYahoo · PHONE SCREENYahoo interview questions
- Evaluate an Arithmetic Expression Written in WordsBrex · PHONE SCREEN
- Constant-Time Weighted Pick with an Alias TableEtched · PHONE SCREEN
- Integer to English Words in USD and INR StylesVeeam · PHONE SCREEN
- Adaptive Calibration ErrorOpenAI · PHONE SCREENOpenAI interview questions
- Sum of Smallest Non-DivisorsThe D.E. Shaw Group · PHONE SCREENThe D.E. Shaw Group interview questions
- Square Root FunctionCitadel · PHONE SCREENCitadel interview questions
- Reorderable Task Scheduler With CooldownWaymo · PHONE SCREENWaymo interview questions