Зміст курсу
Probability Theory Basics
Probability Theory Basics
Geometric Distribution
The geometric distribution is a probability distribution that models the number of experiments on which we first get a successful outcome in a sequence of independent Bernoulli trials.
Note
Admit that geometrical distribution and geometric probability are two different concepts.
The first one is the distribution that describes the order number of the first successful experiment in the Bernoulli process. The second one is the extension of the classical rule for determining probabilities to the case of an uncountable number of possible outcomes of an experiment.
Each trial has two possible outcomes in the geometric distribution: success (with probability p
) or failure (with probability q
= 1 - p
). The distribution is characterized by a single parameter, p, representing the probability of success in each trial.
Suppose you hit the target with a probability of 0.4
. Calculate the probability that your fourth shot will be the first successful.
from scipy.stats import geom # Probability of success (correct answer) proba = 0.4 # Calculate probability that 4'th shot will be the first successful pmf = geom.pmf(4, p=proba) # Print the results print(f'Corresponding probability equals {pmf:.4f}')
In the code above, we used .pmf()
method with parameter p
(probability of success) to calculate the corresponding probability in point 4
.
Дякуємо за ваш відгук!