Merge pull request #104 from bizzguy/patch-1

Update Probability.ipynb
This commit is contained in:
Peter Norvig 2021-06-05 22:47:35 -07:00 committed by GitHub
commit dc1c23b2e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2339,7 +2339,7 @@
"def repeated_hist(dist, n=10**6, bins=100):\n", "def repeated_hist(dist, n=10**6, bins=100):\n",
" \"Sample the distribution n times and make a histogram of the results.\"\n", " \"Sample the distribution n times and make a histogram of the results.\"\n",
" samples = [dist() for _ in range(n)]\n", " samples = [dist() for _ in range(n)]\n",
" plt.hist(samples, bins=bins, normed=True)\n", " plt.hist(samples, bins=bins, density=True)\n",
" plt.title('{} (μ = {:.1f})'.format(dist.__name__, mean(samples)))\n", " plt.title('{} (μ = {:.1f})'.format(dist.__name__, mean(samples)))\n",
" plt.grid(axis='x')\n", " plt.grid(axis='x')\n",
" plt.yticks([], '')\n", " plt.yticks([], '')\n",