Ten days of statistics (5) - Binomial distribution
Binomial experiment
A binomial experiment is an experiment that is:
- The experiment consists of repeated trials
- The trials are independent
- The outcome of each trial is either success or failure
The sample space of a binomial experiment only has 2 points, 1 (success) and 0 (failure). Let be the probability of an experiment ending with result
Binomial distribution
We define a binomial process to be a binomial experiment meeting the following conditions:
- The number of successes is .
- The total number of trials is .
- The probability of success of trial is .
Let is the probability of having exact successes out of trials. Then we have
Note:
Example
Toss a coin 10 times. Let’s find the following probabilities:
- Getting 5 heads
- Getting at least 5 heads
- Getting at most 5 heads
Using binomial distribution formular, we have
We have chance of getting exact 5 heads.
We have chance of getting at least 5 heads
We also have chance of getting at most 5 heads
Negative binomial experiment
A negative binomial experiment is an experiment that is:
- The probability of success of trial is
- The trials continue until successes are observed
- The total number of trials is not fixed
Note: the different between negative binomial experiment and binomial experiment is on the interest. Negative version only interest in getting exact successes, normal version interest in performing exact trials.
Negative binomial distribution
Formally speaking, let be the probability of having
- Exact successes after trials
- Exact successes after trials
Geometric distribution
The geometric distribution is a special case of the negative binomial distribution that deals with the number of trials required to get a success (i.e. counting the number of failures before the first success).
Example
Vova’s family lives in Russia where the weather is cold. The chance for Vova’s wife to give birth to a boy is 30%. What is the probability that Vova have his first son at his fifth child?
For this experiment, , we have . So Vova has of having his first son at his fifth child.
Practice
Hackerrank has some exercises for you to test your knowledge:
- https://www.hackerrank.com/challenges/s10-binomial-distribution-1/problem
- https://www.hackerrank.com/challenges/s10-binomial-distribution-2/problem
- https://www.hackerrank.com/challenges/s10-geometric-distribution-1/problem
- https://www.hackerrank.com/challenges/s10-geometric-distribution-2/problem
Next lesson: Poisson & normal distribution