Chapter 3: Random Variables and Discrete Distributions  
MATH/STAT 394: Probability I  
Arman Jahangiri  
University of Washington Department of Mathematics  
Summer 2026  
Arman Jahangiri  
Summer 2026  
1
 
Learning Goals  
By the end of this lecture, students should be able to:  
define a random variable;  
compute and interpret PMFs and CDFs;  
recognize and use common discrete distributions;  
work with functions of random variables;  
Arman Jahangiri  
Summer 2026  
2
Random Variables  
Arman Jahangiri  
Summer 2026  
3
Why Random Variables?  
In many experiments, the sample space itself is complicated.  
Examples:  
sequences of coin tosses;  
poker hands;  
paths of a random walk;  
survey responses.  
Usually we are not interested in the full outcome itself.  
Instead, we care about a numerical summary:  
number of Heads (i.e., 3 instead of HHTHTTT);  
total score;  
duration of a game;  
number of successes.  
Arman Jahangiri  
Summer 2026  
4
Definition of a Random Variable  
Definition  
Let (S, F, P) be a probability space. A random variable (r.v.) is a (measurable) function  
X : S → R.  
Measurability means that for every (Borel) set B ∈ B,  
X
1(B) = { s ∈ S : X(s) B } ∈ F.  
Important  
The randomness comes from the outcome  
s ∈ S.  
The function X itself is deterministic; it simply converts outcomes into numerical values.  
Arman Jahangiri  
Summer 2026  
5
Coin Toss Example  
Flip a fair coin twice.  
S = {HH, HT, TH, TT}.  
Define:  
Then,  
X = number of Heads.  
X(HH) = 2,  
X(HT) = 1,  
X(TH) = 1,  
X(TT) = 0.  
Thus,  
X : S → {0, 1, 2}.  
Arman Jahangiri  
Summer 2026  
6
Indicator Random Variables  
Indicator Random Variable  
For an event A, define  
(
1, if A occurs,  
IA  
=
0, otherwise.  
Indicator random variables are extremely useful.  
Example.  
I
.
{first toss is Heads}  
Arman Jahangiri  
Summer 2026  
7
Discrete Random Variables  
Definition  
A random variable is discrete if it takes values in a finite or countably infinite set.  
Examples:  
number of Heads in 10 tosses;  
number of emails received today;  
number of customers entering a store.  
Arman Jahangiri  
Summer 2026  
8
PMFs and Distributions  
Arman Jahangiri  
Summer 2026  
9
Probability Mass Functions (PMFs)  
Definition  
The probability mass function (PMF) of a discrete r.v. X is  
pX (x) = P(X = x).  
The PMF assigns probability mass to each possible value of the random variable.  
Arman Jahangiri  
Summer 2026 10  
PMF Example: Number of Heads  
Suppose:  
X = number of Heads in two fair tosses.  
Then,  
1
4
1
2
1
4
pX (0) =  
,
pX (1) =  
,
pX (2) =  
.
All other values have probability 0. We will see in the future that this is called a Binomial random variable with  
parameters n = 2 and p = 0.5.  
Arman Jahangiri  
Summer 2026 11  
Properties of a Valid PMF  
A valid PMF must satisfy:  
1
Nonnegativity:  
pX (x) 0.  
2
Total probability equals 1:  
X
pX (x) = 1.  
x
Interpretation  
A PMF distributes total probability mass 1 across the support of the random variable.  
Arman Jahangiri  
Summer 2026 12  
Example: Sum of Two Dice  
Roll two fair dice. Define T :  
Define  
T = sum of the two die rolls  
The possible values of T:  
Support(T) = {2, 3, . . . , 12}.  
and the PMF,  
t
2
3
4
5
6
7
8
9
10 11 12  
1
36  
2
36  
3
36  
4
36  
5
36  
6
36  
5
36  
4
36  
3
36  
2
36  
1
36  
pT (t) = P(T = t)  
Arman Jahangiri  
Summer 2026 13  
Named Distributions  
Arman Jahangiri  
Summer 2026 14  
Bernoulli Distribution  
A Bernoulli random variable models the outcome of a binary experiment: success 1,  
failure 0.  
Bernoulli PMF  
A random variable X has the Bernoulli distribution with parameter 0 p 1, written X Bern(p), if its PMF is  
given by  
p,  
x = 1,  
pX (x) =  
1 p, x = 0,  
0,  
otherwise,  
Interpretation: P(success) = P(X = 1) = p,  
P(failure) = P(X = 0) = 1 p. PMF verification: Since 0 p 1,, we  
have pX (x) 0. Also,  
X
pX (x) = p + (1 p) = 1.  
x
Hence pX (x) satisfies the properties of a PMF.  
Arman Jahangiri  
Summer 2026 15  
Bernoulli Distribution: PMF  
X Bern(p),  
P(X = 1) = p,  
P(X = 0) = 1 p.  
A Bernoulli random variable models a single success/failure  
experiment.  
Arman Jahangiri  
Summer 2026 16  
Binomial Distribution  
Binomial Distribution  
Suppose an experiment consists of  
n independent Bernoulli trials;  
where each trial share the same success probability p.  
If X is the number of successes, then  
X Bin(n, p).  
Arman Jahangiri  
Summer 2026 17  
Binomial PMF  
If  
X Bin(n, p),  
then  
ꢀ ꢁ  
n
pX (k) = P(X = k) =  
pk (1 p)nk  
,
k
for  
k = 0, 1, . . . , n.  
Interpretation:  
ꢂ ꢃ  
n
k
: choose which k trials are successes;  
pk : probability of the k successes;  
(1 p)nk : probability of the n k failures.  
PMF verification: Since 0 p 1, we have pX (k) 0. Also,  
n
n
ꢀ ꢁ  
X
X
n
pX (k) =  
pk (1 p)nk = (p + (1 p))n = 1,  
k
k=0  
k=0  
by the Binomial Theorem.  
Arman Jahangiri  
Summer 2026 18  
Binomial Distribution: PMF  
X Bin(n, p),  
  !  
n
P(X = k) =  
pk (1 p)nk  
.
k
Binomial distribution counts the number of successes in n independent Bernoulli trials.  
Arman Jahangiri  
Summer 2026 19  
Example: Coin Tosses  
Flip a fair coin 10 times.  
Let:  
X = number of Heads.  
Then,  
X Bin(10, 12 ).  
For example:  
 
!
   
10  
10  
3
1
P(X = 3) =  
.
2
Arman Jahangiri  
Summer 2026 20  
Geometric Distribution  
Geometric Distribution  
Suppose independent Bernoulli trials are repeated until the first success occurs.  
Let  
X = number of trials until the first success.  
If each trial share the same success probability p, then  
X Geom(p).  
Possible values:  
1, 2, 3, . . . (i.e., all positive integers)  
Interpretation:  
X = 1 means success on the first trial;  
X = 2 means failure then success;  
X = 3 means two failures then success;  
etc.  
Arman Jahangiri  
Summer 2026 21  
Geometric PMF  
If  
X Geom(p),  
P(X = k) = (1 p)k1p,  
k = 1, 2, 3, . . .  
then  
for  
Interpretation:  
the first k 1 trials must fail;  
the k-th trial must succeed.  
Hence,  
P(X = k) = (1 p)k1  
failures  
p
.
|{z}  
|
{z  
}
success  
PMF verification: Since 0 p 1, we have pX (x) 0. Also,  
X
X
X
1
1
pX (k) =  
(1 p)k1p = p  
(1 p)k = p ×  
= p × = 1,  
1 (1 p)  
p
k=1  
k=1  
k=0  
using the geometric sequence formula.  
Arman Jahangiri  
Summer 2026 22  
Geometric Distribution: PMF  
X Geom(p),  
pX (x) = P(X = k) = (1 p)k1p,  
k = 1, 2, 3, . . .  
The Geometric distribution models the waiting time until the first success.  
Arman Jahangiri  
Summer 2026 23  
Memoryless Property of Geom(p)  
The Geometric distribution is the only discrete distribution that satisfies the memoryless property. We will see  
the continuous counterpart (exponential distribution) in Chapter 5b.  
P(X > m + n | X > m) = P(X > n).  
Interpretation:  
If the first m trials were all failures, the process probabilistically restarts from scratch.  
Example:  
P(X > 10 | X > 7) = P(X > 3).  
The past failures do not affect future waiting times.  
Arman Jahangiri  
Summer 2026 24  
Negative Binomial Distribution  
Negative Binomial Distribution  
Suppose independent Bernoulli trials are repeated until the rth success occurs.  
Let  
X = number of trials needed to obtain r successes.  
If each trial has success probability p, then  
X NegBin(r, p).  
Possible values:  
r, r + 1, r + 2, . . .  
Interpretation:  
the experiment stops once the rth success appears;  
Geometric distribution is the special case  
r = 1.  
Arman Jahangiri  
Summer 2026 25  
Negative Binomial PMF  
If  
X NegBin(r, p),  
then  
k 1  
pX (k) = P(X = k) =  
pr (1 p)kr  
,
r 1  
for  
k = r, r + 1, r + 2, . . .  
Interpretation:  
among the first k 1 trials, there must be exactly r 1 successes;  
the k-th trial must be a success.  
Thus,  
|
}
k 1  
P(X = k) =  
pr  
(1 p)kr  
.
|{z}  
|
{z  
}
r 1  
{z  
r successes  
kr failures  
arrange first r1 successes  
PMF verification: Since 0 p 1, we have pX (x) 0.  
Arman Jahangiri  
Summer 2026 26  
PMF verification (conitnue)  
 
!
X
X
k 1  
pX (k) =  
pr (1 p)kr  
.
r 1  
k=r  
k=r  
Let  
j = k r.  
Then k = j + r, so  
 
!
X
X
j + r 1  
pX (k) = pr  
(1 p)j .  
r 1  
k=r  
j=0  
identity,  
 
!
X
j + r 1  
1
xj =  
,
|x| < 1,  
r 1  
(1 x)r  
j=0  
with x = 1 p, we get  
X
1
1
pr  
pX (k) = pr  
= pr  
= 1.  
(1 (1 p))r  
k=r  
Arman Jahangiri  
Summer 2026 27  
Understanding the Formula  
To have  
X = k,  
the following must happen:  
1
In the first k 1 trials, r 1 successes must occur.  
2
The final trial must be a success.  
Number of ways:  
 
!
k 1  
.
r 1  
Probability of each arrangement:  
Multiplying gives:  
p r1(1 p)kr · p = pr (1 p)kr  
.
 
!
k 1  
P(X = k) =  
pr (1 p)kr  
.
r 1  
Note that both the formula and the definition implies that the Negative Binomial distribution is a generalization of  
the Geometric distribution (when r = 1, Negative Binomial reduces to Geometric).  
Arman Jahangiri  
Summer 2026 28  
Example: Third Heads  
Flip a fair coin repeatedly.  
Let  
X = number of tosses needed to obtain 3 Heads.  
Then,  
X NegBin(3, 12 ).  
For example,  
  !  
     
3
2
4
1
2
1
2
P(X = 5) =  
.
2
Interpretation:  
among the first 4 tosses, exactly 2 must be Heads;  
the 5th toss must also be Heads.  
Arman Jahangiri  
Summer 2026 29  
Geometric vs. Negative Binomial  
Distribution  
Stops After  
Support  
Geometric  
first success  
1, 2, 3, . . .  
Negative Binomial  
rth success  
r, r + 1, . . .  
Key Relationship  
The Geometric distribution is a special case of the Negative Binomial distribution:  
Geom(p) = NegBin(1, p).  
Arman Jahangiri  
Summer 2026 30  
Hypergeometric Distribution  
Hypergeometric Story  
An urn contains:  
w white balls,  
b black balls.  
Sample n balls without replacement.  
If X is the number of white balls selected, then  
X HGeom(w, b, n).  
Arman Jahangiri  
Summer 2026 31  
Hypergeometric PMF  
If  
X HGeom(w, b, n),  
then  
ꢂ ꢃꢂ  
w
k
b
nk  
P(X = k) =  
.
w+b  
n
The possible values are  
max(0, n b) k min(w, n).  
Interpretation:  
choose k white balls from the w white balls;  
choose n k black balls from the b black balls;  
divide by the totral number of samples of size n.  
Thus,  
|
}
w
k
b
n k  
| {z }  
choose white balls  
{z  
choose black balls  
P(X = k) =  
.
w + b  
n
all samples of size n  
Arman Jahangiri  
Summer 2026 32  
Hypergeometric Distribution: PMF  
X HGeom(w, b, n),  
 ꢃꢂ  
w
k
b
nk  
P(X = k) =  
.
w+b  
n
The Hypergeometric distribution arises from  
sampling without replacement.  
Arman Jahangiri  
Summer 2026 33  
Binomial vs. Hypergeometric  
Distribution  
Binomial  
Replacement? Independent?  
Yes  
No  
Yes  
No  
Hypergeometric  
Key Difference  
Hypergeometric sampling is without replacement.  
Arman Jahangiri  
Summer 2026 34  
Discrete Uniform Distribution  
Discrete Uniform  
Choose one value uniformly from a finite set C.  
Then,  
X DUnif(C).  
All values are equally likely.  
Example:  
X DUnif({1, 2, . . . , 6}).  
Arman Jahangiri  
Summer 2026 35  
Poisson Distribution  
Poisson Distribution  
A random variable X has the Poisson distribution with parameter λ > 0 if  
λ λk  
P(X = k) = e  
,
k = 0, 1, 2, . . . .  
k!  
Notation:  
X Pois(λ).  
Poisson random variables often model counts of rare events.  
PMF verification: Since  
λ > 0,  
we have  
Also,  
P(X = k) 0.  
λ λk  
λ
k
X
X
X
pX (k) =  
e
= eλ  
.
k!  
k!  
k=0  
k=0  
k=0  
Using the exponential series,  
k
X
λ
= eλ,  
k!  
k=0  
so  
Arman Jahangiri  
Summer 2026 36  
Poisson Distribution: PMF  
X Pois(λ),  
λ λk  
P(X = k) = e  
,
k = 0, 1, 2, . . .  
k!  
The Poisson distribution models the number  
of events occurring in a fixed interval of time  
or space.  
Typical examples include:  
phone calls arriving,  
radioactive decays,  
website visits,  
accidents in a day.  
Arman Jahangiri  
Summer 2026 37  
CDFs  
Arman Jahangiri  
Summer 2026 38  
Cumulative Distribution Functions  
Definition  
The cumulative distribution function (CDF) of X is  
FX (x) = P(X x).  
The CDF accumulates all the probability mass that exists from −∞ to (inclusive) x.  
In other words, FX (x) = P(X (−∞, x]) = P(−∞ < X x) are three different ways of introducing the same  
thing, the CDF of X at point x.  
Note that X x (or X (−∞, x], or −∞ < X x), actually refer to an EVENT:  
{X x} = {s ∈ S : X(s) x} = X1((−∞, x]))  
In general, {X A} = {s ∈ S : X(s) A} = X1(A)  
Arman Jahangiri  
Summer 2026 39  
PMF vs. CDF  
For discrete random variables:  
PMF:  
pX (x) = P(X = x)  
gives probability at one point;  
CDF:  
FX (x) = P(X x)  
gives cumulative probability.  
The CDF is increasing and ranges from 0 to 1.  
Arman Jahangiri  
Summer 2026 40  
Properties of a CDF  
Key properties  
Every CDF satisfies:  
0 F(x) 1,  
F(x) is increasing,  
xlim−∞ F(x) = 0,  
lim F(x) = 1.  
x→∞  
Arman Jahangiri  
Summer 2026 41  
Functions of Random Variables  
Arman Jahangiri  
Summer 2026 42  
Functions of Random Variables  
If X is a random variable and  
g : R R,  
then  
Y = g(X)  
is also a random variable.  
Examples:  
Y = X2,  
Y = X,  
Y = |X|,  
Y = 2X + 1.  
Question: How to find FY (y)? We will see later in Transformations of r.v.s.  
Arman Jahangiri  
Summer 2026 43  
Several Random Variables on One Space  
Different random variables may be defined on the same experiment.  
Example:  
X = first die ∈ { 1, 2, 3, 4, 5, 6 };  
Y = second die ∈ { 1, 2, 3, 4, 5, 6 };  
X + Y = total ∈ { 1, 2, . . . , 11, 12 };  
max(X, Y ) = maximum ∈ { 1, 2, 3, 4, 5, 6 };  
|X Y | = difference ∈ { 0, 1, 2, 3, 4, 5 };  
Each gives a different numerical summary of the same experiment.  
Arman Jahangiri  
Summer 2026 44  
Summary  
A random variable is a function from the sample space to R.  
Discrete random variables are described by PMFs.  
Important distributions:  
Bernoulli, Binomial, Hypergeometric, Discrete Uniform.  
CDFs accumulate probability:  
FX (x) = P(X x).  
Functions of random variables are themselves random variables.  
Random variables help convert complicated experiments into manageable numerical objects.  
Next lecture  
Expectation  
Arman Jahangiri  
Summer 2026 45