Download Discrete Random Vars.

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Statistics wikipedia , lookup

Randomness wikipedia , lookup

Probability interpretations wikipedia , lookup

Probability wikipedia , lookup

Transcript
Dr. Neal, WKU
MATH 382
Discrete Random Variables
Throughout, let Ω be a sample space with a defined probability measure P .
Definition. A random variable is a real-valued function X defined on a sample space Ω .
This function X is called a discrete random variable if it has a countable range (either
finite or denumerable.)
Example 1. Roll two dice. Let X be the sum. Here Ω = {( ω1 , ω 2 ) : ω i ∈{1, 2, . . ., 6}} .
Then X : Ω → ℜ is defined by X (( ω1 , ω 2 )) = ω1 + ω 2 and X has range {2, 3, 4, . . . , 12}.
So X is a discrete random variable.
Note: The set {2, 3, 4, . . . , 12} is not the sample space. The sample space Ω consists of
the 36 possible outcomes when rolling two dice. Then X is defined on Ω , so Ω is the
domain of X and {2, 3, 4, . . . , 12} is the range of X .
Example 2. Flip a coin 10 times and let X count the number of “Heads” that occur.
Then Range X = {0, 1, 2, . . . , 10} because there could be anywhere from 0 to 10 Heads.
Here the sample space is Ω = {( ω1 , . . ., ω10 ) : ω i ∈{H ,T}} .
Example 3. Play the lottery until you win. Let X count the number of plays needed.
Then X is a discrete random variable with countably infinite range {1, 2, 3, 4, . . . }.
Example 4. Pick a real number at random from 0 to 4 and let X be the value chosen.
Then Range X = [0, 4] which is an uncountable interval. So X is not discrete (it is called
a continuous random variable).
Probability Distribution Function (pdf)
Definition. Let X : Ω → Range X be a discrete random variable. (i) The probability
distribution function (pdf) of X is the function f : Range X → [0, 1] defined by
€
f (k ) = P(X = k ) .
(ii) The mode of X is the value k in Range X for which f (k ) is maximized.
Notes: (i) Technically, we only define f for values in the range of X . But we implicitly
€ values by€letting f ( x) = 0 for x ∉ Range X .
can extend f to all real
(ii) The pdf of a discrete random variable is alternately called the pmf, which stands for
probability mass function.
Dr. Neal, WKU
Example 5. Roll two dice as in Example 1 and let X be the sum. (a) Give the pdf of X .
(b) What are the probabilities of rolling
(i) a “7 or 11”
(ii) an even sum
(iii) doubles
(iv) a sum of at least six?
Solution. There are 36 possible pairs. These outcomes are listed below.
(1, 1)
(1, 2)
(1, 3)
(1, 4)
(1, 5)
(1, 6)
(2, 1)
(2, 2)
(2, 3)
(2, 4)
(2, 5)
(2, 6)
(3, 1)
(3, 2)
(3, 3)
(3, 4)
(3, 5)
(3, 6)
(4, 1)
(4, 2)
(4, 3)
(4, 4)
(4, 5)
(4, 6)
(5, 1)
(5, 2)
(5, 3)
(5, 4)
(5, 5)
(5, 6)
(6, 1)
(6, 2)
(6, 3)
(6, 4)
(6, 5)
(6, 6)
We then add the two dice together to obtain the resulting sum. The possible sums
are 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12. Although each individual paired outcome is equally
likely to occur with probability 1/36, the sums are not equally likely. The sum of 2 can
only occur one way; so its probability is 1/36. But the sum of 7 can occur six ways; so
its probability is 6/36 = 1/6. Below is a chart showing all the various probabilities.
Notice the symmetry as the values increase from 1/36 to 6/36 then back down to 1/36.
Sum
Prob
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
This chart defines the pdf of X . For instance, P(X = 3) = 2 / 36 . This pdf can be
written in closed-form as
f (k ) = P(X = k ) =
6− k−7
, for k = 2, 3, . . . , 12.
36
(b) (i) There are six ways to roll a 7 and two€ways to roll an 11, so the probability of a “7
or 11” is P(X = 7 or 11) = (6 + 2)/36 = 8/36 = 2/9.
(ii) We want to roll a 2, 4, 6, 8, 10, or 12, which can occur 1 + 3 + 5 + 5 + 3 + 1 = 18 ways.
So the probability of an even sum is 18/36 = 1/2.
(iii) There are six pairs that are “doubles” so the probability of this event is 6/36 = 1/6.
(iv) Finally, we have P(X ≥ 6) = 1 − P(X ≤ 5) = 1 −
1 + 2 + 3 + 4 26 13
=
= .
36
36 18
Note also that the mode is 7 because this sum is the value in the range that is most
likely to occur. That is, f (7) = P( X = 7) = 6 / 36 = 1 / 6 gives the maximum pdf value.
Dr. Neal, WKU
Example 6. Roll a single six-sided die. If you roll a 1, then you get $5. If you roll a 2 or
3, then you get $10. But if you roll a 4, 5, or 6, then you lose $20. Let X denote your
change in fortune. Give the pdf of X .
Solution. The range of X is {5, 10, –20}. The pdf of X is given by
f (5) = P( X = 5) =
1
6
f (10) = P(X = 10) =
2
6
f (−20) = P( X = −20) =
3
.
6
(Here, –20 is the mode of X .)
Example 7. Roll a fair six-sided die 8 times and let X count the number of “threes” that
are rolled. Determine the pdf of X .
Solution. The range of X is {0, 1, 2, 3, 4, 5, 6, 7, 8} which are the possible number of
“threes” that can be rolled in 8 rolls. Let p = 1/6 be the probability of a “three” and let
q = 1 − p = 5/6 be the probability of a ”non-three.” Then
 8   1  k  5  8−k
,
f (k) = P(X = k) =      
k 6
6
for k ∈ {0, 1, . . ., 8}.
Example 8. Draw a single card from a deck. Let X be the card value where Ace = 11.
Give the pdf of X .
Solution. The range of X is {2, 3, . . . , 10, 11}. Each value, other than 10, occurs 4 ways
while the 10 occurs 16 ways (10, J, Q, K in each suit). Thus,
f (k) = P(X = k) =
4
1
16 4
= , for {2, 3, . . . , 9, 11} , and f (10) = P(X = 10) =
= .
52 13
52 13
Cumulative Distribution Function (cdf)
Definition. Let X : Ω → Range X be a random variable. The cumulative distribution
function (cdf) of X is the function F : ℜ → [0, 1] defined by F(x ) = P(X ≤ x ) .
Note: For a discrete random variable X , we generally only define the pdf for values k
in the range of X . On the other hand, we always define the cdf for all real values x .
For a discrete random variable, the cdf is then an increasing piecewise defined step
function.
€
€
Dr. Neal, WKU
Example 9. Roll a single six-sided die. If you roll a 1, then you get $5. If you roll a 2 or
3, then you get $10. But if you roll a 4, 5, or 6, then you lose $20. Let X denote your
change in fortune. Give the cdf of X .
Solution. To define a cdf, it is important to write the range of X in increasing order. So
in this case, w write Range X = (–20, 5, 10}. The pdf of X was given by
f (−20) = P( X = −20) =
€
3
6
f (5) = P( X = 5) =
1
6
f (10) = P(X = 10) =
2
.
6
There is no probability accumulated until x reaches –20. At x = −20 , the
accumulated probability becomes 3/6 and stays that way until x reaches 5. At x = 5 ,
the cumulative probability becomes 4/6 and stays that way until x reaches 10. At
x = 10 and beyond, the cumulative probability is 1. Thus, the cdf of X is
€
€
€
€
 0
if x < −20
€

 3 / 6 if − 20 ≤ x < 5
F(x ) = P(X ≤ x ) = 
 4 / 6 if 5 ≤ x < 10

 1
if x ≥ 10
Exercises
1. Roll two fair six-sided dice and let ( ω1 , ω 2 ) denote the resulting pair. Define a
random variable X by X (( ω1 , ω 2 )) = ω1 − ω 2 .
(a) Give the range of X .
(b) Give the pdf and mode of X .
(c) Give the cdf of X and graph this function.
2. The Fibonacci sequence {Fn } is defined by
F1 = 1, F2 = 1 , and Fn = Fn−1 + Fn−2 for n ≥ 3.
(a) List the first six Fibonacci numbers and then give their sum S .
€
(b) A biased six-sided die is such that the probability of rolling the value i is Fi / S for
i = 1, 2, . . ., 6 . Roll this die and let X be the value. Give the pdf and cdf of X .
€
€