P8130: Biostatistical Methods I
Discrete Probability Distributions
Instructor: Vahe Khachadourian, MD, MPH, PhD
Outline
• Randomness and random variables
• Binomial distribution
• Definition
• Statistical properties
• Poisson distribution
• Definition
• Statistical properties
Discrete Probability Distributions
In this module we will discuss the concept of random variables and their
probability distributions.
• Define the concepts of randomness and random variables
• Distinguish between a discrete and a continuous random variable
• Define and discuss the statistical properties of two discrete
probability distributions:
Binomial distribution and Poisson distribution
Randomness and Random Variables
Variable: a characteristic of each element of a population or sample; a
characteristics, number, or quantity that can be measured or counted.
Idea of randomness: adding a probability to the values that the random
variable can assume.
Random variable (r. v.): A numerical quantity that takes different values
with specified probabilities; the numerical outcome of an experiment
or random phenomenon.
Random Variable Example
Remember the experiment when two dice are rolled,
and the sum recorded.
Let X = “Sum of the two dice” be the random variable
with the sample space given by:
S = {2, 3, …, 12}
We can associate probabilities to each value of the
random variable:
Probability of getting a 2: P(X=2) = 1/36
Probability of getting a 3 is: P(X=3) = 2/36
Discrete vs Continuous Random Variables
Discrete Random Variable: A numerical r. v. for which there exists a
discrete set of values with specified probabilities; there are gaps in the
range of possible values
E.g. : number of complains received daily by a cable company
Continuous Random Variable: A numerical r. v. whose values form a
continuum (there are no gaps between the values)
E.g. : running times recorded during the NYC marathon
Probability Distribution
The probability distribution of a random variable is represented by a
table, graph, or formula which denotes what possible values a r. v. can
take and the associated probabilities.
Notation: 𝑃 𝑋 = 𝑥 = 𝑃 𝑥
For any probability distribution the following hold true:
1. 𝑃 𝑥 ≥ 0, for any value of 𝑥
2. ∑ 𝑃 𝑥 = 1 ; the sum of probabilities for all x values is 1.
Probability Distribution
Example: An investigator is testing a new medication for lowering the (LDL) cholesterol
levels. He expects the following probabilities for the next three patients:
# Patients that Probability of Probability Distribution
1.0
respond to response
medication (X) P(X=r)
0 0.01
0.8
1 0.08
0.6
2 0.27
Probability
3 0.64
0.4
X is a discrete random variable that takes values 0, 1, 2, or 3.
The probability distribution in this case is called probability
0.2
mass function (pmf).
0.0
0 1 2 3
Number of patients with low LDL
Cumulative Distribution Function
The cumulative distribution of a discrete r. v. is denoted by:
𝐹 𝑥 = 𝑃(𝑋 ≤ 𝑥)
In the previous example, let’s calculate the probability that two or less (at most two)
patients will respond to medication:
𝐹 2 =𝑃 𝑋 ≤2 = 𝑃 𝑋 =0 +𝑃 𝑋 =1 +𝑃 𝑋 =2
= 0.01 + 0.08 + 0.27
= 0.36.
Expected Value of a Discrete Random Variable
In general, the expected value of a r. v. is its mean or the ‘long-run’ average
value of multiple trials (repetitions).
The expected value of a discrete r. v. is the probability - weighted average of
all possible values defined as:
𝜇 = . 𝑥𝑃(𝑥)
Calculate the expected value of X for the cholesterol example:
𝜇 = 𝐸 𝑋 = 0 2 0.01 + 1 2 0.08 + 2 2 0.27 + 3 2 0.64 = 2.54
Thus, the average number of patients to respond to cholesterol medication
is 2.5.
Variance of a Discrete Random Variable
The variance of a discrete random variable is the expected value of the squared
deviations from the mean and is defined as:
Recall that in general: 𝜎 ! = 𝐸[(𝑋 − 𝜇)! ]
For discrete r. v.:
𝜎 ! = * 𝑥 − 𝜇 ! 𝑃 𝑥 = * 𝑥 ! 𝑃(𝑥) − 𝜇!
Calculate the variance of X for the cholesterol example:
𝜎 ! = 𝑣𝑎𝑟 𝑋 = 0! 6 0.01 + 1! 6 0.08 + 2! 6 0.27 + 3! 6 0.64 − 2.54! = 0.47
Thus, the variance of the number of patients to respond to cholesterol medication is
0.47.
Binomial Random Variable
Many experiments have only two options as possible outcomes: e.g., pass/fail, yes/no, etc.
These experiments are called binomial experiments, they generate a discrete r. v. called
binomial random variable that follows a binomial distribution.
Characteristics of binomial distribution:
1. Fixed number of n trials;
2. Trials are independent;
3. Only two possible exclusive outcomes;
4. The probability of success (p) is fixed and the same for each trial;
The probability of failure is denoted by 1-p.
The random variable of interest is the number of successes in n trials.
Binomial Distribution
The probability distribution function of a binomial random variable X with n trials and
probability of success p on any trial, 𝑋~𝐵𝑖𝑛 𝑛, 𝑝 , is denoted by:
𝑛 ! "!
𝑃 𝑋=𝑥 =𝑓 𝑥 = 𝑝 (1 − 𝑝)"#! = 𝑝 ! (1 − 𝑝)"#! , 𝑥 = 0, 1, 2, … , 𝑛
𝑥 !! "#! !
where 𝑛! = 1 4 2 4 3 4 … 4 𝑛 is called ‘n factorial’
"!
is called the binomial coefficient; it denotes the total number of possible combinations,
!! "#! !
i.e., choosing x objects of n, without order being important.
Why can we multiple the probabilities of success and failure in n successive trials?
Binomial Distribution: Example
Recently, a pediatrician observed that children tend to develop asthma in the first 2 yrs
of life in 5 out of 20 households situated within city limits. The national probability of
developing asthma for infants this age is 0.06.
Help the doctor answer the following questions:
Q1. What is the probability that exactly 5 infants in this sample develop asthma?
Q2. How often do we expect infants in at least 10 households out of 20 to have asthma?
Binomial Distribution: Example
Recently, a pediatrician observed that children tend to develop asthma in the first 2 yrs
of life in 5 out of 20 households situated in the city limits.
Binomial distribution with:
X – random variable denoting the number of asthma cases in 20 households (trials)
𝑋~𝐵𝑖𝑛(20, 0.06)
𝑛 = 20, number of households
𝑝 = 0.06, probability of success (developing asthma), 1 − 𝑝 = 0.94
Binomial Distribution: Example
!"!
Q1: 𝑃 𝑋 = 5 = $!%$!
0.06 $(1 − 0.06)!"&$
%'(%)(%*(%+(!"
= %(!(,(-($
0.06 $(1 − 0.06)!"&$= 0.005
!"!
Q2: P 𝑋 ≥ 10 = ∑!"
./%" 0.06 . (1 − 0.06)!"&. = 1 − 𝑃 𝑋 < 10
.!(!"&.)!
!"!
=1 - ∑+./" 0.06 . (1 − 0.06)!"&. = 6.38 6 10&* ≈ 0
.!(!"&.)!
These calculations were done in R software (see corresponding code), but you can also
use binomial tables (see textbook: Rosner, page 867)
Binomial Distribution: Rosner Table
𝑃 𝑋=5
Limited prob values
Binomial Distribution
The expected value of a binomial distribution is given by:
𝜇 = 𝐸 𝑋 = 𝑛𝑝
The variance of a binomial distribution is given by:
𝜎 ! = 𝑣𝑎𝑟 𝑋 = 𝑛𝑝(1 − 𝑝)
Back to our asthma example:
𝐸 𝑋 = 20 6 0.06 = 1.20; on average you would expect about 1 infant to develop
asthma in this sample of 20 households;
var 𝑋 = 20 6 0.06 6 0.94 = 1.12; std 𝑋 = 1.06; ± 1 infant;
Poisson Distribution
A Poisson random variable characterizes the number of occurrences of an event in a
continuous interval of time or space
• E.g., number of accidents per day at an intersection
Characteristics of Poisson distribution:
1. Events occur one at a time; two or more events cannot occur exactly at the same
time and location;
2. The occurrence of an event in a given period is independent of the occurrence of an
event in a non-overlapping period;
3. The expected number of events during any period is constant.
Poisson Distribution
The probability distribution of a Poisson random variable 𝑋~𝑃𝑜𝑖(𝜆) is denoted by:
6! 7 "#
𝑃 𝑋=𝑥 =𝑓 𝑥 = .!
,𝑥 = 0, 1, 2, … , 𝑛
Where 𝜆 represents the expected number of events for a specific period of time (rate)
e is called Euler’s number and it’s approximately 2.71828
Notes:
1. This distribution depends only on one parameter 𝜆>0
2. There is an infinite number of possible events, but the probabilities will get small as
x increases.
Poisson Distribution: Example
A cable company averages about 10 calls/complains per hour. Assume that the number
of calls follows a Poisson distribution, what is the probability of receiving exactly 4 calls
in the next hour?
X – random variable denoting the number of calls per hour, 𝑋~𝑃𝑜𝑖(10)
λ = 10, rate of hourly calls
%"$ 7 "%&
Calculate: 𝑃 𝑋 = 4 = -!
= 0.019
* %"! 7 "%& %"& 7 "%& %"% 7 "%& %"' 7 "%&
Calculate: 𝑃 𝑋 ≤ 8 = ∑./" = + %! +… + *! = 0.332
.! "!
Approximately 33% probability that the company would receive 8 or less calls in the
next hour.
Poisson Distribution: Example
Consider that the number of deaths due to typhoid fever over a period of time follows a
Poisson distribution. Assume that the expected number of events in one year is 4.6.
Calculate the probability of having zero deaths in the next 6 months.
X – random variable denoting the number of deaths in one year: 𝑋~𝑃𝑜𝑖(4.6)
Calculate: 𝑃 𝑋 = 0
Poisson Distribution
For a Poisson distribution, the expected value equals the variance:
µ = 𝜎! = λ
In other words, the mean and variance are exactly the average rate over a time interval.
Importance?
1. We always compare the mean with the variance (actually standard deviation)
2. A known factor that affects the mean also impacts the variance of the data
Poisson vs Binomial: Key Differences
1. Number of trials n:
• Binomial distribution - the number of events cannot be larger than n.
• Poisson distribution - the number of events can be indefinitely large.
2. Binomial proportion vs Poisson rate:
• A proportion is a ratio, whereas a rate implies a time/space component in the denominator
• If the average probability of an event happening per unit time/space (population) is given and
you’re asked to calculate a probability of k events happening in a given time/space, then Poisson is
the best approach.
3. Poisson distribution can be used to approximate Binomial when n is large or p is small
(rare event), BUT the reverse situation is not used often.
Poisson Approximation to Binomial
Under certain conditions, the Poisson distribution is a very good approximation to the
binomial distribution where λ = 𝑛𝑝.
What are these conditions?
1. n must be large (> 100)
2. Probability of success, p, should be small (p < 0.01)
Example: A rare birth defect occurs with probability 0.0001. Assuming that 4,000 babies
are born at a large hospital within a year, calculate the probability of having at least 10
babies with a birth defect.
Compute this probability using both Poisson and Binomial formulae and comment on
the results – Volunteers for next time session?
Other Shapes of Poisson Distribution
Notice that as the value of parameter λ
increases, the distribution becomes more
of a bell-shaped (normal distribution).
This indicates that for sufficiently large
values of λ, the Normal distribution is a
good approximation to the Poisson
distribution.
Binomial vs. Poisson Distributions
For each of the following, indicate whether the random variable
would follow the binomial distribution or Poisson distribution:
• X = “# of girls born in the next 50 births at a local hospital”
• Y = “# of girls born in the next week at a local hospital”
• Z = “# of patients who call a doctor’s office during a work day”
• W = “# of doctor’s workdays in a week with more than 100 phone calls”
• V = “# of days with rainy weather during summer”