Beruflich Dokumente
Kultur Dokumente
3 Variables and
Probability Distributions
3.1 Random Variables
Random Variables
Definition
3
Random Variables
Random variables are denoted by X, Y, etc.
4
Example 3.1
Calling help desk for computer support will have two
possible outcomes: (i) Get someone (S, for success); and
(ii) put on hold (F, for failure).
5
Random Variables
Definition
Example
7
Example 3.3 contd
8
Example 3.3 contd
S = {(0, 0), (0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6)
(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6),
(2, 0), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6),
(3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6),
(4, 0), (4, 1), (4, 2), (4, 3), (4, 4), (4, 5), (4, 6),
(5, 0), (5, 1), (5, 2), (5, 3), (5, 4), (5, 5), (5, 6),
(6, 0), (6, 1), (6, 2), (6, 3), (6, 4), (6, 5), (6, 6)}
10
Two Types of Random Variables
Definitions
A discrete random variable: One whose range is a finite
set or countable infinite set of numbers.
But 00000 is not a valid zip code, & there are no zip codes
with 4 zeros.
Value range of X is {2, 3, 4, 5}.
Random Variables
Bernoulli Random Variables
Discrete Random Variables
Continuous Random Variables
16
Probability Distributions
3.2 for Discrete Random Variables
17
Probability Distributions for Discrete Random Variables
18
Probability Distributions for Discrete Random Variables
19
Example 3.7
The Statistics Dept. at Cal Poly has a lab with 6 computers.
P(X 2) = P(X = 0 or X = 1 or X = 2)
= 0.30
21
Example 3.7 contd
Then B = A'.
P(X 3) = 1 P(X 2)
= 1 0.30
= 0.70
22
Example 3.7 contd
P(2 X 5) = P(X = 2, X = 3, X = 4, or X = 5)
= 0.15 + 0.25 + 0.20 + 0.15
= 0.75
23
Probability Distributions for Discrete Random Variables
Definition
24
Example 3.8
lot 1 2 3 4 5 6
# defects 0 2 0 1 2 0
25
A Parameter of a Probability Distribution
The pmf p of the Bernoulli rv X:
(3.1)
26
Example 3.12
Observe the gender of the next newborn at a certain hospital,
and the observation stops when a boy (B) is born. Let B be
event a girl is borm.
p(2) = P(X = 2)
= P(GB)
= P(G) P(B)
= (1 p)p
and
p(3) = P(X = 3)
= P(GGB)
= P(G) P(G) P(B)
= (1 p)2p
28
Example 3.12 contd
The pmf p is
(3.2)
P(X is at most 1)
30
The Cumulative Distribution Function
Similarly,
31
The Cumulative Distribution Function
The largest possible X value is 2,
and so on.
32
The Cumulative Distribution Function
Definition
33
Example 3.13
A store has flash drives of 1, 2, 4, 8, or 16 GB of memory.
34
Example 3.13 contd
F(1) = P(Y 1)
= P(Y = 1)
= p(1)
= 0.05
F(2) = P(Y 2)
= P(Y = 1 or Y = 2)
= p(1) + p(2)
= 0.15
35
Example 3.13 contd
F(4) = P(Y 4)
= P(Y = 1 or Y = 2 or Y = 4)
= p(1) + p(2) + p(4)
= 0.50
F(8) = P(Y 8)
= p(1) + p(2) + p(4) + p(8)
= 0.90
For example,
The cdf is
38
Example 3.13 contd
39
The Cumulative Distribution Function
cdf F(x) of a discrete rv X is a step function, and the step
size at each possible value x of X is equal to p(x).
Proposition
For any a and b with a b,
P(a X b)
= P(X b) P(X < a)
= F(b) F(a)
P(a X b) = P(X = a or X = a + 1 or . . . or X = b)
Taking a = b yields
P(X = a) = F(a) F (a 1)
in this case.
41
Example 3.15
X = # of days of sick leave taken by a randomly selected
employee of a large company per year.
42
Example 3.15 contd
P(2 X 5) = P(X = 2, 3, 4, or 5)
= F(5) F(1)
= 0.22
and
= 0.05
43
Exercise Problem 12
55 tickets sold for a 50 seat flight.
Y = # of ticketed passengers actually showed up.
y 45 46 47 48 49 50 51 52 53 54 55
p(y) .05 .10 .12 .14 .25 .17 .06 .05 .03 .02 .01
45
Exercise Problem 12
c. P(1sf standby person can take the flight)
= P(Y49)
= 0.66
46
Exercise Problem 23
The cdf of rv X is given.
a. p(2) = P(X=2)
= F(2) F(1)
= 0.39 0.19
= 0.20
47
Exercise Problem 23
c. P(2 X 5) = P(X5) P(X1)
= F(5) F(1)
= 0.92 0.19
= 0.73
48
Section Summary
Concepts discussed
49
3.3 Expected Values
50
The Expected Value of X
Definition
51
Example 3.16
A university has 15,000 students.
X = # of courses a student is registered. The pmf of X
follows.
= 4.57 52
The Expected Value of a Function
Given a function h(X) of rv X, determine E[h(X)].
Proposition
53
Example 3.23
A store has purchased 3 computers at $500 apiece, and
will sell them for $1000 apiece.
Suppose that
In Example 23,
= 800(2) 900
= $700.
56
The Variance of X
Definition
Let X have pmf p(x) and expected value . Then the
variance of X, denoted by V(X) or 2X or just 2, is
57
Example 3.24
A library has an upper limit of 6 on # of videos that can be
checked out by an individual.
58
Example 3.24 contd
= 3.2275
59
A Shortcut Formula for 2
Proposition
60
Rules of Variance
The variance of h(X) is the expected value of the squared
difference between h(X) and its expected value:
V(aX+b) = a2V(X)
61
Example 3.26
In Example 23, E(X) = 2, and
V(X) = 5 (2)2 = 1.
f(x) = c(1/2)x, x = 1, 2, 3.
b. Find E(X).
c. Find V(X).
63
Another Example contd
= 11/7
c. V(X)
= 26/49
. 64
Section Summary
Concepts discussed
Expected Value of a rv
Expected Value of Function of a rv
Expected Value of a Linear Function of a rv
Variance of a rv
Variance of Function of a rv
Variance of a Linear Function of a rv
65
The Binomial Probability
3.4 Distribution
67
The Binomial Probability Distribution
Definition
68
Example 3.27
A quarter is tossed successively & independently n times.
P(F) = 1 p = 0.5.
69
Another Example
A die is tossed n times.
P(F) = 1 p = 1/3.
70
The Binomial Random Variable and Distribution
Definition
Consider n = 3.
73
The Binomial Random Variable and Distribution
74
Example 3.31
Randomly select 6 cola drinkers. Each is given a glass of
cola S and a glass of cola F. Glasses are all identical except
for a code on the bottom to identify the cola.
75
Example 3.31 contd
= (0.5)x(10.5)6 x
= 0.656
and the probability that at most one prefers S is
= 0.109 76
Using Binomial Tables (Table A.1)
Consider n = 20, and p = 0.25.
77
The Mean and Variance of X
If X ~ Bin(n, p), then
sd X = ,
where q = 1 p.
78
Example 3.34
75% purchases at a store are made with a credit card. 10
purchases are observed, and let X = # of purchases made
with a credit card. Then
X ~ Bin(10, .75).
a. P(X 6) = 1 P(X 5)
= 1 B(5; 10, 0.6)
= 1 0.367
= 0.633
82
Hypergeometric and Negative
3.5 Binomial Distributions
83
The Hypergeometric Distribution
The assumptions leading to the hypergeometric distribution
are as follows:
84
The Hypergeometric Distribution
X = # of successes in the random sample of n elements.
85
Example 3.35
We received 20 service calls for printer problems (8 laser
printers and 12 inkjet printers).
86
Example 3.35 contd
Consider X = 2.
P(X = 2) =
= 77/323 = 0.238
87
Example 3.35 contd
P(X = 2) = 0.
88
Example 3.35 contd
P(X = 14) = 0.
89
The Hypergeometric Distribution
For hypergeometric rv X with pmf h(x; n, M, N), the mean
and variance are
V(X) = 0.9474 90
The Negative Binomial Distribution
The negative binomial rv and distribution are based on an
experiment satisfying the following conditions:
92
Example 3.38
A pediatrician wishes to recruit 5 couples, each of whom is
expecting their first child, to participate in a new natural
childbirth regimen. Let
p = P(a randomly selected couple agrees to participate).
= = 0.034
93
Example 3.38 contd
94
The Negative Binomial Distribution
Remark. Some books define the negative binomial rv as
the # of trials, rather than the # of failures.
A special case: r = 1.
The pmf is
(3.17)
95
The Negative Binomial Distribution
For a geometric random variable X (defined as # of failures
until 1 success observed in our Textbook),
96
The Negative Binomial Distribution
For a negative binomial rv X with pmf nb(x; r, p), its mean
and variance are
V(X) = r(1p)/p2.
97
Exercise Problem 74
Inspector checks 10 firms for possible violation of regulations.
Let X = # of firms among 10 checked that actually violate.
100
Exercise Problem 76 contd
P(X=4)
= P(GBBB U BGBB U BBGB U BGGG U GBGG U GGBG)
= 6(0.5)4 = 0.375
102
The Poisson Probability Distribution
Definition
P(X=x) =
104
Example 3.39 contd
105
The Poisson Distribution as a Limit
Proposition
Suppose that in the binomial pmf b(x; n, p), we let n
and p 0 in such a way that np approaches a value > 0.
Then b(x; n, p) p(x; ).
106
Example 3.40
If (i) P(any given page containing at least typo) = 0.005 and
(ii) typos are independent from page to page,
107
Example 3.40 contd
108
Example 3.40 contd
Similarly,
P(X 3)
= 0.8571
P(X 3) = 0.8576
109
The Poisson Distribution as a Limit
Table below shows the Poisson distribution for = 3 along
with three binomial distributions with np = 3.
110
The Poisson Distribution as a Limit
Table A.2 gives the cdf F(x; ) for = 0.1, 0.2, . . . ,1, 2, . . .,
10, 15, and 20.
111
The Mean and Variance of X
Proposition
E(X) = V(X) = .
112
Example 3.41
Example 39 continued
X =
= 2.12.
113
The Poisson Process
114
The Poisson Process
A very important application of the Poisson distribution
arises in connection with the occurrence of events of some
type over time.
115
The Poisson Process
Given an interval, events occur at random throughout the
interval. Partition the interval into subintervals of small
enough length such that
pmf p(x; ),
117
Example 3.42
Suppose pulses arrive at a counter at an average rate of 6
per minute, so that = 6.
118
Exercise Problem 85
Small aircrafts arrive according to a Poisson process with a
rate of 8 per hour.
a. E(X) = 8 aircrafts/hour.
P(X = 6) = e886/6! = 0.122
P(X 6) = 1 F(5; 8) = 1 0.191 = 0.809
P(X 10) = 1 F(9; 8) = 1 0.717 = 0.283
120
Exercise Problem 85 contd
121
Exercise Problem 92 contd
122
Exercise Problem 92 contd
123
Exercise Problem 92 contd
124
Chapter Summary
Concepts and Probability Distributions Discussed
Random Variables
Bernoulli Random Variables
Probability Mass Functions (pmf)
Cumulative Distribution Functions (cdf)
Expected Values E(X). E[h(X)] & Variances V(X), V[h(X)]
Binomial Distribution
Hypergeometric Distribution
Negative Binomial Distribuion
Geometric Distribution
Poisson Distribution
125