Professional Documents
Culture Documents
Probability 2.1 EdX
Probability 2.1 EdX
Random Variables
Dave Goldsman
H. Milton Stewart School of Industrial and Systems Engineering
Georgia Institute of Technology
3/2/20
ISYE 6739
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Introduction
P (X = 0) = 14 , P (X = 1) = 21 , P (X = 2) = 41 . 2
ISYE 6739
Introduction
Example: Let X be the sum of two dice rolls. Then, e.g., (4, 6) is an
outcome from the sample space, and of course X((4, 6)) = 10.
In addition,
1/36 if x = 2
2/36 if x = 3
..
.
P (X = x) = 6/36 if x = 7
..
.
1/36 if x = 12
2
0 otherwise.
ISYE 6739
Introduction
1
For our purposes, X and Y are the same, since P (X = 0) = P (Y = 0) = 2
and P (X = 1) = P (Y = 1) = 12 .
ISYE 6739
Introduction
ISYE 6739
Introduction
Example: The amount of time you wait in a line is either 0 (with positive
probability) or some positive real number — a combined discrete-continuous
random variable!
ISYE 6739
Discrete Random Variables
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Discrete Random Variables
Example: A discrete RV can have any values. For instance, let X denote the
possible profits from an inventory policy, where f (−5.1) = 0.2 (lose money),
f (1.3) = 0.5 (break even), and f (11) = 0.3 (big bucks!).
ISYE 6739
Discrete Random Variables
All 3 trials are indep, and P (success) = 1/6 doesn’t change from trial to trial.
ISYE 6739
Discrete Random Variables
where q = 1 − p.
· · · S} |F F {z
|SS{z · · · F} (probability = pk q n−k ).
k successes n − k failures
n
2
The number of ways to arrange the sequence is k . Done.
ISYE 6739
Discrete Random Variables
n = 3, k = 2, p = 1/6, q = 5/6.
n k n−k 3 1 2 5 1 15
P (X = 2) = p q = = .
k 2 6 6 216
k 0 1 2 3
125 75 15 1
2
P (X = k) 216 216 216 216
ISYE 6739
Discrete Random Variables
ISYE 6739
Discrete Random Variables
Notation: X ∼ Pois(λ).
P (X ≥ 4) = 1 − P (X = 0, 1, 2, 3)
0
101 102 103
10
= 1 − e−10 + + +
0! 1! 2! 3!
= 0.9897. 2
ISYE 6739
Continuous Random Variables
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Continuous Random Variables
Intuitively, if 0 ≤ a ≤ b ≤ 1, then
ISYE 6739
Continuous Random Variables
ISYE 6739
Continuous Random Variables
Note that f (x) denotes both pmf (discrete case) and pdf (continuous case)
— but they are different:
If X is continuous, then
f (x) isn’t a probability — but it’s used to calculate probabilities.
Instead, think of f (x) dx ≈ P (x < X < x + dx).
Must have f (x) ≥ 0 (and possibly > 1).
Calculate the probability
R of an event by integrating,
P (X ∈ A) = A f (x) dx.
ISYE 6739
Continuous Random Variables
ISYE 6739
Continuous Random Variables
Notation: X ∼ Exp(λ).
R∞
λe−λx dx = 1 (as desired).
R
Remark: R f (x) dx = 0
ISYE 6739
Continuous Random Variables
ISYE 6739
Continuous Random Variables
First of all, let’s find c. Noting that the pdf must integrate to 1, we have
Z Z 2
1 = f (x) dx = cx2 dx = 8c/3,
R 0
so that c = 3/8.
ISYE 6739
Continuous Random Variables
ISYE 6739
Continuous Random Variables
ISYE 6739
Cumulative Distribution Functions
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Cumulative Distribution Functions
F (x) ≡ P (X ≤ x).
For X discrete,
X X
F (x) = f (y) = P (X = y).
{y|y≤x} {y|y≤x}
For X continuous, Z x
F (x) = f (y) dy.
−∞
ISYE 6739
Cumulative Distribution Functions
Discrete cdf’s
Warning! For discrete RVs, you have to be careful about “≤” vs. “<” at the
endpoints of the intervals (where the step function jumps).
ISYE 6739
Cumulative Distribution Functions
Continuous cdf’s
ISYE 6739
Cumulative Distribution Functions
Example: X ∼ Exp(λ).
(
λe−λx if x > 0
f (x) =
0 otherwise.
(
Z x 0 if x ≤ 0
F (x) = f (t) dt =
−∞ 1− e−λx if x > 0.
We can use the cdf to find the median of X, that is, the point m such that
ISYE 6739
Cumulative Distribution Functions
ISYE 6739
Cumulative Distribution Functions
P (a < X ≤ b)
= P (X > a ∩ X ≤ b)
= P (X > a) + P (X ≤ b) − P (X > a ∪ X ≤ b)
= 1 − F (a) + F (b) − 1. 2
ISYE 6739
Great Expectations
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Great Expectations
ISYE 6739
Great Expectations
ISYE 6739
Great Expectations
ISYE 6739
Great Expectations
f (x) = (1 − p)x−1 p, x = 1, 2, . . . .
Notation: X ∼ Geom(p).
Here’s an application that requires me to admit that I’m not a very good
basketball player. Suppose I take independent foul shots, but the chance
of making any particular shot is only 0.4. What’s the probability that it’ll take
me at least 3 tries to make a successful shot?
P (X ≥ 3) = 1 − P (X ≤ 2)
= 1 − P (X = 1) − P (X = 2)
= 1 − 0.4 − (0.6)(0.4) = 0.36. 2
ISYE 6739
Great Expectations
X ∞
X
E[X] = xf (x) = xq x−1 p (where q = 1 − p)
x x=1
∞
X d x
= p q
dq
x=1
∞
d X x
= p q (swap derivative and sum)
dq
x=1
d q
= p (geometric sum)
dq 1 − q
(1 − q) − q(−1)
= p (ho de hi minus hi dee ho over ho ho)
(1 − q)2
= 1/p. 2
ISYE 6739
Great Expectations
ISYE 6739
LOTUS, Moments, and Variance
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
LOTUS, Moments, and Variance
E[h(X)] is a weighted function of h(x), where the weights are the f (x)’s.
Remark: It looks like a definition, but it’s really a theorem — that’s why they
call it LOTUS!
ISYE 6739
LOTUS, Moments, and Variance
ISYE 6739
LOTUS, Moments, and Variance
ISYE 6739
LOTUS, Moments, and Variance
Var(X) ≡ E (X − µ)2 .
Notation: σ 2 ≡ Var(X).
p
Definition: The standard deviation of X is σ ≡ + Var(X).
ISYE 6739
LOTUS, Moments, and Variance
ISYE 6739
LOTUS, Moments, and Variance
The next results establish the fact that the expected value operator can pass
through certain linear functions of X, and then can be used to obtain pleasant
expressions for other expected values and variances.
E[ah(X) + b] = aE[h(X)] + b.
ISYE 6739
LOTUS, Moments, and Variance
Corollary: In particular,
E[aX + b] = aE[X] + b.
ISYE 6739
LOTUS, Moments, and Variance
ISYE 6739
LOTUS, Moments, and Variance
Var(aX + b) = a2 Var(X).
Proof:
Var(aX + b) = E[(aX + b)2 ] − (E[aX + b])2
= E[a2 X 2 + 2abX + b2 ] − (aE[X] + b)2
= a2 E[X 2 ] + 2abE[X] + b2
− a2 (E[X])2 + 2abE[X] + b2
= a2 E[X 2 ] − (E[X])2
= a2 Var(X). 2
ISYE 6739
LOTUS, Moments, and Variance
and
Var(Y ) = Var(4X + 5) = 16Var(X) = 3.36. 2
ISYE 6739
Approximations to E[h(X)] and Var(h(X))
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Approximations to E[h(X)] and Var(h(X))
(X − µ)2 00
Y = h(µ) + (X − µ)h0 (µ) + h (µ) + R,
2
where R is a remainder term that we’ll ignore. Then
ISYE 6739
Approximations to E[h(X)] and Var(h(X))
Well, it’s not really that complicated, since we can calculate the exact
moments:
Z Z 1
3/4
E[Y ] = x f (x) dx = 3x11/4 dx = 4/5
R 0
Z Z 1
E[Y 2 ] = x6/4 f (x) dx = 3x7/2 dx = 2/3
R 0
ISYE 6739
Approximations to E[h(X)] and Var(h(X))
ISYE 6739
Approximations to E[h(X)] and Var(h(X))
Further,
Thus,
ISYE 6739
Moment Generating Functions
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Moment Generating Functions
MX (t) ≡ E etX .
ISYE 6739
Moment Generating Functions
MX (t) = E[etX ]
Z
= etx f (x) dx (LOTUS)
ZR∞
= etx λe−λx dx
0
Z ∞
= λ e(t−λ)x dx
0
λ
= if λ > t. 2
λ−t
ISYE 6739
Moment Generating Functions
Big Theorem: Under certain technical conditions (e.g., MX (t) must exist
for all t ∈ (−, ) for some > 0), we have
dk
E[X k ] = MX (t) , k = 1, 2, . . . .
dtk t=0
Thus, you can generate the moments of X from the mgf. (Sometimes, it’s
easier to get moments this way than directly.)
ISYE 6739
Moment Generating Functions
t2 E[X 2 ]
= 1 + t E[X] + + ··· .
2
This implies
d
MX (t) “=” E[X] + t E[X 2 ] + · · ·
dt
and so
d
MX (t) = E[X].
dt t=0
ISYE 6739
Moment Generating Functions
d d
E[X] = MX (t) = (pet + q) = pet t=0
= p.
dt t=0 dt t=0
dk
In fact, it’s easy to see that E[X k ] = dtk
MX (t) t=0 = p, for all k. 2
λ
Example: X ∼ Exp(λ). Then MX (t) = λ−t for λ > t. So
d λ
E[X] = MX (t) = = 1/λ
dt t=0 (λ − t)2 t=0
d2 2λ
E[X 2 ] = MX (t) = = 2/λ2
dt2 t=0 (λ − t)3 t=0
2 1
Var(X) = E[X 2 ] − (E[X])2 = 2
− 2 = 1/λ2 . 2
λ λ
ISYE 6739
Moment Generating Functions
ISYE 6739
Moment Generating Functions
Theorem (mgf of a linear function of X): Suppose X has mgf MX (t) and
let Y = aX + b. Then
Proof:
λ
MY (t) = e2t MX (3t) = e2t , if λ > 3t. 2
λ − 3t
ISYE 6739
Moment Generating Functions
λ
MY (t) = e2t , for λ > 3t.
λ − 3t
Then by a previous example and the uniqueness of mgf’s, it must be the case
that Y ∼ 3X + 2, where X ∼ Exp(λ). 2
ISYE 6739
Some Probability Inequalities
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Some Probability Inequalities
P |X − µ| ≥ c ≤ σ 2 /c2 .
E[(X − µ)2 ]
P |X − µ| ≥ c = P (X − µ)2 ≥ c2 ≤ = σ 2 /c2 . 2
c2
Remarks: Can also write P (|X − µ| < c) ≥ 1 − σ 2 /c2 .
Chebychev gives a bound on the probability that X deviates from the mean by
more than a constant, in terms of the constant and the variance. You can
always use Chebychev, but it’s crude.
1
There are many, many ways to spell “Chebychev.” See
https://en.wikipedia.org/wiki/Talk%3APafnuty_Chebyshev
ISYE 6739
Some Probability Inequalities
ISYE 6739
Some Probability Inequalities
Example (cont’d): Let’s compare the above bound to the exact answer.
1 1 1 1
P X− ≥ = 1−P X − <
2 3 2 3
1 1 1
= 1−P − <X − <
3 2 3
1 5
= 1−P <X<
6 6
Z 5/6
= 1− f (x) dx
1/6
2
= 1 − = 1/3.
3
So Chebychev bound of 3/4 was pretty high by comparison. 2
ISYE 6739
Some Probability Inequalities
P (X ≥ c) ≤ e−ct MX (t).
ISYE 6739
Functions of a Random Variable
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Functions of a Random Variable
ISYE 6739
Functions of a Random Variable
Remark: Recall that LOTUS gave us results for E[h(X)]. But this is much
more general than LOTUS, because now we’re going to get the entire
distribution of h(X).
We’ll start with the case in which X is a discrete RV, and then we’ll go to the
continuous X case.
ISYE 6739
Functions of a Random Variable
Example: X is the number of H’s in 2 coin tosses. We want the pmf for
Y = h(X) = X 3 − X.
x 0 1 2
1 1 1
f (x) = P (X = x) 4 2 4
y = x3 − x 0 0 6
ISYE 6739
Functions of a Random Variable
ISYE 6739
Functions of a Random Variable
ISYE 6739
Functions of a Random Variable
where √
y
√ √
Z
(?) = P (− y ≤ X ≤ y) = √
|x| dx = y.
− y
ISYE 6739
Functions of a Random Variable
Thus,
0 if y ≤ 0
G(y) = 1 if y ≥ 1
y if 0 < y < 1.
This implies
(
0 if y ≤ 0 or y ≥ 1
g(y) = G0 (y) =
1 if 0 < y < 1.
ISYE 6739
Functions of a Random Variable
G(y) = P (Y ≤ y)
= P (−`n(1 − U ) ≤ y)
= P (1 − U ≥ e−y )
= P (U ≤ 1 − e−y )
Z 1−e−y
= f (u) du
0
= 1 − e−y (since f (u) = 1).
ISYE 6739
Inverse Transform Theorem
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Inverse Transform Theorem
G(y) = P (Y ≤ y)
= P (F (X) ≤ y)
= P (X ≤ F −1 (y)) (the cdf is mono. increasing)
= F (F −1 (y)) (F (x) is the cdf of X)
= y. Uniform! 2
2
Also known as the Probability Integral Transform.
ISYE 6739
Inverse Transform Theorem
ISYE 6739
Inverse Transform Theorem
ISYE 6739
Inverse Transform Theorem
ISYE 6739
Honors Bonus Results
Outline
1 Introduction
2 Discrete Random Variables
3 Continuous Random Variables
4 Cumulative Distribution Functions
5 Great Expectations
6 LOTUS, Moments, and Variance
7 Approximations to E[h(X)] and Var(h(X))
8 Moment Generating Functions
9 Some Probability Inequalities
10 Functions of a Random Variable
11 Inverse Transform Theorem
12 Honors Bonus Results
ISYE 6739
Honors Bonus Results
d d
g(y) = G(y) = P (Y ≤ y)
dy dy
d
= P (h(X) ≤ y)
dy
d
= P (X ≤ h−1 (y)) (h(x) is monotonic)
dy
d
= F (h−1 (y))
dy
dh−1 (y)
= f (h−1 (y)) (chain rule). 2
dy
ISYE 6739
Honors Bonus Results
Example: Suppose that f (x) = 3x2 , 0 < x < 1. Let Y = h(X) = X 1/2 ,
which is monotone increasing. Then the pdf of Y is
dh−1 (y)
g(y) = f (h−1 (y))
dy
2
d(y )
= f (y 2 )
dy
= 3y 4 (2y)
= 6y 5 , 0 < y < 1. 2
ISYE 6739
Honors Bonus Results
E[h(X)] = E[Y ]
Z
= yg(y) dy
R
dh−1 (y)
Z
= yf (h−1 (y)) dy
dy
ZR
dx
= h(x)f (x) dy
R dy
Z
= h(x)f (x) dx. 2
R
ISYE 6739