Probability Lecture 9
Probability Lecture 9
Variables
Dr. Sadiq Ali
Lecture Outline
• Expected Value
• Practice Example - Random Variable
• Variance of a Random Variable
Expected Value
Graph of pmf (Previous Week)
Example: Draw the pmf of the random variable X,
where X is defined as the number of heads in 3 tosses.
Probabilities pX x versus X
PX x
pmf of X
𝟑
𝟖
𝟏
𝟖
0 1 2 3 𝑥
Center of Probability Mass
• The pmf is centered at 𝐗 = 𝟏. 𝟓 , with equal
probability mass on both sides.
𝑃𝑋 𝑥
pmf of X
𝟑
𝟖
𝟏
𝟖
0 1 2 3 𝑥
Expected Value of X
• The center of probability mass in a PMF graph is the
expected value of X,
EX = x k pX x k
all k
mX = E X = x k pX x k
all k
• You can think of the expected value (or the mean) as the
average value that the random variable can take.
Expected Value of X
mX = E X = x k pX x k
all k
Expected Value of X
EX = x k pX x k
all k
= 0 × pX 0 + 1 × pX 1 + 2 × pX 2 + 3 × pX 3
E X = 0 × 18 + 1 × 38 + 2 × 38 + 3 × 18
E X = 38 + 68 + 38 = 1.5
Properties of E[X]
• If α and β are constants,
– E[αX] = αE[X]
E Y = ypy Y
Expected Value of the Function of a
random variable
X 2 if X = 2 or X = 3
Y=ቊ
𝑆 0 otherwise
3
9
HHH HHT HTH THH 2
4
1 0
THT TTH HTT TTT
0 𝑌 𝑆𝑌
𝑋
𝑆𝑋
E[Y] = (0 × 4 / 8) + (4 × 3 / 8) + (9 × 1 / 8)
= 21 / 8
Expected Value of the Function of a
random variable
Method 2:
We find E[Y] using the probabilities of the random
variable X.
E Y = Y x j pX x j
all j
Since both Ibrahim and Ismail use a fair coin for their
respective 2 tosses, all 16 outcomes are equally likely with
probability 1/16.
1
P HH, HH = P HH, HT =, … , P TT, TT = 16
Example 1(a) Solution
Ibrahim
Ismail
SX = {0, 1, 2} = Range of X
Example 1(c)
• Let X be the maximum of the number of heads
obtained when Ibrahim and Ismail both flip a fair
coin twice.
c) Find the probabilities for the various values of X.
Example 1 (c) Solution
Example 1(c) Solution
1 1 1 1 1 1 1
P[X = 1] = × + × + × =
4 2 2 4 2 2 2
Example 1(c) Solution
1 1 1 1 1 7
P[X = 2] = × + × + ×1 = .
4 4 2 4 4 16
Example 1(d)
• Let X be the maximum of the number of heads
obtained when Ibrahim and Ismail both flip a fair
coin twice.
e) Find E[X].
Example 1(e) Solution
1 1 7 22
E X = xpX x = 0 × + 1× + 2× =
16 2 16 16
Variance of a Random
Variable
Deviation of a Random Variable
VAR X = E X 2 − m2X
E X2 = E Z X = Z x j pX x j
all j
E X2 = E Z X
= Z x j pX x j
all j
Example 1(f) Solution
1 1 7 9
E X2 = 02 × + 12 × 2
+ 2 × =
16 2 16 4
VAR X = E X 2 − E X 2
• If c is a constant,
a) VAR[X + c] = VAR[X]
b) VAR[cX] = c2VAR[X]
Standard Deviation
σX = STD X = VAR X