Iit random variable semester
Iit random variable semester
Yibi Huang
Department of Statistics
University of Chicago
1
Random Variable & Probability Mass Function (Review)
2
Example: Geometric Distribution
z }| {
p(x) = P(X = x) = P(T . . . T H) by indep.
p(x)
p(x) = − p) x−1 p = 1?
P∞ P∞
Does x=1 x=1 (1
4
Example: Geometric Distribution (Cont’d)
p(x) = − p) x−1 p = 1?
P∞ P∞
Does x=1 x=1 (1
4
Example: Geometric Distribution (Cont’d)
p(x) = − p) x−1 p = 1?
P∞ P∞
Does x=1 x=1 (1
4
Example: A Card Game
5
Example: A Card Game
Outcome x p(x)
35/52 if x = 0
Heart (not ace) if x = 1
1 12/52
12/52
p(x) = if x = 5
⇒
Ace 5 4/52 4/52
if x = 10
King of spades 10 1/52
1/52
0 for all other values of x
All else 0 35/52
5
Expected Value of a Random
Variable
Expected Value = Expectation = Mean
µ = E[X]
X
= xP(X = x)
all x
X
= xp(x)
all x
6
Example: Card Game — Expected Value
35/52 if x = 0
if x = 1
12/52
p(x) =
if x = 5
4/52
if x = 10
1/52
0 if x , 0, 1, 5, 10
X 35 12 4 1 42
E[X] = xp(x) = 0 × +1× +5× + 10 × = ≈ 0.81
x
52 52 52 52 52
0.7
0.6 42
0.5 E(X) =
0.4 52
p(x)
0.3
0.2
0.1
0.0
0 1 2 3 4 5 6 7 8 9 10
x
7
Interpretation of the Expected Value
If one plays the card game 5200 times(where the card is drawn with
replacement),then in the 5200 games, he is expected to get
9
Fair Game
9
Expected Value of the Geometric Distribution
10
Expected Value of the Geometric Distribution (Cont’d)
a p p 1
2
= 2
= 2 = .
(1 − r) (1 − (1 − p)) p p
11
Expected Value of a Function of a
Random Variable
Functions of a Random Variable
• the net profit from the card game h(X) = 0.9X − 0.5
• the net profit from the card game h(X) = X − 0.02X 2 − 0.5 with
a new tax rule
13
Example 1 (Card Game w/ Tax)
14
Variance of a Random Variable
Variance of a Random Variable
SD(X) = σ =
p
Var(X)
15
Example (Card Game)
16
Example (Card Game)
Proof.
X
E[(X − µ)2 ] = (x − µ)2 p(x)
x
=
=
| {z } | {z } | {z }
= =
17
A Shortcut Formula for Calculating Variance
Proof.
X
E[(X − µ)2 ] = (x − µ)2 p(x)
Xx
= (x2 − 2µx + µ2 ) p(x)
x
=
| {z } | {z } | {z }
= =
17
A Shortcut Formula for Calculating Variance
Proof.
X
E[(X − µ)2 ] = (x − µ)2 p(x)
Xx
= (x2 − 2µx + µ2 ) p(x)
Xx X X
= x2 p(x) − 2µ x p(x) + µ2 p(x)
| x{z } | x{z } x
| {z }
= =
17
A Shortcut Formula for Calculating Variance
Proof.
X
E[(X − µ)2 ] = (x − µ)2 p(x)
Xx
= (x2 − 2µx + µ2 ) p(x)
Xx X X
= x2 p(x) − 2µ x p(x) + µ2 p(x)
| x{z } | x{z } x
| {z }
=E(X 2 )
= =
17
A Shortcut Formula for Calculating Variance
Proof.
X
E[(X − µ)2 ] = (x − µ)2 p(x)
Xx
= (x2 − 2µx + µ2 ) p(x)
Xx X X
= x2 p(x) − 2µ x p(x) + µ2 p(x)
| x{z } | x{z } x
| {z }
=E(X 2 ) =µ
= =
17
A Shortcut Formula for Calculating Variance
Proof.
X
E[(X − µ)2 ] = (x − µ)2 p(x)
Xx
= (x2 − 2µx + µ2 ) p(x)
Xx X X
= x2 p(x) − 2µ x p(x) + µ2 p(x)
| x{z } | x{z } x
| {z }
=E(X 2 ) =µ =1
= =
17
A Shortcut Formula for Calculating Variance
Proof.
X
E[(X − µ)2 ] = (x − µ)2 p(x)
Xx
= (x2 − 2µx + µ2 ) p(x)
Xx X X
= x2 p(x) − 2µ x p(x) + µ2 p(x)
| x{z } | x{z } x
| {z }
=E(X 2 ) =µ =1
= E(X 2 ) − 2µ2 + µ2 =
17
A Shortcut Formula for Calculating Variance
Proof.
X
E[(X − µ)2 ] = (x − µ)2 p(x)
Xx
= (x2 − 2µx + µ2 ) p(x)
Xx X X
= x2 p(x) − 2µ x p(x) + µ2 p(x)
| x{z } | x{z } x
| {z }
=E(X 2 ) =µ =1
17
Example (Card Game)
x 0 1 5 10
p(x) 35/52 12/52 4/52 1/52
Let’s calculate the variance again using the shortcut formula
Var(X) = E(X 2 ) − µ2 . First we calculate E[X 2 ]
35 12 4 1 212
E[X 2 ] = 02 · + 12 · + 52 · + 102 · =
52 52 52 52 52
and the variance is hence
!2
212 42 9260
Var(X) = E(X ) − µ =
2 2
− =
52 52 522
18
Linear Transformation of a
Random Variable
Linear Transformation of a Random Variable
• The net profit h(X) = X − 0.1X − 0.5 = 0.9X − 0.5 from the
Card Game w/ tax
19
Review: Summation Notation and Its Properties
20
Proof of E(aX + b) = a E(X) + b
We prove it for the case that X is discrete with pmf p(x).\ This
relation is also true when X is continuous.
E(aX + b)
X
= (ax + b)p(x) (definition of E(aX + b))
Xx
= (axp(x) + bp(x))
x
X X n n n
= axp(x) +
X X X
bp(x) (since (xi + yi ) = xi + yi )
x x
i=1 i=1 i=1
X X n n
=a xp(x) +b
X X
p(x) (since (axi ) = a xi )
| x{z } | {z x
} i=1 i=1
=E(X) =1
= aE(X) + b
21
Proof of Var(aX + b) = a2 Var(X)
22
Proof of Var(aX + b) = a2 Var(X)
22
Proof of Var(aX + b) = a2 Var(X)
22
Proof of Var(aX + b) = a2 Var(X)
22
Proof of Var(aX + b) = a2 Var(X)
∥ ∥
Var(aX + b) a2 Var(X)
For the Card Game, recall the mean and variance of the reward X
are
42 9620
E(X) = , Var(X) =
52 522
The mean and variance of the net profit with tax h(X) = 0.9X − 0.5
are
42 11.8
E(0.9X − 0.5) = 0.9 E(X) − 0.5 = 0.9 × − 0.5 =
52 52
9620 7792.2
Var(0.9X − 0.5) = 0.9 Var(X) = 0.9 ×
2 2
=
522 52
23