Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Project: MAT 1630
Views: 230Kernel: Python 3 (Anaconda 2019)
Die Roll Probability
Suppose that people (with ) each roll a 20-sided die. The goal of this activity is to determine the probability that at least two people obtain the same die roll via simulations.
For a fixed , we will run the following procedure 10,000 times:
Select a random integer from 1 to 20, times.
Determine if at least one integer appears in the random sample more than once.
Return a 1 if the previous step is true and 0 otherwise.
We can then average our result to get an approximate value for the desired probability.
In [1]:
In [23]:
In [33]:
In [34]:
Out[34]:
The probability that at least two people out of 2 roll the same number on a 20-sided die is approximately: 0.0512
The probability that at least two people out of 3 roll the same number on a 20-sided die is approximately: 0.1465
The probability that at least two people out of 4 roll the same number on a 20-sided die is approximately: 0.2687
The probability that at least two people out of 5 roll the same number on a 20-sided die is approximately: 0.4192
The probability that at least two people out of 6 roll the same number on a 20-sided die is approximately: 0.5594
The probability that at least two people out of 7 roll the same number on a 20-sided die is approximately: 0.6943
The probability that at least two people out of 8 roll the same number on a 20-sided die is approximately: 0.804
The probability that at least two people out of 9 roll the same number on a 20-sided die is approximately: 0.8787
The probability that at least two people out of 10 roll the same number on a 20-sided die is approximately: 0.9367
The probability that at least two people out of 11 roll the same number on a 20-sided die is approximately: 0.9692
The probability that at least two people out of 12 roll the same number on a 20-sided die is approximately: 0.9848
The probability that at least two people out of 13 roll the same number on a 20-sided die is approximately: 0.9946
The probability that at least two people out of 14 roll the same number on a 20-sided die is approximately: 0.9984
The probability that at least two people out of 15 roll the same number on a 20-sided die is approximately: 0.9989