Test the Hypothesis
Updated
Problem statement
Given two arrays and a confidence level, determine whether the means of these series are significantly different using a two-tailed t-test. Additionally, output the magnitude by which the hypothesis passes or fails.
The magnitude is defined as the minimum absolute difference between the computed t-statistic and the t-statistic at the confidence level at the two tails.
Return an array with two values. The first element is "Yes" if the means are significantly different, or "No" if they are not. The second element is the magnitude rounded to 2 decimals.
Return both values as strings, with the magnitude formatted to exactly two decimal places.
Function signature
Complete the function testHypothesis with the following parameters:
| Parameter | Type | Description |
|---|---|---|
n | int | the number of data points |
x[n] | float | an array of data points |
y[n] | float | another array of data points |
confidence_level | float | the confidence level to test the hypothesis |
Function
testHypothesis(n: int, x: float[], y: float[], confidence_level: float) → String[]Examples
Example 1
n = 4x = [4.461, 7.757, 17.317, 4.151]y = [8.911, 12.68, -10.593, 17.048]confidence_level = 0.95return = ["No", "2.47"]Performing a t-test at the 95% confidence level shows that the means are not significantly different, and the magnitude by which the null hypothesis passes is 2.47.
Example 2
n = 10x = [0.878, 2.817, 0.121, -0.945, -0.055, -1.456, 0.35, -1.478, -1.687, -1.889]y = [1.142, -0.492, -0.988, -0.729, -0.846, -0.157, 0.5, 1.188, -1.075, -0.189]confidence_level = 0.95return = ["No", "1.82"]Performing a t-test at the 95% confidence level shows that the means are not significantly different, and the magnitude by which the null hypothesis passes is 1.82.
More Point72 interview questions
- Maximize Array Beauty After DeletionsOA · Seen Aug 2026
- Simulate a Deterministic Finite AutomatonOA · Seen Aug 2026
- Initial Public OfferingOA · Seen Jul 2026
- Get Triplet CountOA · Seen Jul 2026
- Internet Service Provider Monthly ReportOA · Seen Jul 2026
- Server SelectionOA · Seen Jul 2026
- Lexicographically Smallest String After Substring OperationOA · Seen May 2026
- Best Time to Buy and Sell Stock IIPHONE SCREEN · Seen Aug 2026
- Find Minimum in a Rotated Sorted ArrayPHONE SCREEN · Seen Aug 2026
- Generate an Optimal Portfolio Trading ReportPHONE SCREEN · Seen Apr 2026
Similar questions at other companies
- Last Object Exit TimeIBM · OAIBM interview questions
- Capping Portfolio WeightsCapstone Investment Advisors · OA
- Bold Play to Reach a GoalSusquehanna International Group (SIG) · OASusquehanna International Group (SIG) interview questions
- Repeated Mirror XORMathWorks · OAMathWorks interview questions
- Stacked Item and Category DiscountsPalantir · OAPalantir interview questions
- Find Total CostJP Morgan Chase · OAJP Morgan Chase interview questions
- Macaron Order PriceOpenAI · OAOpenAI interview questions
- Daily Settlement for Long and Short PositionsBelvedere Trading · OA
- Debug the Risk-Limit QuoterMillennium · OAMillennium interview questions
- Prime Factor VisitationMaven Securities · OAMaven Securities interview questions