4. Probability Distributions: Common Distributions
The Binomial Distribution
Binomial Setting
In a binomial setting:
- There are #n# independent observations
- Each observation only has #2# possible outcomes: 'success' or 'failure'.
- The probability of a success, denoted #p#, is the same for each observation.
#\phantom{0}#
Binomial Distribution
Let #X# denote the number of successes among #n# observations in a binomial setting.
Then #X# is a discrete random variable with #\{0, 1,2,\ldots,n\}# as possible outcomes.
We say #X# has the binomial distribution with parameters #n# and #p#, and we write #X \sim B(n,p)#.
Flip a coin #12# times and define a success as the coin coming up Heads.
Let #X# be the number of successes among the #12# observations.
Then #X# is binomially distributed with #n=12# and #p=\mathbb{P}(\textit{Heads}) = \frac{1}{2}#, denoted #X\sim B(12,0.5)#
Suppose #21\%# of people in a large population are smokers. Choose #100# people at random and ask them: "Are you a smoker"? Define a person answering "Yes" as a success.
Let #Y# be the number of successes among the #100# observations.
Then #Y# is binomially distributed with #n=100# and #p=0.21#, denoted #Y\sim B(100, 0.21)#
(This is approximately binomial because the total population is large relative to the sample size.)
#\phantom{0}#
Computation of Binomial Probabilities with Statistical Software
Let #X# be a binomial random variable with parameters #n# and #p#.
To compute #\mathbb{P}(X=x)# in Excel, make use of the following function:
BINOM.DIST(x, n, p, cumulative)
- x: The number of successes.
- n: The number of trials.
- p: The probability of success of each trial.
- cumulative: A logical value that determines the form of the function.
- TRUE - uses the cumulative distribution (at most x successes), #\mathbb{P}(X \leq x)#
- FALSE - uses the probability mass function (exactly x successes), #\mathbb{P}(X = x)#
To compute #\mathbb{P}(X=x)# in R, make use of the following function:
dbinom(x, size, prob)
- x: The number of successes.
- size: The number of trials.
- prob: The probability of success of each trial.
Compute #\mathbb{P}(X = 3)#. Round your answer to #3# decimal places.
There are a number of different ways we can calculate #\mathbb{P}(X = 3)#. Click on one of the panels to toggle a specific solution.
To calculate #\mathbb{P}(X = 3)# in Excel, make use of the following function:
Thus, to calculate #\mathbb{P}(X = 3)#, run the following command:BINOM.DIST(x, n, p, cumulative)
- x: The number of successes.
- n: The number of trials.
- p: The probability of success of each trial.
- cumulative: A logical value that determines the form of the function.
- TRUE - uses the cumulative distribution (at most x successes), #\mathbb{P}(X \leq x)#
- FALSE - uses the probability mass function (exactly x successes), #\mathbb{P}(X = x)#
\[= \text{BINOM.DIST}(3, 14, 0.4, \text{FALSE})\]
This gives:
\[\mathbb{P}(X = 3) = 0.085\]
To calculate #\mathbb{P}(X = 3)# in R, make use of the following function:
Thus, to calculate #\mathbb{P}(X = 3)#, run the following command:dbinom(x, size, prob)
- x: The number of successes.
- size: The number of trials.
- prob: The probability of success of each trial.
\[\text{dbinom}(x = 3, size = 14, prob = 0.4)\]
This gives:
\[\mathbb{P}(X = 3) = 0.085\]
#\phantom{0}#
Cumulative Distribution
For any random variable #X#, the cumulative distribution of #X# is #\mathbb{P}(X \leq x)# for any number #x#.
Since binomial variables are discrete, the following properties regarding cumulative probabilities hold:
- #\mathbb{P}(X \leq x) = \mathbb{P}(X=0) +\mathbb{P}(X=1) + \ldots + \mathbb{P}(X=x)#
- #\mathbb{P}(X \geq x) = 1 - \mathbb{P}(X \lt x) = 1 - \mathbb{P}(X \leq x-1)#
- #\mathbb{P}(X \lt x) = \mathbb{P}(X \leq x-1) = 1 - \mathbb{P}(X \geq x)#
- #\mathbb{P}(X \gt x) = \mathbb{P}(X \geq x+1) = 1 - \mathbb{P}(X \leq x)#
Additionally, for any #2# values #a# and #b# in the range of #X# (with #a<b#):
- #\mathbb{P}(a \lt X \leq b) = \mathbb{P}(X \leq b) - \mathbb{P}(X \leq a)#
Computation of Cumulative Binomial Probabilities with Statistical Software
Let #X# be a binomial random variable with parameters #n# and #p#.
To calculate cumulative probabilities for a binomial distribution in Excel, make use of the following function:
BINOM.DIST(x, n, p, cumulative)
- x: The number of successes.
- n: The number of trials.
- p: The probability of success of each trial.
- cumulative: A logical value that determines the form of the function.
- TRUE - uses the cumulative distribution (at most x successes), #\mathbb{P}(X \leq x)#
- FALSE - uses the probability mass function (exactly x successes), #\mathbb{P}(X = x)#
To calculate cumulative probabilities for a binomial distribution in R, make use of the following function:
pbinom(q, size, prob)
- q: The number of successes.
- size: The number of trials.
- prob: The probability of success of each trial.
There are a number of different ways we can calculate #\mathbb{P}(X \leq 8)#. Click on one of the panels to toggle a specific solution.
To calculate #\mathbb{P}(X \leq 8)# in Excel, make use of the following function:
BINOM.DIST(x, n, p, cumulative)
- x: The number of successes.
- n: The number of trials.
- p: The probability of success of each trial.
- cumulative: A logical value that determines the form of the function.
- TRUE - uses the cumulative distribution (at most x successes), #\mathbb{P}(X \leq x)#
- FALSE - uses the probability mass function (exactly x successes), #\mathbb{P}(X = x)#
Thus, to calculate #\mathbb{P}(X \leq 8)#, run the following command:
\[= \text{BINOM.DIST}(8, 11, 0.8, \text{TRUE})\]
This gives:
\[\mathbb{P}(X \leq 8) = 0.383\]
To calculate #\mathbb{P}(X \leq 8)# in R, make use of the following function:
Thus, to calculate #\mathbb{P}(X \leq 8)#, run the following command:pbinom(q, size, prob)
- q: The number of successes.
- size: The number of trials.
- prob: The probability of success of each trial.
\[\text{pbinom}(q = 8, size = 11, prob = 0.8)\]
This gives:
\[\mathbb{P}(X \leq 8) = 0.383\]