All problems
CLT Mean of Uniform Sample (Seeded)
Problem
Central limit theorem demonstration with seeded uniform samples.
Draw trials independent samples of size n from Uniform(0, 1) using random.Random(seed), compute each sample mean, and return [mean of the sample means, standard deviation of the sample means]. Return [0.0, 0.0] if n <= 0 or trials <= 0.
Hint
Use the population standard deviation of the sample means (divide by trials).
Test cases
case 1
in: [30,1000,42]
expected: [0.49980475767324967,0.05228350690430031]
case 2
in: [10,500,1]
expected: [0.5008574597577204,0.09741832975350079]
case 3
in: [5,2000,123]
expected: [0.5017896092714739,0.12919952725281916]
Starter codePython
import math
import random
def clt_uniform_sample_mean(n, trials, seed):
# Your code here
pass3 test cases · run your code against them in the editor