# Binomial, Bernoulli, geometric and Poisson random variables

#### Binomial random variable

Binomial random variable is a specific type of discrete random variable. It counts how often a particular event occurs in a fixed number of trials.

For variable to be binomial it has to satisfy following conditions:

• We have a fixed number of trials
• On each trial, the event of interest either occurs or does not occur.
• The probability of occurrence (or not) is constant on each trial.
• Trials are independent of one another.

Let’s say we flip a coin and random variable $X$ is the number of heads after $15$ flips.  It doesn’t have to be fair, meaning the probability of getting heads or tails doesn’t have to be equal to $\frac{1}{2}$. Lets say the probability of getting heads is $0.3$. Consequently, the probability of tails is going to $0.7$. In this particular case, we’re going to refer to flips as trials. The number of trials is set to $15$. They are independent since the outcome of one trial doesn’t affect the outcome of others.

Due to the fact that each trial has one of two discrete outcomes, we can classify them as either success or failure. So in terms of this example, we can define heads as success and tails as failure. No matter how many times we repeat the trial the probability of getting heads/tails stays the same.

Examples of binomial random variables:

• Number of correct guesses at 20 true-false questions when you randomly guess all answers
• Number of winning lottery tickets when you buy 10 tickets of the same kind

Notation

Since number of trials and the their probability are of importance, we use special notation for them.

$n=$ number of trials
$p=$ probability that event of interest will happen on any trial

#### Probability of binomial random variable

Lets pick another example. We have a free throw. Lets say the probability of scoring a free throw is equal to $60\%$. Consequently, the probability of missing it is equal to $40\%$. We are curious about the probability of exactly $3$ scores in $7$ attempts.

Notice how we’re asking about exactly $3$ scores, not about third throw. Our throws can look like this :

(1.) M, S, S, M, S, M, M
And their probability would be $(0.6)^{3}\cdot (0.4)^{4}$Or it can look like this

(2.) S, S, M, S, M, M, M
The probability would be the same as before

As we can see, there is a variety of combinations, therefore we used combinatorics. We need to calculate all the different ways we can make $3$ scores in $7$ attempts. Since we need to find $3$ out of $7$, we use binomial coefficient

$$\displaystyle{{7}\choose{3}}$$

In conclusion, the probability of scoring exactly $3$ scores out of $7$ attempts is

$$\displaystyle{{7}\choose{3}} \cdot (0.6)^{3}\cdot (0.4)^{4}$$

because we said that each combination has the probability of $(0.6)^{3}\cdot (0.4)^{4}$.

General probability of binomial random variable

In previous example we had $7$ attempts and $3$ scores. Lets use general notation we previously mentioned. Let $n$ be the number of trials and $k$ number of wanted outcomes (in this case scores). The probability of scoring a free throw was $0.6$, we will note it with $p$. The probability of missing a free throw is consequently $q=1-p$.

The general formula for calculating the probability of binomial random variable looks like this

$$P(X=k)= \displaystyle{ {n}\choose{k}} \cdot p^{k}\cdot q^{n-k}$$

Binomial random variable is also noted as $X \sim B(n,p)$ or

#### Bernoulli random variable

Bernoulli random variable is a function $X : \Omega \rightarrow \{0, 1\}$. It is also a binomial random variable for $n=1$. Meaning it’s a probability of getting success in only one trial, opposed to $n$ trials in binomial random variable.

Lets say $p$ is the probability of success, $p=P(X=1)$. Consequently, the probability of failure is $q=1-p=P(X=0)$. If we put that into distribution of binomial random variable, we get:

Bernoulli random variable is noted as $X \sim B(1,p)$

Proposition.

Let $X_{1}, X_{2}, …, X_{n}$ be Bernoulli random variables with parameter $p$. Then $X_{1} + X_{2}+…+ X_{n} \sim B(n,p)$

#### Geometric random variable

Let $T$ be the number of independent trials until the first success. Let $p \in (0,1)$ be the probability of success in each trial. For $k \in \mathbb{N}$ independent trials, failure will occur for the first $k-1$ trials. The $k$th trial will be a success. Similarly to example above, the probability of failure is equal to $(1-p)$. As a result, the probability  of $k$th trial being a success is $$P(T=k)=(1-p)^{k-1} \cdot p$$

Random variable $T$ is called geometric random variable with parameter $p$ and is noted as $T \sim G(p)$. We can also define it as the probability distribution of the number $X$ of Bernoulli trials needed to get success.

In the example above we assumed success will certainly happen. However, is the situation where success never happens possible? Lets see the probability of $T= \infty$. $$P(T=\infty) = 1-P(T < \infty)= 1 – \sum_{k=1}^{\infty} P(T=k)=1-1=0$$

The probability of $T= \infty$ is equal to $0$ which means success will certainly happen at one point.

In contrast to the model above, we can also use geometric distribution for modeling the number of failures until the first success. Let $Y$ be the number of failures until the first success. Its probability is $$P(Y=k)=(1-p)^{k} \cdot p, \forall k \in \mathbb{No}$$

Example.

A restaurant chooses orders at random to receive a free drink. Each order has a $1$ in $18$ chance of receiving one free drink.  Let $X$ be the number of orders the restaurant fills in a day until they give away the first drink. Assume that each order getting the drink is independent. Find the probability that the restaurant first gives away a drink on the $6$th order of the day.

Since we want the $6$th order to get a free drink, it means we’ll get a success on $6$th trial.  Hence, $k=6$. We want to find its probability, $P(X=6)$. The probability of success (getting a drink) is $\displaystyle{p=\frac{1}{18}}$. Consequently,

$\displaystyle{P(X=6)=(1-\frac{1}{18})^{6-1} \cdot \frac{1}{18}=(\frac{17}{18})^{5}\cdot \frac{1}{18}=0.0417 }$

#### Poisson random variable

Suppose $X$ is a number of trials occurring and $\lambda >0$ average number of occurrences over a period of time. Then the Poisson random variable, denoted $X \sim P(\lambda)$, counts the total number of occurrences during a given time period.

The probability of exactly $k$ occurrences during this time is $$\displaystyle{P(X=k)=e^{-\lambda} \cdot \frac{\lambda^{k}}{k!}, \forall k \in \mathbb{No}}$$

Example. Telephone calls arrive at the switchboard at the a rate of 30 per hour. Calculate the following:

(a) The probability of exactly $4$ phone calls arriving in a $10$ minute period

(b) The probability of $2$ or more calls arriving in any $4$ minute period

(a) The rate of $30$ calls per hour is equal to $30$ calls per $60$ minutes. However, we need the average rate in $10$ minutes. Be careful,  average and total number of occurrences are calculated over the same time period. $30$ per hour is equivalent to $5$ every $10$ minutes. Consequently, $\lambda=5$.
We need the probability of $k=4$. Lets use Poisson distribution

$\displaystyle{P(X=k)=e^{-\lambda} \cdot \frac{\lambda^{k}}{k!}}$

$\displaystyle{P(X=4)=e^{-5} \cdot \frac{5^{4}}{4!}=0.1755}$

The probability of $4$ calls arriving over a $10$ minute period is $17.55\%$.

(b) In this case $\lambda=2$. We need to calculate the probability of $2$ or more phone calls happening which is equal to: $$P(X \geq 2)=P(X=2)+P(X=3)+P(X=4)+….$$

However, we don’t know the total number of phone calls in that interval. Because of that, we’ll use the complement rule. $$P(X \geq 2)=1-P(X<2)=1-P(X=0)-P(X=1)$$ Lets calculate the $P(X=0$ and $P(X=1)$.

$\displaystyle{P(X=0)=e^{-2} \cdot \frac{2^{0}}{0!}=0.1353}$

$\displaystyle{P(X=1)=e^{-2} \cdot \frac{2^{1}}{1!}=0.2707}$

Finally, $$P(X \geq 2)=1-P(X=0)-P(X=1)=1-0.1353-0.2707=0.594$$

In conclusion, the probability of $2$ or more calls arriving over a $4$ minute period is $59.4\%$.