LoslegenKostenlos loslegen

Was 2015 anomalous?

1990 and 2015 featured the most no-hitters of any season of baseball (there were seven). Given that there are on average 251/115 no-hitters per season, what is the probability of having seven or more in a season?

Diese Übung ist Teil des Kurses

Statistical Thinking in Python (Part 1)

Kurs anzeigen

Anleitung zur Übung

  • Draw 10000 samples from a Poisson distribution with a mean of 251/115 and assign to n_nohitters.
  • Determine how many of your samples had a result greater than or equal to 7 and assign to n_large.
  • Compute the probability, p_large, of having 7 or more no-hitters by dividing n_large by the total number of samples (10000).
  • Hit submit to print the probability that you calculated.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Draw 10,000 samples out of Poisson distribution: n_nohitters


# Compute number of samples that are seven or greater: n_large
n_large = np.sum(____)

# Compute probability of getting seven or more: p_large


# Print the result
print('Probability of seven or more no-hitters:', p_large)
Code bearbeiten und ausführen