Skip to content
DeepForgeby svx
All problems
MediumStatisticsst-082

Confidence Interval for Mean (Unknown Sigma)

Problem

Return the t confidence interval [mean - t*s/sqrt(n), mean + t*s/sqrt(n)] for the mean with unknown sigma, where s is the sample standard deviation. Return [0.0, 0.0] when n < 2.

Hint

Use the sample standard deviation and the supplied critical value.

Test cases

case 1
in: [[1,2,3,4,5],2.776]
expected: [1.0370715754261441,4.962928424573856]
case 2
in: [[2,4,4,4,5,5,7,9],2.365]
expected: [3.2122280426663554,6.787771957333645]
case 3
in: [[5],2]
expected: [0,0]
case 4
in: [[],2]
expected: [0,0]
case 5
in: [[1,3],12.706]
expected: [-10.706,14.706]
Starter codePython
def ci_mean_unknown_sigma(data, t_crit):
    # Your code here
    pass

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