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
It is denoted as X ∼ Po(λ ). And is read as X is a discrete random variable that follows a Poisson distribution with parameter λ, where λ is the expected rate of occurrences. Poisson Distribution is a discrete probability distribution function that expresses the probability of a given number of events occurring in a fixed time interval. Examples are the number of diners at a restaurant on a given day, and calls per hour at a call center.
The Poisson distribution PMF formula follows:
A company offers a free trial of its products for 7 days. It was observed that on average 2 out of 10 products sold are returned. Using Poisson, find the probabilities of the following event: exactly 6 products out of 40 sold are being returned.
Using the previous equation to compute the probabilities, and considering that if 2 out of 10 are returned, then λ in 40 are returned. Therefore, λ = 8 returned products and:
• Find exactly six products that should return:
p(x = 6) = 0.1221.
The following code shows how to compute binomial probabilities employing PMF of Poisson distribution using poisson.pmf command.
from scipy.stats import poisson
import matplotlib.pyplot as plt
import numpy as np
mu = 0.6
x = np.arange(0, 20, 1)
y = poisson.pmf(x, mu)
plt.plot(x,y,'r-',x, y,'bo')
plt.show()
plt.bar(x, y)
plt.show()
The following code shows the probability of the numerical example employing PMF of Poisson distribution using poisson.pmf command.
from scipy.stats import binom
import matplotlib.pyplot as plt
import numpy as np
# computing P(X) for each X.
x = [0, 1, 2, 3, 4, 5, 6]
mu = 8
y = poisson.pmf(x, mu)
print(' X |',x)
print('P(X) |',y)
X | [0, 1, 2, 3, 4, 5, 6]
P(X) | [0.00033546 0.0026837 0.0107348 0.02862614 0.05725229 0.09160366 0.12213822]
plt.bar(x, y)
plt.show()
The previous complete code is available in the following link:
https://colab.research.google.com/drive/1R2u0FmiuC0fHSqO4F_tmRI9yP4WuqeAS?usp=sharing