Math Lec2 1900
Math Lec2 1900
LECTURE 2
1
RECAP
1. PROBABILITY
2. Conditional PROB.
3. R.V.
4. PMF PDF CDF E[X]
5. Variance
6. TYPES OF Discrete and Continuous RV
7. PRACTICE
2
Random Variable
3
Random variables can be discrete or
continuous
• Discrete random variables have a countable number of outcomes
• Examples: Dead/alive, treatment/placebo, dice, counts, etc.
• Continuous random variables have an infinite continuum of possible
values.
• Examples: blood pressure, weight, the speed of a car, the real numbers from
1 to 6.
4
Probability functions
5
Discrete example: roll of a die
p(x)
1/6
x
1 2 3 4 5 6
P(x) 1
all x
6
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
7
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
8
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
9
PMF
10
Rolling 2 Dice – Probability Mass Function
11
Examples
12
Practice Problem:
x 10 11 12 13 14
P(x) .4 .2 .2 .1 .1
14
Continuous case
15
Continuous case: “probability density
function” (pdf)
p(x)=e-x
p(x)=e-x
x
1 2
2 2
x
1
1 x
0
0
1 0 1
18
Example: Uniform distribution
p(x)
¼ ½ x
1
P(½ x ¼ )= ¼ 19
Practice Problem
4. Survival drops off rapidly in the year following diagnosis of a certain type
of advanced cancer. Suppose that the length of survival (or time-to-death) is
a random variable that approximately follows an exponential distribution with
parameter 2:
2 x 2 x
[note : 2e e 0 1 1]
0
0
The probability of dying within 1 year can be calculated using the cumulative
distribution function:
1 (1 e 2(1) ) .135
21
Expected Value and Variance
22
For example, bell-curve (normal) distribution:
One standard
deviation from the
Mean ()
mean ()
23
Expected value, or mean
24
Example: expected value
x 10 11 12 13 14
P(x) .4 .2 .2 .1 .1
25
Expected value, formally
Discrete case:
E( X ) x p(x )
all x
i i
Continuous case:
E( X )
all x
xi p(xi )dx
26
Extension to continuous case:
uniform distribution
p(x)
x
1
1
x2 1
1 1
E ( X ) x (1) dx
0
2 0
2
0
2
27
Symbol Interlude
• E(X) = µ
• these symbols are used interchangeably
28
Expected Value
29
Example: the lottery
30
Lottery
1 1 1 “49 choose 6”
7.2 x 10 -8
49 49! 13,983,816
Out of 49 numbers,
6 43!6!
this is the number
of distinct
combinations of 6.
The probability function (note, sums to 1.0):
x$ p(x)
-1 .999999928
Expected Value
E(X) = P(win)*$2,000,000 + P(lose)*-$1.00
= 2.0 x 106 * 7.2 x 10-8+ .999999928 (-1) = .144 - .999999928 = -$.86
If you play the lottery every week for 10 years, what are your
expected winnings or losses?
33
Practice Problem
34
Answer
10 10
1 1 10(10 1)
E ( x) i( )
i 1 10 10
i
i (.1)
2
55(.1) 5.5
35
Law of Large numbers
36
Law of Large numbers
37
Law of Large numbers
38
Expected value isn’t everything though…
39
Expected value isn’t everything though…
40
Deal or No Deal…
x$ p(x)
+1 .50
+$400,000 .50
x$ p(x)
+$200,000 1.0 41
Expected value doesn’t help…
x$ p(x)
+1 .50
+$400,000 .50
E(X ) x
all x
i p(x i ) 1(. 50 ) 400 ,000 (. 50 ) 200 ,000
x$ p(x)
+$200,000 1.0
E ( X ) 200,000 42
Practice Problem
43
Practice Problem
44
Practice Problem
Two cards are chosen randomly from a standard deck of fifty two
cards. Suppose that we win $2 for each spade selected and we lose
$1 for each heart or diamond selected, we neither win nor lose if we
pick a club.
Let X denote our winnings.
What are the possible values of X, and what is the probability mass
function of X?
45
Practice Problem
• If you pick 2 cards that are either hearts or diamonds, you “win” X =
−2 dollars.
46
Practice Problem
47
Practice Problem
n = 12, p = .20
A. p(0) = .0687
B. p(2) = .2835
C. p(at most 2) = p(0) + p(1) + p(2)
= .0687 + .2062 + .2835
= .5584
D. p(at least 2) = p(2) + p(3)...+ p(12)
= 1 – [p(0) + p(1)]
= 1 – .0687 – .2062
= .7251
48
Practice Problem
•
Light bulb life has a normal distribution with = 2000 hours and =
200 hours. What’s the probability that a bulb will last
49
Poisson Probability Distribution
Function
x –
e
p (x ) (x = 0, 1, 2, 3, . . .)
x!
p(x) = Probability of x given
= Mean (expected) number of events in unit
e = 2.71828 . . . (base of natural logarithm)
x = Number of events per unit
© 2011 Pearson Education, Inc
Poisson Probability Distribution
Function
Customers arrive at a rate of 72 per hour.
What is the probability of 4 customers arriving in 3
minutes?