STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
I. COMPULSORY HOMEWORK
PART A: BAYES THEOREM
Exercise 39 – page 175:
The prior probabilities for event A1 and A2 are P(A1) = 0.40 and P(A2) = 0.60. It is also
known that P (A1∩A2) = 0. Suppose P (B│A1) = 0.20 and P (B│A2) = 0.050.
a.
b.
c.
d.
Are A1 and A2 and mutually exclusive? Explain.
Compute P (A1∩B) and P (A2∩B).
Compute P (B).
Apply Bayes’ theorem to compute P (A1│B) and P (A2│B).
SOLUTIONS
a. Are A1 and A2 and mutually exclusive? Explain
* A1 and A2 are mutually exclusive because A1 and A2 do not have any common
outcome. In other words, they can’t happen at the same time as P(A1 ∩ A2) = 0.
* Explain:
Suppose P(A1U A2) = P(A1) + P(A2)-P(A1∩ A2)≤ 1.0, but P(A1) + P(A2) = 0.4+0.6 =1.0
Therefore, P(A1∩ A2) = 0
b. Compute P(A1 ∩ B) and P (A1∩B):
Because P(B|A1) = P(A1 ∩ B)/ P(A1) = 0.2,
so P(A1 ∩ B) = P(B|A1). P(A1) = 0.2 x 0.4 = 0.08 (Multiplication law)
Compute P(A2 ∩ B):
Similarly, applying multiplication law: P(A2 ∩ B) = P(B|A2). P(A2) = 0.05 x 0.6 = 0.03
c. Compute P(B):
Because A1 and A2 are mutually exclusive, and P(A1) + P(A2) = 0.4 + 0.6 = 1 – their
union is the entire sample space. In other words, if A 1 does not happen then A2 happens
and vice versa. Therefore, B will happen with either A1 or A2.
P(B) =
P(B and A1 happen together) + P(B and A2 happen together)
=
P(A1 ∩ B)
+
P(A2 ∩ B)
= 0.11
d. Apply Bayes’ theorem to compute P(A1|B) and P(A2|B)
They are called posterior probabilities as we revise P(A 1) and P(A2), given the
information that B happened.
P( A1 | B) =
P( A1 ∩ B )
P ( A1 ) * P ( B | A1 )
0.08
=
=
= 0.7273
P ( B)
P( A1 )* P( B | A1 ) + P( A2 )* P( B | A2 ) 0.11
1
STA228
P( A2 | B) =
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
P( A2 ∩ B )
P ( B | A2 ).P ( A2 )
0.03
=
=
= 0.2727
P ( B)
P( B | A1 ).P( A1 ) + P( B | A2 ).P( A2 ) 0.11
Tabular approach
Events
Ai
Prior
probabilities
P(Ai)
Conditional
Probabilities
P(B | Ai)
Joint
Probabilities
P(Ai ∩ B)
Posterior Probabilities
P(Ai | B)
A1
0.40
0.20
0.08 0.08/0.11 = 0.7273
A2
0.60
0.05
0.03 0.03/0.11 = 0.2727
1.0
P(B) =
0.11
1.0
Exercise 41 – page 175:
A consulting firm submitted a bid for a large project. The firm’s management initially felt
they had a 50 – 50 chance of getting the project. However, the agency to which the bid
was submitted subsequently requested additional information on the bid. Past experience
indicates that for 75% of the successful bid and 40% of the unsuccessful bids the agency
requested additional information.
a. What is the prior probability of the bid being successful ( that is, prior to the
request for additional information)?
b. What is the conditional probability of a request for additional information given
that the bid will ultimately be successful?
c. Compute the posterior probability that the bid will be successful given a request
for additional information.
SOLUTIONS
a. What is the prior probability of the bid being successful (that is, prior to the
request for additional information)?
P(success) = P(unsuccess) = 0.50 (the firm’s management initially felt that they had a 5050 chance of getting the project)
b. What is the conditional probability of a request for additional information given
that the bid will ultimately be successful?
2
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
Because past experience indicates that 75% of the successful bids which the agency
requested additional information, so the conditional probability of a request for additional
information given that the bid will success is P(request|success) =0.75
c. Compute the posterior probability that the bid will be successful given a request
for additional information.
P ( success | request )
P (request | success ).P ( success )
P (request | success).P( success) + P(request | unsuccess).P(unsuccess)
0.75 x0.5
=
= 0.6522
0.75 x 0.5 + 0.40 x 0.5
=
Tabular approach
Events
Ai
Prior
probabilities
P(Ai)
Conditional
Probabilities
P(B | Ai)
B= Request
Joint
Probabilities
P(Ai ∩ B)
Posterior Probabilities
P(Ai | B)
A1(success)
0.50
0.75
0.375 0.375/0.575 = 0.6522
A2 (Failure)
0.50
0.40
0.20 0.20/0.575 = 0.3478
1.0
P(B) =
0.575
1.0
Exercise 42 – page 175:
A local bank reviewed its credit card policy with the intention of recalling some of its
credit cards. In the past approximately 5% of cardholders defaulted, leaving the bank
unable to collect the outstanding balance. Hence, management established a prior
probability of 0.05 that any particular cardholder will default. The bank also found that
the probability of missing a monthly payment is 0.20 for customers who do not default.
Of course, the probability of missing a monthly payment for those who default is 1.0
a. Given that a customer missed one or more monthly payment, computer the
posterior probability that the customer will default.
b. The bank would like to recall its card if the probability that the customer will
default is greater than .20. Should the bank recall its card if the customer misses a
monthly payment? Why or why not?
SOLUTIONS
3
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
a. Given that a customer missed one or more monthly payments, compute the
posterior probability that the customer will default.
Given P(default) = .05, therefore, P(no default) = .95
P(missing a monthly payment | no default) = .20
P(missing a monthly payment | default) = 1.0
P ( default | missing a monthly payment )
P(missing a monthly payment | default ).P (default )
P(missing a monthly payment | default ).P( default ) + P(missing a monthly payment | no default ).P (no default )
1.0 x 0.05
=
= 0.2083
1.0 x0.05 + 0.20 x0.95
=
b. The bank would like to recall its card if the probability that a customer will
default is greater than 0.20. Should the bank recall its card if the customer misses a
monthly payment? Why or why not?
Yes, because the probability is .2083 which is greater than .20
Tabular approach
Events
Ai
Prior
probabilities
P(Ai)
Conditional
Probabilities
P(B | Ai)
B=Missing pmt
Joint
Probabilities
P(Ai ∩ B)
Posterior
Probabilities
P(Ai | B)
A1(default)
0.05
1.0
0.05 0.05/0.24 = 0.2083
A2(non-default)
0.95
0.2
0.19 0.03/0.11 = 0.7917
1.0
P(B) =
0.24 1.0
Exercise 44 – page 175:
The American Council of Education reported that 47% of college freshmen earn a degree
and graduate within five years. Assume that graduation records show women make up
50% of the students who graduated within five years, but only 45% of the students who
did not graduate within five years. The students who had not graduated within five years
either dropped out or were still working on their degrees.
a. Let A1 = the students graduated within five years
A2 = the students did not graduate within five years
W = the students is a female student.
Using the given information, what are the values for P (A1), P (A2), P (W│A1) and
P (W│A2)?
4
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
b. What is the probability that {a female student} will graduate within five years?
c. What is the probability that [a male student] will graduate within five years?
d. Given the preceding results, what are the percentage of women and the percentage
of men in the entering freshman class?
SOLUTIONS:
a. Let A1 = the student graduated within five years
A2 = the student did not graduated within five years
W = the student is a female student
Using the given information, what are the values for P(A1), P(A2), P(W|A1), and
P(W|A2)?
P(A1) = 0.47
P(A2) = 1 – P(A1) = 0.53
P(W|A1) = 0.50
P(W|A2) = 0.45
b. What is the probability that a female student will graduate within five years?
P( A1 | W ) =
=
P( A1 ∩ W )
P (W | A1 ).P ( A1 )
=
P(W )
P(W | A1 ).P( A1 ) + P(W | A2 ).P( A2 )
0.50 x 0.47
0.50 x0.47 + 0.45*0.53
= 0.4963
c. What is the probability that a male student will graduate within five years?
P ( A1 | W c ) =
=
P ( A1 ∩ W c )
P(W c | A1 ).P( A1 )
=
P (W c )
P (W c | A1 ).P ( A1 ) + P (W c | A2 ).P ( A2 )
(1 − P(W | A1 )).P ( A1 )
(1 − P(W | A1 )).P( A1 ) + (1 − P(W | A2 )).P ( A2 )
(1 − 0.50) x0.47
(1 − 0.50) x0.47 + (1 − 0.45) *0.53
= 0.4463
=
For Men
Events
Ai
A1
Prior
probabilities
P(Ai)
0.47
Conditional
Probabilities
P(Wc|Ai)
0.50
5
Joint
Probabilities
P(Ai ∩Wc)
Posterior Probabilities
P(Ai | Wc)
0.2350 0.235/0.5265 = 0.4462
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
A2
0.53
0.55
1.0
0.2915 0.2915/0.5265 = 0.5538
0.5265
1.0
Notes: P(Wc|A2)=1-P(W/A2) = 1-0.45 = 0.55
OTHER Solution:
P(A1)= P(A1/W)*P(W)+P(A1/Wc) * P(Wc)
=>
P(W ) = P (W ∩ A1 ) + P(W ∩ A2 ) = P (W | A1 ).P ( A1 ) + P(W | A2 ).P( A2 ) = 0.4735
Where:
Comment: This method seems less complicated than the above method in terms of
the formula. “All roads lead to Rome”, the new solution illustrates that you are a
good thinker. All students’ ideas are respected and appreciated.
Students’ question:
Why we don’t compute P(A1/Wc) by the following formula?
P(A1/Wc) = 1-P(A1/W) = 1-0.4963= 0.5033 ?? (wrong conclusion)
Answer: This is the sophistry/fallacy. Please review the complement event again.
We can infer , but we cannot say
P(A1/Wc) = 1-P(A1/W) because the influential level of event W and the impact level
of event Wc on A1 are different. For example, I and you make a push on a table.
However, the force I push on the table is different with yours. Let say, I push with
10kilos but your push is just 3 kilos.
d. Given the preceding results, what are the percentage of women and the
percentage of men in the entering freshman class?
The percentage of women in the entering freshman class:
P(W) = P(W∩ A1 ) + P(W∩ A2 ) = P(W | A1 ).P(A1 ) + P(W | A2 ).P(A2 ) = 0.4735
The percentage of men in the entering freshman class:
P (W c ) = P(W c ∩ A1 ) + P(W c ∩ A2 ) = P(W c | A1 ).P ( A1 ) + P (W c | A2 ).P ( A2 ) = 0.5265
For women
6
STA228
Events
Ai
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
Prior
probabilities
P(Ai)
Conditional
Probabilities
P(W|Ai)
Joint
Probabilities
P(Ai ∩ W)
Posterior Probabilities
P(Ai|W)
A1
0.47
0.50
0.235 0.235/0.4785 = 0.4963
A2
0.53
0.45
0.2385 0.2385/0.4785 = 0.5037
1.0
P(W)=
0.4735
1.0
Prior
probabilities
P(Ai)
Conditional
Probabilities
P(Wc|Ai)
Joint
Probabilities
P(Ai ∩Wc)
Posterior Probabilities
P(Ai |Wc)
For Men
Events
Ai
A1
0.47
0.50
0.2350 0.235/0.5265 = 0.4462
A2
0.53
0.55
0.2915 0.2915/0.5265 = 0.5538
1.0
P(Wc)=
0.5265
1.0
Notes: P(Wc|A2)=1-P(W/A2) = 1-0.45 = 0.55
P(Wc|A1)=1-P(W/A1) = 1-0.5 = 0.50
PART B: DISCRETE PROBABILITY DISTRIBUTION
Exercise 3 (page 189)
Three students scheduled interviews for summer employment at the Brook-wood
Institute. In each case the interview results in either an offer for a position or no offer.
Experimental outcomes are defined in terms of the results of the three interviews.
a. List the experimental outcomes.
b. Define a random variable that represents the number of offers made. Is the random
variable continuous?
c. Show the value of the random variable for each of the experimental outcomes.
Solutions:
a. List the experimental outcomes.
7
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
Three students had interviews. Each of them may get one of two results – offer or no
offer. Let O denotes offer and N denotes no offer. The experimental outcomes for three
students are listed as following:
OOO, OON, ONN, NNN, ONO, NNO, NOO, NON. (The number of possible outcomes
is 8.).
b. Define a random variable the represents the number of offers made. Is the
random variable continuous?
Let X = number of offers made.
No, it is not a continuous random variable. It is a discrete random variable because we
can count the number of offers made.
c. Show the value of the random variable for each of the experimental outcomes.
Let X = number of offers made.
X can assume one of the following values: 0,1,2,3.
Exercise 6 (page 189)
Listed is a series of experiments and associated random variables. In each case, identify
the values that the random variable can assume and state whether the random variable is
discrete or continuous.
Experiment
Random variable (x)
a.
Take a 20-question examination
Number of questions answered correctly
b.
Observe cars arriving at a tollbooth for 1 Number of cars arriving at tollbooth
hour
c.
Audit 50 tax returns
Number of returns containing errors
d.
Observe an employee’s work
Number of nonproductive hours in an
eight-hour workday
e.
Weigh a shipment of goods
Numbers of pounds
SOLUTIONS
Experiment
Random variable (x)
Discrete (D) or
Continuous (C)
Take
a
examination
20-question Number of questions answered
correctly
D
8
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
Observe cars arriving at a Number of
tollbooth for 1 hour
tollbooth
cars
Audit 50 tax returns
returns
Observe
work
an
at
D
containing
D
employee’s Number of nonproductive hours in
an eight-hour workday
C
Number
errors
Weigh a shipment of goods
of
arriving
Numbers of pounds
C
Exercise 15 – page 196: (Tutorial 4.xls – 4.6)
The following table provides a probability distribution for the random variable x
x
f(x)
3
0.25
6
0.50
9
0.25
1
a. Compute E(x), the expected value of x.
E ( x) = ∑ x. f ( x) = 3x0.25 + 6 x0.5 + 9 x0.25 = 6.0
b. Compute the variance of x.
Var = σ 2 = ∑ ( x − E ( x)) 2 . f ( x ) = (3 − 6) x0.25 + (6 − 6) x0.5 + (9 − 6) x0.25 = 4.5
c. Compute the standard deviation of x.
σ = Var = 4.5 = 2.1213
x
f(x)
E(x)
x-E(x) (x-E(x))2.f(x)
3
0.25
6
-3
2.25
6
0.5
6
0
0
9
0.25
6
3
2.25
VAR
Standard
9
4.5
2.121320344
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
deviation
Notes:
To calculate square root in Excel: Type = SQRT(value), = (value)^0.5
Find the Square in Excel: Use Power (number, power) or (number).power
Find the expected value for discrete variable in Excel: Sumproduct function in Excel
is also useful when getting the sum of columns multiplied by rows.
Find variance in Excel: (STDEV)^2 or Σ{X-E(x)}2*f(x), then we should create 2
columns, 1 column for {X-E(x)}2 and 1 column for f(x), then use the sumproduct to
compute the variance.
Exercise 17 (page 197)
A volunteer ambulance service handles 0 to 5 service calls on any given day. The
probability distribution for the number of service calls is as follows:
Number of Service Probabilit
Calls
y
Number of Service Probability
Calls
0
0.10
3
0.20
1
0.15
4
0.15
2
0.30
5
0.10
a. What is the expected number of service calls?
b. What is the variance in the number of service calls? What is the standard deviation?
SOLUTIONS
Exercise 17 (page 197) (Tutorial4.xls – 4.7)
Number of Service Probabilit
Calls
y
0
0.1
1
0.15
2
0.3
xE(x)
E(x)
2.45 -2.45
2.45 -1.45
2.45 -0.45
10
6.00
2.10
0.20
0.60
0.32
0.06
STA228
3
4
5
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
0.2
0.15
0.1
a. Expected number of service
calls
b. Variance
standard deviation
2.45
2.45
2.45
0.55
1.55
2.55
0.30
2.40
6.50
0.06
0.36
0.65
2.45
2.0475
1.430909
Exercise 18 (page 197)
The American Housing Survey reported the following data on the number of bedrooms in
owner-occupied and renter-occupied houses in central cities (,
march 31, 2003).
Number of houses (1000s)
Bedroom
s
Renter-occupied Owner-occupied
0
547
23
1
5,012
541
2
6,100
3,832
3
2,644
8,690
4 or more
557
3,783
Total
14,860
16,869
a. Define a random variable x = number of bedrooms in renter-occupied houses and
develop a probability distribution for the random variable. (Let x = 4 represents 4 or more
bedrooms.)
b. Compute the expected value and variance for the number of bedrooms in renteroccupied houses.
c. Define a random variable y = number of bedrooms in owner-occupied houses and
develop a probability distribution for the random variable. (let y = 4 represents 4 or more
bedrooms.)
d. Compute the expected valued and variance for the number of bedrooms in owneroccupied houses.
11
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
e. What observations can you made from a comparison of the numbers of bedrooms in
renter-occupied versus owner-occupied homes?
SOLUTION
a. Define x = the number of bedrooms in renter-occupied houses
The probability distribution of x
x
f(x)
0
1
2
3
4
0.04
0.34
0.41
0.18
0.04
1.00
1.84
b. E(x)
x
f(x)
0
0.04
1
0.34
2
0.41
3
0.18
4
0.04
3.
4
0.
7
0.
0
1.
3
4.
7
Variance
Standard deviation
0.12
0.24
0.01
0.24
0.17
0.79
0.89
a. Define a random variable y = number of bedrooms in owner-occupied
houses and develop a probability distribution for the random variable.
(let y = 4 represents 4 or more bedrooms.)
b. Compute the expected valued and variance for the number of bedrooms
in owner-occupied houses.
c. Define y = the number of bedrooms in owner-occupied houses
The probability distribution of y
y
f(y)
12
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
0
1
2
3
4
b. E(x)
y
0.00
0.03
0.23
0.52
0.22
1.00
f(y)
0
1
2
3
4
0.00
0.03
0.23
0.52
0.22
Variance
Standard deviation
8.6
3.7
0.9
0.0
1.1
0.01
0.12
0.20
0.00
0.26
0.59
0.77
c. What observations can you made from a comparison of the numbers of bedrooms in
renter-occupied versus owner-occupied homes?
The number of bedrooms in owner-occupied houses is greater than in renter-occupied
houses; the expected number of bedrooms is 2.93 – 1.84 = 1.09 greater, and the
variability in the number of bedrooms is less for the owner-occupied houses.
II. ADDITIONAL EXCERCISES:
PART A: BAYES THEOREM
Exercise 40 – page 175:
The prior probabilities for event A1, A2, and A3 are P(A1) = 0.20, P(A2) = 0.50, and P(A3)
=0.30. The conditional probabilities of event B given A1, A2, and A3 are P (B│A1) = 0.50,
P (B│A2) = 0.40 and P (B│A3) = 0.30.
a. Compute P (B
A1), P (B A2), and P (B A3).
b. Apply Bayes’ theorem, equation (4.19), to compute the posterior probability
P(A2│B).
c. Use the tabular approach to applying Bayes’ theorem to compute P (A1│B), P
(A2│B) and P (A3│B).
SOLUTIONS
a. Compute P(A1 ∩ B), P(A2 ∩ B), and P(A3 ∩ B)
13
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
Apply multiplication law:
P(A1 ∩ B) = P(B|A1). P(A1) = .50 x .2 = 0.10;
P(A2 ∩ B) = P(B|A2). P(A2) = .40 x .5 = 0.20;
And
P(A3 ∩ B) = P(B|A3). P(A3) = .30 x .3 = 0.09
b. Apply Bayes’ theorem to compute the posterior probability P(A2|B)
P( A2 | B ) =
=
P ( A2 ∩ B )
P ( A2 ).P ( B | A2 )
=
P ( B)
P( B | A1 ).P( A1 ) + P( B | A2 ).P( A2 ) + P( B | A3 ).P( A3 )
0.20
= 0.5128
0.10 + 0.20 + 0.09
c. Use the tabular approach to applying Bayes’ theorem to compute P(A 1|B), P(A2|B),
and P(A3|B)
Events
Ai
Prior
probabilities
P(Ai)
Conditional
Probabilities
P(B | Ai)
Joint
Probabilities
P(Ai ∩ B)
Posterior Probabilities
P(Ai | B)
A1
0.2
0.50
0.10
0.10/0.39 = 0.2565
A2
0.5
0.40
0.20
0.20/0.39 = 0.5128
A3
0.3
0.30
0.09
0.09/0.39 = 0.2308
0.39
1.0
1.0
PARR B: DISCRETE DISTRIBUTION PROBABILITY
Exercise 1 (page 188)
Consider the experiment of tossing a coin twice
a. List the experimental outcomes:
HH, HT, TH, TT
b. Define a random variable that represents the number of heads occurring on the two
tosses.
Let X = the number of heads occurring on the two tosses
c. Show what value the random variable would assume for each of the experimental
outcomes.
X can assume one of the three values: 2, 1 and 0
14
STA228
RANDOM VARIABLE & PROB. DISTRIBUTIONS TUTORIAL 3
d. Is this random variable discrete or continuous?
It is discrete random variable because it can assume a limit range of values (3) and it is
countable.
Exercise 2 – page 189:
Consider the experiment of a worker assembling a product
a. Define a random variable that represents the time in minutes required to assemble the
product.
Let Y = minutes required to assemble the product.
b. What values may the random variable assume?
Y can assume any countable value from 0. Y = 0,1,2,3,4,5,6….
c. Is the random variable discrete or continuous?
The random variable is continuous because the variable receives the numbers in minute
although it is an infinite variable – there is no upper limit.
Exercise 4 (page 189)
In November the U.S. unemployment rate was 4.5%. The Census Bureau includes nine
states in the Northeast region. Assume that the random variable of interest is the number
of Northeast states with an unemployment rate in November that was less than 4.5%.
What values may this random variable assume?
Solutions
Because there are nine states whose unemployment rate was greater than or less than
4.5%. Therefore, we can count the number of states with an unemployment rate in
November that was less than 4.5%. The random variable may assume one of the ten
values: 0,1,2…,9.
Notes: To calculate square root in Excel: Type = SQRT(value) or = (value)^0.5
Find the Square in Excel: Use Power (number, power) or (number)^power
Find the expected value for discrete variable in Excel: Sumproduct function in Excel
is also useful when getting the sum of columns multiplied by rows.
15