STAT 113 - Purdue University

Download Report

Transcript STAT 113 - Purdue University

Chapter 5.1 & 5.2:
Random Variables and Probability Mass Functions
Chris Morgan, MATH G160
[email protected]
February 1, 2012
Lecture 10
1
2
Random Variables
-A random variable (RV) is a real valued function whose domain is a
sample space.
- We will usually denote random variables by X, Y, Z and their
respective values by x, y, z
3
Random Variables
Discrete Random Variables
Continuous Random Variables
•Random variables that take on a
finite (or countable) number of
values.
•Random variables that take on values
in a continuum or infinitely many
values.
–Sum of two dice (2,3,4,…,12)
–Number of children (0,1,2,…)
–Number in attendance at the
movies
–Number of hired employees
- Number of students coming to
class
–Height
–Weight
–Time
- Time you can hold your breath
- Lifetime of your cell phone batter
4
Random Variables
Toss a fair coin 4 times. Suppose we are interested in the random
variable X = number of heads.
Outcome
T T T T
Combination
4C0
X
0
P(x)
1/16
1
4/16
T T T H
4C1
T H H T
4C2
2
6/16
T H H H
4C3
3
4/16
H H H H
4C4
4
1/16
5
Probability Mass Function (PMF)
The values on the right of the table above are called the Probability
Mass Function of the random variable X :
p( x)  P( X  x)
The probability of x = the probability(X = one specific x)
A probability mass function (p.m.f) is a function which describes the
probabilities a discrete type random variable will take on for any
given value. They can be used to calculate the probabilities
corresponding to an event relating to a random variable.
6
Probability Mass Function (PMF)
We can take the PMF, graph it, and display it in the form of a
histogram.
7
6
5
4
3
2
1
0
1
2
3
4
5
7
Probability Mass Function (PMF)
x
f(x)
2
1/36
3
2/36
4
3/36
5
4/36
6
5/36
7
6/36
8
5/36
9
4/36
10
3/36
11
2/36
12
1/36
P(X < 4) =
P(3 < x < 8) =
P(3 ≤ x ≤ 8) =
8
Probability Mass Function (PMF)
x
f(x)
2
1/36
3
2/36
4
3/36
5
4/36
6
5/36
7
6/36
8
5/36
9
4/36
10
3/36
11
2/36
12
1/36
P(x < 8 | x < 10) =
P(x > 3) =
P(4 < x < 7 | x < 9) =
9
Basic Properties of a PMF
1.
p( x)  0x  R
(PMFs are nonnegative)
2. There are only finitely (or countably infinitely many) x’s for which:
p( x)  0
3.
 p(x)  1
10
Fundamental Probability Formula
How do you compute probabilities for a random variable X?
Welll….. We have the PMF that tell us the probability that the
random variable X takes on the specific value x. Sometimes,
you may be interested in a whole range of possible values of X.
For instance, the Pr(1 ≤ x≤ 3)
11
Example
I toss a fair coin 4 times. What the probability of getting at most
two most?
P(x ≤ 2) = ?
1
4
6
11



16 16 16 16
P(x ≥ 1) = 1 – P(x=0) = 1 - 1/16 = 15/16
X
0
P(x)
1/16
1
4/16
2
6/16
3
4/16
4
1/16
12
Example
I can also write this PMF as a function rather than a chart:
1
16

4
16

 6
f p ( x)  16
4

16
1

16
0
For x = 0
For x = 1
For x = 2
X
0
P(x)
1/16
1
4/16
2
6/16
3
4/16
4
1/16
For x = 3
For x =
otherwise
13
Fundamental Probability Formula
Suppose X is a discrete RV and that A is a set of real numbers. Then:
P( X  A)   p( x)
xA
In words: the sum of the probability mass function over all possible
value you are interested in
E( X )   x * P( X  x)
xA
14
Practice Problem #1
A partially eaten bag of M&M’s contains 2 red, 5 blue,
and 3 green M&M’s. You and your buddy decide to
place a bet.
You will choose two M&M’s at random without
replacement. For every red M&M you win $5, for
every green M&M you win $1 and you do not win
anything for a blue M&M.
Let X be the amount of money you will win.
15
Practice Problem #1
[2 red, 5 blue, and 3 green M&M’s….pick two]
Let X be the amount of money you will win. Begin by
writing down the PMF:
Colors
X
p(x)
R and R
10
1/45
R and G
6
2*3 = 6/45
R and B
5
2*5 = 10/46
B and G
1
5*3 = 15/45
B and B
0
5C2 = 10/45
G and G
2
3C2 = 3/45
16
Practice Problem #1
What is the probability you will win at least five
dollars?
P(X ≥ 5) = 1/45 + 6/45 + 10/45 = 17/45
Colors
X
p(x)
R and R
10
1/45
R and G
6
2*3 = 6/45
R and B
5
2*5 = 10/46
G and G
2
3C2 = 3/45
B and G
1
5*3 = 15/45
B and B
0
5C2 = 10/45
17
Practice Problem #1
If you win something, what is the probability it will be
worth at least five dollars??
P(X ≥ 5 | X ≠ 0) =
1
6 10 17
 
P( X  5andx  0) 45 45 45 45 17



10
35 35
P( x  0)
1
45
45
18
Practice Problem #1b
X
p(x)
10
1/45
6
6/45
5
10/46
1
15/45
0
10/45
2
3/45
E(X)=
E(X)2=
E(X2)=
19
Practice Problem #2a
In a simple game, two fair coins are tossed and the
payoff is to be determined from the outcome. The
payoff strategy is as follows:
Win $5 for each head, lose $10 for two tails.
Let X denote your winnings if you play this game once.
20
Practice Problem #2a
Win $5 for each head, lose $10 for two tails.
Write out the PMF for x:
2 heads
1 tail, 1 head
2 tails
X
10
5
-10
p(x)
1/4
1/2
¼
E(X) = 10(1/4) + 5(1/2) – 10(1/4) = 2.5
21
Practice Problem #2b
In a simple game, two fair coins are tossed and the
payoff is to be determined from the outcome. The
payoff strategy is as follows:
Lose $5 for two tails
Win $5 for two different
Lose $10 for two heads
Let X denote your winnings if you play this game once.
22
Practice Problem #2b
Calculate the PMF for this payoff strategy:
Calculate the expected payoff 
E(X) =
Which payoff would you
rather play with, a or b, and why??
23