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
As discussed in Track 02, section 2.7 - Drawing route between two ports - the following map could be built for a certain route between two ports.
Consider a product whose path through a maritime route is given on the map. Now, suppose that each country port could be a potential risk point, and the probability of the cargo container suffering some adulteration is equal to the risk of the country. More factors could be considered. like depending on the cargo classification according to HS6 code, or port risk, but let's keep it simple. Then answer the following questions:
• What is the probability of the product being selected affected one time for adulteration in this path?
• And the probability of not being affected in any country port?
Each country could be considered a Bernoulli experiment since it could be successful (product not selected) or not (product selected). Supposing the checkpoints are independent, then the successive Bernoulli experiments with different probabilities pi are very small, you can use Poisson approximation. Let Xi∼Be(pi) be independent and let Y∼Po(λ) with λ=∑pi. A classic paper by Hodges and Le Cam it is shown that.
To answer the previous question, and use the Poisson distribution can be used as an approximation using λ=∑pi, the below interactive map had been employed to obtain the following risk of each country:
• China - 0.24, Malaysia - 0.66, Sri Lanka - 0.37, Yemen - 0.46, Egypt - 0.56, Spain - 0.26, and France - 0.52. The total sum of probabilities is λ=∑pi = 3.07.
The following code shows the probability of the numerical example employing PMF of Poisson distribution using poisson.pmf command.
from scipy.stats import poisson
import matplotlib.pyplot as plt
import numpy as np
mu = 3.07
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()
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 = 3.07
y = poisson.pmf(x, mu)
print(' X |',x)
print('P(X) |',y)
X | [0, 1, 2, 3, 4, 5, 6]
P(X) | [0.04642115 0.14251295 0.21875737 0.22386171 0.17181386 0.10549371 0.05397762]
plt.bar(x, y)
plt.show()
The previous complete code is available in the following link:
https://colab.research.google.com/drive/13BjmbQ4roGrfTK_nhze7CFIGwG9JW6ef?usp=sharing