Aan de slagGa gratis aan de slag

Sample means

An important result in probability and statistics is that the shape of the distribution of the means of random variables tends to a normal distribution, which happens when you add random variables with any distribution with the same expected value and variance.

For your convenience, we've loaded binom and describe() from the scipy.stats library and imported matplotlib.pyplot as plt and numpy as np. We generated a simulated population with size 1,000 that follows a binomial distribution for 10 fair coin flips and is available in the population variable.

Deze oefening maakt deel uit van de cursus

Foundations of Probability in Python

Cursus bekijken

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Create list for sample means
sample_means = []
for _ in range(1500):
	# Take 20 values from the population
    sample = ____(population, ____)
Code bewerken en uitvoeren