Topic-5
Topic-5
Discrete random variables are fundamental in probability theory, modeling countable outcomes
such as the number of successes in trials or the number of events in a fixed interval.
10 hi h
T L e ng
Bernoulli Distribution
Motivation: The Bernoulli distribution arises naturally when modeling a single trial with two
outcomes, such as a coin flip (heads or tails), a yes/no survey response, or a pass/fail test, where
M D Si
we are interested in whether a specific event (e.g., success) occurs.
P(X = k) = 1 − p if k = 0,
Ra
0 otherwise.
Properties:
- Support: {0, 1}
- Mean: E[X] = 0 · (1 − p) + 1 · p = p,
Example 1. For p = 0.3, E[X] = 0.3, Var(X) = 0.3 · 0.7 = 0.21, σ ≈ 0.458.
Remark 1 (Bernoulli trial). An experiment that can result in either a “success” or a “failure” (but
not both) is called a Bernoulli trial. A Bernoulli random variable can be thought of as the indicator
of success in a Bernoulli trial: it equals 1 if success occurs and 0 if failure occurs in the trial.
1
Binomial Distribution
Motivation: The Binomial distribution is ideal for scenarios involving a fixed number of indepen-
dent trials, such as counting the number of heads in multiple coin flips, the number of defective
items in a batch of products, or the number of positive responses in a series of surveys, where each
trial has the same success probability.
Definition 2 (Binomial Distribution). Suppose that n independent Bernoulli trials are performed,
10 hi h
each with the same success probability p. Let X be the number of successes. The distribution of
X is called the Binomial distribution with parameters n and p. We write X ∼ Binomial(n, p) to
T L e ng
mean that X has the Binomial distribution with parameters n and p, where n is a positive integer
and 0 < p < 1. Alternatively, X ∼ Binomial(n, p) if PMF of X is given by
n k
P(X = k) = p (1 − p)n−k , k = 0, 1, . . . , n.
M D Si
k
Properties:
l
8
I I T ul
- Support: {0, 1, . . . , n}
n n−1
- Mean: E[X] = np (proved using k =n ),
h
k k−1
p
- Standard Deviation: σ = np(1 − p).
Theorem 1. If X ∼ Binomial(n, p), prove that E(X) = np and Var(X) = np(1 − p).
where nk = k!(n−k)!
n!
is the binomial coefficient.
Expectation E[X]: The expectation of X is defined as
n
X
E[X] = k P(X = k).
k=0
2
n
For k = 0, the term k k
= 0, so the sum can start from k = 1:
n
X n k
E[X] = k p (1 − p)n−k .
k=1
k
n n−1
Note that k k
=n k−1
for k ≥ 1, because
n n! (n − 1)! n−1
k =k· =n· =n .
k k!(n − k)! (k − 1)!(n − k)! k−1
10 hi h
X
E[X] = n p (1 − p)n−k
k=1
k−1
T L e ng
n
X n − 1 k−1
= np p (1 − p)n−k , factoring out np.
k=1
k − 1
M D Si
Let’s change the index by denoting j = k − 1, so when k = 1, j = 0, and when k = n, j = n − 1.
So,
n−1
X n−1 j
E[X] = np p (1 − p)n−1−j .
l j
8
I I T ul
j=0
n−1
X n−1
pj (1 − p)n−1−j = (p + (1 − p))n−1 = 1n−1 = 1.
j
Ra
j=0
E[X] = np · 1 = np.
Variance Var(X) We know that Var(X) = E[X 2 ] − (E[X])2 . We already have E[X] = np, so we
need E[X 2 ].
Note that X 2 = X(X − 1) + X, so using linearity of expectation
3
Thus,
n
X n−2 k
E[X(X − 1)] = n(n − 1) p (1 − p)n−k .
k=2
k − 2
10 hi h
j=0
j
= n(n − 1)p2 (p + (1 − p))n−2 = n(n − 1)p2 · 1 = n(n − 1)p2 .
T L e ng
Consequently,
E[X 2 ] = E[X(X − 1)] + E[X] = n(n − 1)p2 + np.
M D Si
Therefore,
8
I I T ul
□
Ra
Example 2. For n = 5, p = 0.4, E[X] = 5 · 0.4 = 2, Var(X) = 5 · 0.4 · 0.6 = 1.2, σ ≈ 1.095.
Poisson Distribution
Motivation: The Poisson distribution is useful for modeling the number of rare events occurring
in a fixed interval of time or space, such as the number of phone calls received at a call center in
an hour, the number of typos on a page, or the number of accidents at an intersection, the number
of emails received in an hour, assuming events occur at a constant average rate.
∞ ∞
X λj X e−λ λj
eλ = ⇒ = 1.
j=0
j! j=0
j!
λk e−λ
P(X = k) = , k = 0, 1, 2, . . . .
k!
4
Properties:
- Support: {0, 1, 2, . . . }
- Mean: E[X] = λ,
- Variance: Var(X) = λ,
√
- Standard Deviation: σ = λ.
10 hi h
E[X] = λ, Var(X) = λ.
T L e ng
Proof. The PMF of a Poisson random variable is
λk e−λ
P (X = k) = , k = 0, 1, 2, . . . .
M D Si
k!
Mean E[X]
l
The mean is defined as
8
I I T ul
∞ ∞
X X λk e−λ
E[X] = kP (X = k) = k· .
k=0 k=0
k!
h
λk e−λ
For k = 0, the term k · k!
= 0, so the sum starts from k = 1, that is,
Ra
∞
X λk e−λ
E[X] = k· .
k=1
k!
λk λk
k· = ,
k! (k − 1)!
so ∞
X λk
E[X] = e−λ .
k=1
(k − 1)!
Change the index by letting j = k − 1, so when k = 1, j = 0, and factoring out λ, we have
∞ ∞ ∞
X λk X λj+1 X λj
= =λ
k=1
(k − 1)! j=0
j! j=0
j!
P∞
Recall eλ = j=0 λj /j!, therefore
5
Variance Var(X)
The variance is given by Var(X) = E[X 2 ] − (E[X])2 . We already have E[X] = λ, so we need to
compute E[X 2 ].
We have k 2 = k(k − 1) + k, so using linearity of expectation
10 hi h
since k(k − 1) = 0 for k = 0, 1.
k λk
Note that k(k − 1) · λk! = (k−2)! for k ≥ 2, so
T L e ng k(k − 1) ·
λk
k!
=
k(k − 1)λk
k · (k − 1) · (k − 2)!
=
λk
(k − 2)!
,
M D Si
consequently
∞
X λk
E[X(X − 1)] = e−λ .
(k − 2)!
l k=2
8
I I T ul
X
= = λ2 = λ2 e λ ,
k=2
(k − 2)! j=0
j! j=0
j!
Ra
thus
E[X(X − 1)] = e−λ · λ2 eλ = λ2 .
Now,
E[X 2 ] = E[X(X − 1)] + E[X] = λ2 + λ.
The variance is
Var(X) = E[X 2 ] − (E[X])2 = (λ2 + λ) − λ2 = λ.
□
t
Example 3. For λ = 3, E[X] = 3, Var(X) = 3, σ ≈ 1.732, MX (t) = e3(e −1) .
Geometric Distribution
Motivation: The Geometric distribution is appropriate for modeling the number of trials needed
to achieve the first success in a sequence of independent trials, such as the number of times you
need to roll a die to get a six or the number of sales calls before the first sale, assuming a constant
success probability.
6
Remark 4. The geometric series sum is
∞
X 1
qk = , |q| < 1.
k=0
1−q
P(X = k) = (1 − p)k−1 p, k = 1, 2, . . . .
Properties:
- Support: {1, 2, . . . }
10 hi h
1 1
k(1 − p)k−1 p =
P
- Mean: E[X] = (using ),
T L e ng
p p2
1−p
- Variance: Var(X) = p2
,
√
M D Si
1−p
- Standard Deviation: σ = p
.
l
Example 4. For p = 0.2, E[X] = 5, Var(X) = 0.8
= 20, σ ≈ 4.472.
8
I I T ul
0.04
Theorem 3. If X ∼ Geometric(p) with success probability p (where 0 < p ≤ 1), and X is the
h
number of trials until the first success (support starting at 1), then
Ra
1 1−p
E[X] = , Var(X) = .
p p2
Mean E[X]
The expected value is
∞
X ∞
X
k−1
E[X] = k(1 − p) p=p k(1 − p)k−1 .
k=1 k=1
P∞ k−1
Denote q = 1 − p, then the sum k=1 kq is the derivative of the geometric series. Recall that
the geometric series sum is
∞
X 1
qk = , |q| < 1.
k=0
1−q
Differentiate both sides with respect to q, we have
∞
X
k−1 d 1 1
kq = = .
k=1
dq 1−q (1 − q)2
7
Substitute q = 1 − p, we get
∞
X 1
k(1 − p)k−1 = ,
k=1
p2
therefore
1 1
E[X] = p · 2
= .
p p
Variance Var(X)
The variance is Var(X) = E[X 2 ] − (E[X])2 . We have E[X] = 1/p, so we need E[X 2 ].
First, compute E[X 2 ],
∞ ∞
10 hi h
X X
2 2 k−1
E[X ] = k (1 − p) p=p k 2 q k−1 , where q = 1 − p.
k=1 k=1
T L e ng
P∞ 2 k−1
P∞ k=1 kk−1q
The sum can be found by differentiating the geometric series twice. To derive it,
start from k=1 kq = 1/(1 − q)2 , differentiate again, we have
M D Si
∞
X 2 X 2q
k(k − 1)q k−2 = ⇒ k(k − 1)q k−1 = .
k=2
(1 − q)3 (1 − q)3
Next, l
8
I I T ul
X X X X 2q 1
k 2 q k−1 = [k(k − 1) + k]q k−1 = k(k − 1)q k−1 + kq k−1 = 3
+
(1 − q) (1 − q)2
h
2q + 1 − q q+1
= =
Ra
(1 − q) 3 (1 − q)3
∞
X X 1+q
⇒ k 2 q k−1 = k 2 q k−1 = .
k=1
(1 − q)3
Substitute q = 1 − p,
∞
X 1 + (1 − p) 2−p
k 2 (1 − p)k−1 = 3
= ,
k=1
p p3
so
2−p 2−p
E[X 2 ] = p · 3
= .
p p2
Now, 2
2−p 1 2−p 1 2−p−1 1−p
Var(X) = − = − 2 = = .
p2 p p 2 p p 2 p2
□
8
Definition 5 (Negative Binomial Distribution). A RV X is said to follow Negative Binomial dis-
tribution with parameters r ∈ N and p > 0, denoted by X ∼ N egBin(r, p), if the PMF of X is
given by
k+r−1 r
P(X = k) = p (1 − p)k , k = 0, 1, 2, . . . .
k
Properties:
- Support: {0, 1, 2, . . . }
r(1−p)
- Mean: E[X] = p
,
r(1−p)
- Variance: Var(X) = ,
10 hi h
p2
√
r(1−p)
T L e ng
- Standard Deviation: σ = p
.
3·0.6 3·0.6
Example 5. For r = 3, p = 0.4, E[X] = = 4.5, Var(X) = = 11.25, σ ≈ 3.354.
M D Si
0.4 0.16
Hypergeometric Distribution
l
8
I I T ul
Motivation: The Hypergeometric distribution is relevant for sampling without replacement, such
as determining the number of defective items in a sample from a finite batch, the number of aces
drawn from a deck of cards, or the number of voters favoring a candidate in a small poll, where the
h
- Moments:
M
- Mean: E[X] = n · M +N
,
M N M +N −n
- Variance: Var(X) = n · M +N
· M +N
· M +N −1
,
q
M N M +N −n
- Standard Deviation: σ = n · M +N
· M +N
· M +N −1
.
7 7 13 15
Example 6. For N = 20, K = 7, n = 5, E[X] = 5 · 20 = 1.75, Var(X) = 5 · 20 · 20 · 19 ≈ 0.898,
σ ≈ 0.948.
9
Uniform Discrete Distribution
The uniform discrete distribution models outcomes that are equally likely, such as rolling a fair die.
Definition 7 (Uniform Discrete Distribution). A random variable X is said to follow discrete
uniform distribution over Ω = {x1 , x2 , . . . , xm }, if its probability mass function (PMF) is
1 , if i = 1, 2, . . . , m
P(X = xi ) = m
0, otherwise.
Theorem 4 (Mean of Uniform Discrete Random Variable). The expected value (mean) of X is
m
1 X
10 hi h
E[X] = xi .
m i=1
T L e ng
Pm Pm 1 1
Pm
Proof. By definition, E[X] = i=1 xi P(X = xi ) = i=1 xi · m
= m i=1 xi .
□
M D Si
Theorem 5 (Variance of Uniform Discrete Random Variable). The variance of X is
m m
!2
1 X 2 1 X
Var(X) = x − xi .
l m i=1 i m i=1
8
I I T ul
Proof. The variance is Var(X) = E[X 2 ] − (E[X])2 . First, compute the second moment:
h
m m m
2
X X 1 1 X 2
E[X ] = x2i P(X = xi ) = x2i · = x.
Ra
i=1 i=1
m m i=1 i
Thus, !2
m m
2
2 1 X 2 1 X
Var(X) = E[X ] − E[X] = x − xi .
m i=1 i m i=1
□
Theorem 6. If X is a uniform discrete random variable over Ω = {1, 2, . . . , m}, then
and m
2 1 X 2 1 m(m + 1)(2m + 1) (m + 1)(2m + 1)
E[X ] = i = · = .
m i=1 m 6 6
10
Thus,
Summary
10 hi h
Distribution Notation PMF P (X = k) Mean Variance MGF ∗ MX (t)
T L e ng
(
p, k=1
Bernoulli X ∼ Bernoulli(p) p p(1 − p) (1 − p) + pet
1 − p, k = 0
n
k n
Binomial X ∼ Binomial(n, p) k
p (1 − p)n−k , k = 0, . . . , n np np(1 − p) (1 − p) + pet
M D Si
e−λ λk
Poisson X ∼ Poisson(λ) , k = 0, 1, . . . λ λ exp λ(et − 1)
k!
1 1−p pet
Geometric X ∼ Geometric(p) (1 − p)k−1 p, k = 1, 2, . . . , t < − ln(1 − p)
p p2 1 − (1 − p)et
l k+r−1
pr (1 − p)k ,
r(1 − p) r(1 − p)
p
r
8
I I T ul
Negative Binomial X ∼ NegBin(r, p) k
k = 0, 1, 2, . . . 1−(1−p)et
, t < − ln(1 − p).
p p2
∗
MGF will be discussed later.
h
(
p(1 − p)x , if x ∈ {0, 1, 2, . . .}
f (x) =
0, otherwise
Here parameter p is the same, i.e., probability of success on each trial (0 < p < 1), and Expec-
tation: E[X] = 1−pp
, Variance: V ar(X) = 1−pp2
for t < − ln(1 − p). Similarly, negative binomial
distribution can be defined with a different PMF.
References
[1] Blitzstein, J. K., & Hwang, J. (2019). Introduction to probability. Chapman and Hall/CRC.
Disclaimer
This lecture note is prepared solely for teaching and academic purposes. Some parts of the mate-
rial, including definitions, examples, and explanations, have been adapted or reproduced from the
references. These notes are not intended for commercial distribution or publication, and all rights
remain with the respective copyright holders.
11