Skip to content
DeepForgeby svx
All problems
MediumStatisticsst-362

Two Sample Z with Known Sigma

Problem

For two independent samples with known standard deviations, z = (x1 - x2) / sqrt(s1^2 / n1 + s2^2 / n2).

Given the two means, standard deviations, and sample sizes, return z.

Hint

The denominator combines the two squared standard errors.

Test cases

case 1
in: [5,4,1,25,1,25]
expected: 3.5355339059327378
case 2
in: [0,1,2,10,3,10]
expected: -0.8770580193070292
case 3
in: [2,2,1,5,1,5]
expected: 0
Starter codePython
def two_sample_z_known_sigma(x1, x2, s1, n1, s2, n2):
    # Your code here
    pass

3 test cases · run your code against them in the editor