1. Concepts & Definitions
1.1. Example of random variables
1.2. Probability of events to random variables
1.4. Discrete uniform distribution of probability
1.5. Bernoulli distribution of probability
1.6. Binomial distribution of probability
1.7. Hypergeometrical distribution of probability
2. Problem & Solution
There is a wide array of discrete random distributions of probability. Let's start with the most simple of them.
Discrete Uniform distribution (∪): It is denoted as X ∼ ∪(a, b). And is read as X is a discrete random variable that follows uniform distribution ranging from a to b. Uniform distribution is when all the possible events are equally likely. For example, consider an experiment of rolling a dice. There are six possible events X = {1, 2, 3, 4, 5, 6} each having a probability of P(X) = 1/n = 1/6.
Some examples of situations where discrete uniform distribution are:
• Guessing a Birthday: If you randomly approach a person and try to guess his/her birthday, the probability of his/her birthday falling exactly on the date you have guessed follows a uniform distribution.
• Tossing a Coin: When you flip a coin, the probability of the coin landing with a head faced up is equal to the probability that it lands with a tail faced up. The next Figure had been generated employing the coin simulator developed on Track 04, section 2.1.
• Rolling a six-face dice: When a fair die is rolled, the probability that the number appearing on the top of the die lies between one to six follows a uniform distribution. The next Figure had been generated employing the six-face dice simulator developed on Track 04, section 2.2.
The next computational code shows how to define and employ a PMF for discrete uniform probability distribution to simulate a six-dice experiment.
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import randint
a=1
b=6
x = np.arange(a, b+1)
discrete_uniform_pmf = randint.pmf(x, a, b+1)
print(x)
print(discrete_uniform_pmf)
[1 2 3 4 5 6]
[0.16666667 0.16666667 0.16666667 0.16666667 0.16666667 0.16666667]
The previous complete code is available in the following link:
https://colab.research.google.com/drive/18uPhlL7SEMk86-vpJc2Uvw_Ng9RUQ1xs?usp=sharing