Download Ch 3A Discrete Random Variables

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
no text concepts found
Transcript
Chapter 3
Discrete Random Variables and Probability
Distributions
Variables that are random;
what will they think of next?
Chapter 3A
The Road Ahead
today
A Random Variable (RV)



Variable whose observed value is determined
by chance
Variable that takes on values in accordance
with some probability distribution
Discrete Random Variables


have a finite or countably infinite range
Numerical outcome from a random
experiment

A mapping from a sample space to a subset of the
real numbers
Some Discrete Random Variables






The number of nonconforming solder connections
on a printed circuit board.
In a voice communication system with 50 lines,
the number of lines in use at a particular time.
A batch of 500 machined parts contains 10 that
do not conform to customer requirements. Parts
are selected successively, without replacement,
until a nonconforming part is obtained. The RV is
the number of parts selected.
The RV is the number of demands in a month for
a product in inventory.
The RV is the number of customer arrivals per
hour at a local bank.
The number of accidents per week observed in a
factory.
The Mapping Illustrated – toss a pair of dice
Let X = a random variable, the sum resulting from
the toss of two fair dice;
X = 2, 3, …, 12
S=
(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)
The Mapping Illustrated – toss a pair of dice
X = RV, the outcome from rolling a pair of dice
number of ways
2
(1,1)
1
3
(1,2) , (2,1)
2
4
(1,3) , (2,2) , (3,1)
3
5
(1,4) , (2,3) , (3,2) , (4,1)
4
6
(1,5) , (2,4) , (3,3) , (4,2) , (5,1)
5
7
(1,6) , (2,5) , (3,4) , (4,3) , (5,2) , (6,1)
6
8
(2,6) , (3,5) , (4,4) , (5,3) , (6,2)
5
9
(3,6) , (4,5) , (5,4) , (6,3)
4
10
(4,6) , (5,5) , (6,4)
3
11
(5,6) , (6,5)
2
12
(6,6)
1
Total
36
sample space
The Mapping Illustrated – toss a pair of dice
Let X = a random variable, the sum resulting from
the toss of two fair dice;
X = 2, 3, …, 12
(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)
=S
Pr{X = x} = f(x),
f(x) is called the Probability Mass Function (PMF)
x
p(x)
f(x)
F(x)
2
1/36
1/36
3
2/36
3/36
4
3/36
6/36
5
6
7
8
9
10
11
12
4/36
5/36
6/36
5/36
4/36
3/36
2/36
1/36
10/36 15/36 21/36 26/36 30/36 33/36 35/36 36/36
Probability Histogram for the Random
Variable X
Probability Mass Function
Example #1


Let x = a discrete random variable, the number of
accidents per week in the Axe E. Dentt
manufacturing plant.
Given:
x 1
Pr(X
Pr(X
Pr(X
Pr(X
Pr(X
f ( x)  Pr{ X  x} 
=
=
=
=
=
0)
1)
2)
3)
4)
=
=
=
=
=
f(0)
f(1)
f(2)
f(3)
f(4)
=
=
=
=
=
1/15
2/15
3/15
4/15
5/15
15
; x  0,1, 2,3, 4
f ( x)  0
4
 f ( x)  1
x 0
Example #2

Let x = a discrete random variable, the number of
days to receive a package from a Website
distributor when requesting expedited delivery.
.1 if x  2days
.4 if x  3days

f ( x)  .3 if x  4days
.1 if x  5days

.1 if x  6days
Example #3

note:

Let x = a discrete random variable, the number of
units produced before a reject occurs. The
probability of a reject occurring is 1/5.
 1  4  x 1
   , x  1, 2,3...
f ( x)   5  5 
0 otherwise

 1  4 

  
x 1  5  5 
x 1

x
1  4 1 1
       
1
 5  x 0  5   5  1  4
Find:
5
Pr{X  10}
geometric series
Pr{20  X  30}
Pr{X  15}
3-3 Cumulative Distribution Function (CDF)
Definition
Sn 
Example #3 revisited
i 1
x 1
1  4
1  4
F ( x)   f (i )            
 5  i 1  5 
 5  i 0  5 
i 1
  4 x 
x
 1   
1
4
5
 
 
        1  
 5   1 4 
5


5


x
x
i
Find:
Pr{X  10} = F(10) = .892626
Pr{20  X  30} = F(30) – F(20)
= (1-.830) – (1-.820)
= .99876 - .98847 = .0103
Pr{X  15} = 1 – F(14) = 1 – (1 - .814)
= .814 = .04398
x
a 1  r

1 r
f(x)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
n
0.2
0.16
0.128
0.1024
0.08192
0.065536
0.052429
0.041943
0.033554
0.026844
0.021475
0.01718
0.013744
0.010995
0.008796
0.007037
0.005629
0.004504
0.003603
0.002882
F(x)
0.2
0.36
0.488
0.5904
0.67232
0.737856
0.790285
0.832228
0.865782
0.892626
0.914101
0.931281
0.945024
0.95602
0.964816
0.971853
0.977482
0.981986
0.985588
0.988471
Problem 3-28
Determine the cumulative distribution function
of the following R.V.’s [P(xi) = 1/6 for all xi]:
Outcome a b c
d e f
x
0 0 1.5 1.5 2 3
F(x)
1.0
0,
1/ 3,

F ( x)  2 / 3,
5 / 6,

1,
x0 
0  x  1.5

1.5  x  2 
2  x <3 

3 x

2/3
Don’t confuse
discrete with
integer!
1/3
0
1.5 2
3
Problem 3-35
Verify the following function is a CDF & determine
the PMF & requested probabilities:
0

F ( x)  .5
1





x 1
1 x  3
3 x
1
P(X < 3) =
P(1 < X < 2) = .5
P(X < 2) =
.5
P(X > 2) =
.5
PMF:
f(0) =
f(1) =
f(2) =
f(3) =
F(0)
F(1)
F(2)
F(3)
=0
– F(0) = .5
– F(1) = .5 - .5 = 0
– F(2) = 1 – .5 = .5
Example 3-8
Example 3-8
Figure 3-4 Cumulative distribution function for
Example 3-8.
A Fish Tale –
A Transition to the next concept
These probability distributions are
great. But what if my boss wants to
know how many fish I will sell today?
I need one number not a entire
distribution.
Let Z = a discrete random variable, the
number of fish sold in one day.
.1 if z  0
.3 if z  1

f ( z)  
.5 if z  2
.1 if z  3
The Mean Number of Fish
Let Z = a discrete random variable, the
number of fish sold in one day.
.1 if x  0
.3 if x  1

f ( z)  
.5 if x  2
.1 if x  3
E ( Z )    (.1)(0)  (.3)(1)  (.5)(2)  (.1)(3)  1.6
Expect to sell 1.6 fish on the average!
3-4 Mean and Variance of a Discrete
Random Variable
Definition
Mean of a discrete R.V.
The mean of a discrete R.V. uses the probability of
each discrete observation to weight that
observation:
  P( X  x1 ) x1  P( X  x2 ) x2  ....  P( X  xn ) xn
 E ( X )   x f ( x)
x
Variance of a discrete R.V.
The variance of a discrete R.V. X also uses
probability to weight each observation.
 2  P( X  x1 )( x1   )2  P( X  x2 )( x2   ) 2  ....  P( X  xn )( xn   ) 2
 V ( X )   ( x   ) 2 f ( x)
x
  x f ( x)  
2
x
  V (X )
2
We don’t do many derivations, but
it needs to be clear to you how we
get from line two to line three.
Try it!
Problem 3-40
Determine the mean and variance P(xi=1/6) for all i:
Outcome a b c
d e f
x
0 0 1.5 1.5 2 3
  E ( X )   xf ( x)
x
= 0(1/3) + 1.5(1/3) + 2(1/6) + 3(1/6) = 4/3
 2  V ( X )   x 2 f ( x)   2
x
= 02(1/3) + 1.52(1/3) + 22(1/6) + 32(1/6) – (4/3)2
= 1.139
First Two Moments do not
Determine Distribution




The mean is the first moment.
The variance is the second central moment –
second moment about the mean.
Two entirely different distributions can have
identical mean and variance.
Very often though the first two moments
give sufficient information to do effective
modeling.
Yet Another Problem
Determine the mean & variance of:
f ( x) 
2x 1
, x  0,1, 2,3, 4
25
  E ( X )   x f ( x)
x
 2*0  1   2*1  1   2* 2  1   2*3  1   2* 4  1 
  0
  1
  2
  3
  4

 25   25   25   25   25 
3 10 21 36
 0   
 2.8
25 25 25 25
 2  V ( X )   x 2 f ( x)   2
x
 1 
 3
 5 
 7 
 9 
 02    12    22    32    42    (2.8) 2  1.36
 25 
 25 
 25 
 25 
 25 
3-4 Mean and Variance of a Discrete
Random Variable
Figure 3-5 A probability distribution can be viewed as a loading
with the mean equal to the balance point. Parts (a) and (b)
illustrate equal means, but Part (a) illustrates a larger variance.
3-4 Mean and Variance of a Discrete
Random Variable
Figure 3-6 The probability distribution illustrated in Parts (a)
and (b) differ even though they have equal means and equal
variances.
Example 3-11
3-4 Mean and Variance of a Discrete
Random Variable
Expected Value of a Function of a Discrete
Random Variable
E (h( x))  h( E ( x))
Unless the function is linear
A Derivation
Y  a  bX ; E[ X ]   x
E[Y ]  E[a  bX ]    a  bx  f ( x)
x
   af ( x)  bxf ( x)   a  f ( x)  b xf ( x)
x
x
 a  bE[ X ]   y  a  b x
x
More on Expected Values



It costs Axe E. Dent $700 a week to maintain a safety
officer and another $340 for each accident that the safety
officer must process. What is the expected weekly cost?
Let x = a discrete random variable, the number of
accidents per week in the Axe E. Dentt manufacturing
plant.
Let Y = a discrete random variable, the weekly cost of
maintaining a safety officer.
x 1
; x  0,1, 2,3, 4
15
4
8
 x 1 
E[ X ]   x   
x


15
3


x 0
8
E[Y ]   y  700  340    $1, 606.67
3
f ( x)  Pr{ X  x} 
Y = 700 + 340X
E[Y] = 700 + 340 E[X]
But Look Here
b
Y  ; E[ X ]   x
X
b
b
E[Y ]  E[ ]     f ( x)
X
x  x
1
1
b
 b f ( x)  b f ( x ) 
x
x x
x x
Keep Looking…
X
1
2
3
4
5
sum
E[X] =
f(x)
0.25
0.2
0.15
0.1
0.3
1
3
1/X
1
0.5
0.333
0.25
0.2
A most
important
lesson has
been learned
here today.
0.485 = E[1/X]
1
1
  .485  E  
x 3
X 
1
.25(1) + .2 (.5) + .15 (.333) + .1 (.25) + .3 (.2) = .485
What about the Variance?
Y  a  bX where Var[ X ]   x2
Var[Y ]   y2  Var[a  bX ]
2

 E Y   y  


2

 E  a  bX  a  b x  


2
2
 E  bX  b x    E b 2  X   x  




2
2

 b E  x   x    b 2 x2


Yet another insight…

Analogous to the mean’s being the center
of gravity of a distribution of mass, the
variance represents, in terminology of
mechanics, the moment of inertia.
The moment of inertia of an
object about a given axis
describes how difficult
it is to change its angular
motion about that axis.
Bonus Topic


Let X = a random variable, the number of points
scored with first down and ten yards to go, at
discrete points on the playing field.
Number of outcomes is 103





touchdown +7
field goal + 3
safety -2
opponent’s touchdown -7
turning the ball over to the opponent at any of 99
possible points on the field
More of that bonus

Based upon a study of 2,852 first-and-ten plays by
Virgil Carter and Robert Machol:
Field
Position
95
85
75
65
55
45
35
25
15
5
Expected
point
value
-1.245
-0.637
0.236
0.923
1.538
2.392
3.167
3.681
4.572
6.041
Next Class

Theoretical Discrete Distributions





Uniform
Binomial
Geometric
Poisson
and so much more…
ENM 500 students
hurrying to class.
Related documents