Lecture 2
Lecture 2
Distributions
Random Variable
• A random variable x takes on a defined set of
values with different probabilities.
• For example, if you roll a die, the outcome is random (not
fixed) and there are 6 possible outcomes, each of which
occur with probability one-sixth.
• For example, if you poll people about their voting
preferences, the percentage of the sample that responds
“Yes on Proposition 100” is a also a random variable (the
percentage will be slightly differently every time you poll).
p(x)
1/6
x
1 2 3 4 5 6
P(x) 1
all x
Probability mass function
(pmf)
x p(x)
1 p(x=1)=1
/6
2 p(x=2)=1
/6
3 p(x=3)=1
/6
4 p(x=4)=1
/6
5 p(x=5)=1
/6
6 p(x=6)=1
/6
1.0
Cumulative distribution
function (CDF)
1.0 P(x)
5/6
2/3
1/2
1/3
1/6
1 2 3 4 5 6 x
Cumulative distribution
function
x P(x≤A)
1 P(x≤1)=1/6
2 P(x≤2)=2/6
3 P(x≤3)=3/6
4 P(x≤4)=4/6
5 P(x≤5)=5/6
6 P(x≤6)=6/6
Practice Problem:
The number of patients seen in the ER in any given hour
is a random variable represented by x. The probability
distribution for x is:
x 10 11 12 13 14
P(x .4 .2 .2 .1 .1
)
Find the probability that in a given hour:
a. exactly 14 patients arrive p(x=14)= .1
b. At least 12 patients arrive p(x12)= (.2 + .1 +.1) = .4
c. At most 11 patients arrive p(x≤11)= (.4 +.2) = .6
Review Question 1
If you toss a die, what’s the probability that you
roll a 3 or less?
a. 1/6
b. 1/3
c. 1/2
d. 5/6
e. 1.0
Review Question 1
If you toss a die, what’s the probability that you
roll a 3 or less?
a. 1/6
b. 1/3
c. 1/2
d. 5/6
e. 1.0
Review Question 2
Two dice are rolled and the sum of the face
values is six? What is the probability that at
least one of the dice came up a 3?
a. 1/5
b. 2/3
c. 1/2
d. 5/6
e. 1.0
Review Question 2
Two dice are rolled and the sum of the face
values is six. What is the probability that at least
one of the dice came up a 3?
e
x x
e 0 1 1
0
0
Continuous case:
“probability density
function” (pdf)
p(x)=e-x
x
1 2
2 2
x x
P(1 x 2) e e e 2 e 1 .135 .368 .23
1
1
Expected Value and Variance
E( X ) x p(x )
all x
i i
Continuous case:
E( X ) xi p(xi )dx
all x
Symbol Interlude
E(X) = µ
these symbols are used
interchangeably
Example: expected value
x 10 11 12 13 14
P(x .4 .2 .2 .1 .1
)
x i n
1
X i 1
n
i 1
xi ( )
n
Var ( X ) (x
all x
i
2
) p(xi )
Continuous case?:
2
Var ( X ) ( xi ) p(xi )dx
all x
Symbol Interlude
Var(X)= 2
SD(X) =
these symbols are used
interchangeably
Similarity to empirical
variance
( xi x ) 2 N
1
i 1
n 1
( xi x ) (
i 1
2
n 1
)
( xi ) p(xi )
2 2
all x
2 ( xi ) 2 p(xi )
all x
all x
(1 .053) 2 (18 / 38) ( 1 .053) 2 (20 / 38)
(1.053) 2 (18 / 38) ( 1 .053) 2 (20 / 38)
(1.053) 2 (18 / 38) ( .947) 2 (20 / 38)
.997
.997 .99
Standard deviation is $.99. Interpretation: On average,
you’re either 1 dollar above or 1 dollar below the mean,
which is just under zero. Makes sense!