Lecture 6-7 Random Variable
Lecture 6-7 Random Variable
X 2 3 4 5 6 7 8 9 10 11 12
P(X) 1/36 2/36 3/36 4/36 5/36 6/36 5/36 4/36 3/36 2/36 1/36
.50
.40
.30
p(x)
.20
.10
0 1 2 3 4
Grade 3 2 3 1 2 3 1 3 2 2
Grade
Example
• Random Variable: Grades of the students
Student ID 1 2 3 4 5 6 7 8 9 10
Grade 3 2 3 1 2 3 1 3 2 2
CDF
Probability Mass Function
Grade
Example
• Toss a fair coin three times and
define X = number of heads.
x X p(x)
P(X = 0) = 1/8
HHH 1/8 3 P(X = 1) = 3/8 0 1/8
HHT 1/8 2 P(X = 2) = 3/8 1 3/8
HTH 1/8 2 P(X = 3) = 1/8 2 3/8
1/8 2 3 1/8
THH
HTT 1/8 1
1/8 1
THT Probability
1/8 1 Histogram for x
TTH
1/8 0
TTT
Expected Value and Variance
• The expected value, or mean, of a random variable
is a measure of its central location.
– Expected value of a discrete random variable:
▪ standard deviation is
Example
• Toss a fair coin 3 times and
record x the number of heads.
X p(x) xp(x)
(x-μ)2p(x)
0 1/8 0 (-1.5)2(1/8)
1 3/8 3/8 (-0.5)2(3/8)
2 3/8 6/8 (0.5)2(3/8)
3 1/8 3/8 (1.5)2(1/8)
Alternative Solution (Suggested): √
x p(x) x.p(x) x2p(x)
0 1/8 0 0
1 3/8 3/8 3/8
2 3/8 3/4 3/2
3 1/8 3/8 9/8
Notes about Continuous RV
• A continuous random variable can assume any
value in an interval on the real line or in a collection
of intervals.
– That is, as with all continuous pdfs, the total area under
the curve is 1. We might use this random variable to
model the position at which a two-meter with length of
rope breaks when put under pressure, assuming “every
point is equally likely”. Then the probability the break
occurs in the last half-meter of the rope is
Example
– Let Y be a random variable whose range is the
nonnegative and whose pdf is defined by
CDF
Expected Value and Variance