From fe4e7e55f29f91ac47070096535ae8bd309380e8 Mon Sep 17 00:00:00 2001 From: ShadekJaramillo Date: Mon, 16 Jun 2025 13:02:17 -0500 Subject: [PATCH] correction in the binomial distribution explanation code in random-variables.ipynb change in the code for the explanation of the binomial distribution. from scipy.stats import binom n_experiments = 100 probability = 0.5 data = range(n_experiments+1) <-- a +1 was added pmf = binom.pmf(data, n_experiments, probability) This change because data was only going up to 99 but it is possible to get 100 successes. --- 02-stats/random-variables.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/02-stats/random-variables.ipynb b/02-stats/random-variables.ipynb index 3e3a154..c5cae05 100644 --- a/02-stats/random-variables.ipynb +++ b/02-stats/random-variables.ipynb @@ -232,7 +232,7 @@ "n_experiments = 100\n", "probability = 0.5\n", "\n", - "data = range(n_experiments)\n", + "data = range(n_experiments+1)\n", "pmf = binom.pmf(data, n_experiments, probability)\n", "\n", "plt.figure(figsize = (10, 5))\n",