All problems
CLT Z-Score of Sample Mean
Problem
Standardize the sample mean of n independent observations using the central limit theorem:
z = (x - mu) / (sigma / sqrt(n)).
Return 0.0 when sigma <= 0 or n <= 0.
Hint
The standard error of the mean is sigma divided by sqrt(n).
Test cases
case 1
in: [0,1,100,0.2]
expected: 2
case 2
in: [0,1,25,0.4]
expected: 2
case 3
in: [10,5,4,12]
expected: 0.8
case 4
in: [0,1,0,0]
expected: 0
Starter codePython
import math
def clt_zscore_sample_mean(mu, sigma, n, x):
# Your code here
pass4 test cases · run your code against them in the editor