LoslegenKostenlos loslegen

Calculating the sample mean

Simulation involves generating samples and then measuring. In this exercise, we'll generate some samples and calculate the sample mean with the describe() method. See what you observe about the sample mean as the number of samples increases.

We've preloaded the binom object and the describe() method from scipy.stats for you, so you can calculate some values.

Diese Übung ist Teil des Kurses

Foundations of Probability in Python

Kurs anzeigen

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# Sample mean from a generated sample of 100 fair coin flips
sample_of_100_flips = binom.____(n=____, p=____, size=100)
sample_mean_100_flips = ____(sample_of_100_flips).____
print(sample_mean_100_flips)
Code bearbeiten und ausführen