Download IE 4521 Practice Midterm Problems

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

Foundations of statistics wikipedia , lookup

Central limit theorem wikipedia , lookup

Infinite monkey theorem wikipedia , lookup

Inductive probability wikipedia , lookup

Expected value wikipedia , lookup

Birthday problem wikipedia , lookup

Law of large numbers wikipedia , lookup

Transcript
IE 4521 Practice Midterm Problems
John Gunnar Carlsson
October 24, 2009
1
Probability problems
1.1
Dice
Suppose we roll a pair of dice:
1. What is the probability that the second die lands on a higher value than the first die?
Solution By writing out all pairs as in slide 4 of lecture 2, we find that the second die is higher than the first
die in 15 of the 36 cases, so the answer is 15/36 = 5/12.
2. What is the probability that the sum of the upturned faces is i, for i ∈ {2, . . . , 12}?
Solution See slide 6 of lecture 2.
3. Suppose that we know the sum of the upturned faces is either 5 or 7. What is the probability that the sum is
5?
Solution Let A be the event that the sum of the faces is 5 and B the event that the sum of the faces is 7. Let
C = A ∪ B be the event that the sum of the faces is either 5 or 7. Then Pr ( A) = 4/36, Pr ( B) = 6/36, and
Pr (C ) = Pr ( A) + Pr ( B) = 10/36. Then
Pr ( A| C ) =
1.2
Pr ( A ∩ C )
Pr ( A)
4/36
=
=
= 2/5
Pr (C )
Pr (C )
10/36
Machine failure
A system is composed of 5 components, each of which is either working or broken. Consider an experiment that
consists of observing the status of each component, and let the outcome of the experiment be given by the vector
( x1 , x2 , x3 , x4 , x5 ), where xi = 1 if component i works and 0 if component i is broken.
1. How many outcomes are in the sample space of this experiment?
Solution There are 25 = 32 states.
2. Suppose that the system will work if components 1 and 2 are both working, or if components 3 and 4 are
both working, or if components 1, 3, and 5 are all working. Let W denote the event that the system works.
Specify all the outcomes in W.
Solution The event W consists of all events of the form (1, 1, x3 , x4 , x5 ), ( x1 , x2 , 1, 1, x5 ), and (1, x2 , 1, x4 , 1).
There are 15 total events which can be computed by writing all the possibilities out exhaustively.
3. Let A denote the event that components 4 and 5 are broken. How many outcomes are contained in event A?
1
Solution Event A consists of all outcomes of the form ( x1 , x2 , x3 , 0, 0). Since we can freely choose x1 , x2 ,
and x3 , there are 23 = 8 outcomes.
4. How many outcomes are contained in event A ∩ W?
Solution By enumerating possibilities (i.e. just writing them all out), we find that outcomes (1, 1, 1, 0, 0)
and (1, 1, 0, 0, 0) are common to A and W.
2
Conditional probability problems
2.1
Witness reliability
You are a member of a jury judging a hit-and-run driving case. A taxi hit a pedestrian one night and fled the
scene. The entire case against the taxi company rests on the evidence of one witness who saw the accident from his
window some distance away. He says that he saw the pedestrian struck by a blue taxi. The lawyer for the injured
pedestrian establishes the following facts:
1. There are only two taxi colors in town, blue taxis and black taxis. On the night in question, 85% of all taxis
on the road were black and 15% were blue.
2. The witness has undergone an extensive vision test and has demonstrated that he can successfully identify
the color of a taxi 80% of the time.
Using Bayes’ rule, compute the probability that the car was, in fact, black.
Solution We have
Pr (taxi is black)
Pr (taxi is blue)
Pr ( witness says "black"| taxi is black)
Pr ( witness says "blue"| taxi is black)
Pr ( witness says "blue"| taxi is blue)
Pr ( witness says "blue"| taxi is black)
=
=
=
=
=
=
0.85
0.15
0.8
0.2
0.8
0.2
and therefore, by Bayes’ rule,
=
=
=
Pr ( taxi is black| witness says "blue")
Pr ( witness says "blue"| taxi is black) Pr (taxi is black)
Pr (witness says "blue")
Pr ( witness says "blue"| taxi is black) Pr (taxi is black)
Pr ( witness says "blue"| taxi is black) Pr (taxi is black) + Pr ( witness says "blue"| taxi is blue) Pr (taxi is blue)
0.2 · 0.85
≈ 0.59
0.2 · 0.85 + 0.8 · 0.15
Hence, there is still a 59% probability that the witness is incorrect, which gives us reasonable doubt as a jury.
2.2
Socks
Sock drawer A contains 2 white socks and 1 black sock, whereas sock drawer B contains 1 white sock and 5 black
socks. A sock is drawn at random from sock drawer A and placed in sock drawer B. A sock is then drawn from
sock drawer B. It happens to be white. What is the probability that the sock transferred was white?
2
Solution Let C denote the event that the transferred sock is white, and let D denote the event that the visible
sock is white. Hence, we can let C c (the complement of C) denote the event that the transferred sock is black, and
D c the event that the visible sock is black. We have
=
=
Pr ( D | C ) =
Pr ( D | C c ) =
Pr (C )
Pr (C c )
2/3
1/3
2/7
1/7
And therefore, by Bayes’ rule,
Pr ( C | D )
=
=
=
3
Pr ( D | C ) Pr (C )
Pr ( D )
Pr ( D | C ) Pr (C )
Pr ( D | C ) Pr (C ) + Pr ( D | C c ) Pr (C c )
2/7 · 2/3
= 0.8
2/7 · 2/3 + 1/7 · 1/3
Random variables
3.1
Guessing game
One of the numbers 1 through 16 is uniformly chosen at random. You have to guess the number chosen by asking
“yes-no” questions. Compute the expected number of questions you will need to ask in each of the two cases:
1. Your ith question is “is it i?” for i = 1, . . . , 16.
Solution Clearly, if the chosen number is x, then we will take exactly x guesses to reach that number, so
E (#of guesses) =
1
2
16
+
+···+
= 8.5
16 16
16
2. Your ith question is “is it Zi ?”, where Zi is chosen uniformly at random between 1 and 16. (note: this would
be a very stupid way to guess, because we could guess the same wrong guess twice, for example)
Solution At each guess, we have a probability of 1/16 of guessing correctly. Hence, the number of guesses,
X, is a geometric random variable with p = 1/16. Therefore,
E ( X ) = 1/p = 16
3. At each turn, you try to eliminate one-half of the remaining numbers (so that your first question is “is it less
than or equal to 8?” and your second question is either “is it less than or equal to 4?” or “is it less than or
equal to 12?” depending on the response, and so forth)
Solution If we use this strategy, then after the ith guess we have 16/2i remaining numbers to choose from,
because we’re halving the remaining numbers. Since 16/24 = 1, this means that after 4 guesses we must
have the correct answer, so we will always take exactly 4 guesses.
3.2
Fitting
The density function of X is given by
(
f (x) =
a + bx2
0
If E ( X ) = 3/5, find a and b.
3
0≤x≤1
otherwise
Solution We require that
ˆ
1
a + bx2 dx
= 1
0
ˆ
1
x a + bx2 dx
= 3/5
0
and therefore
ˆ
1
a + bx2 dx
= 1
0
h
ax + bx3 /3
i1
0
a + b/3
= 1
= 1
We also have
ˆ
1
x a + bx2 dx
= 3/5
0
h
ax2 /2 + bx4 /4
i1
0
a/2 + b/4
= 3/5
= 3/5
So, we have
a + b/3
= 1
a/2 + b/4 = 3/5
whence a = 3/5, b = 6/5.
3.3
Machine breakdown
There are two possible causes for a breakdown of a machine. To check the first possibility would cost C1 dollars,
and, if that were the cause of the breakdown, the trouble could be repaired at a cost of R1 dollars. Similarly, there
are costs C2 and R2 associated with the second possibility. Let p and 1 − p denote, respectively, the probabilities
that the breakdown is caused by the first and second possibilities. Under what conditions on p, Ci , Ri (for i = 1, 2)
should we check the first possible cause of breakdown and then the second, as opposed to reversing the checking
order, so as to minimize the expected cost involved in returning the machine to working order?
Note If the first check is negative, we must still check the other possibility. Assume that only one error is possible
at a time.
Solution Suppose that we check the first cause of breakdown and then the second. Then, with probability p, our
cost will be C1 + R1 , and with probability 1 − p our cost will be C1 + C2 + R2 . Therefore, our expected cost is
p (C1 + R1 ) + (1 − p) (C1 + C2 + R2 )
If we check the second cause of breakdown first, our expected cost is
(1 − p) (C2 + R2 ) + p (C1 + R1 + C2 )
Hence, it is desirable to check the first cause of breakdown only if
p (C1 + R1 ) + (1 − p) (C1 + C2 + R2 ) < (1 − p) (C2 + R2 ) + p (C1 + R1 + C2 )
which we can simplify to
(1 − p) C1 < pC2
In other words, the money wasted due to checking the first type of failure must be less than the money wasted
due to checking the second type of failure.
4
3.4
A queueing problem
Consider a post office that is staffed by two clerks. Suppose that when Mr. Smith enters the system, he discovers
that Ms. Jones is being served by one of the clerks and Mr. Brown by the other. Suppose also that Mr. Smith is told
that his service will begin as soon as either Jones or Brown leaves. If the amount of time that a clerk spends with
a customer is exponentially distributed with parameter λ, what is the probability that, of the three customers, Mr.
Smith is the last to leave the post office?
Solution Consider the time at which Mr. Smith first finds a free clerk. At this point either Ms. Jones or Mr.
Brown would have just left and the other one would still be in service. However, by the memoryless property of
exponential random variables, it follows that the additional amount of time that this other person (either Jones
or Brown) would still have to spend in the post office is exponentially distributed with parameter λ. That is, it is
the same as if service for this person were just starting at this point. Hence, by symmetry, the probability that the
remaining person finishes before Smith must equal 1/2.
We can do this mathematically as follows: let x be the time that the first person leaves the system, let Y be the
total waiting time that the remaining person has (starting at time 0), and let Z be the total waiting time that Mr.
Smith has (starting at time x). Then the probability that Mr. Smith is not the last person to leave the post office is
Pr (Y ≥ Z + x |Y ≥ x )
The memoryless property of the exponential says that, if X is exponentially distributed, then
Pr ( X ≥ x + y| X ≥ x ) = Pr ( X ≥ y)
plugging this into the above with X = Y, y = Z, we find that
Pr (Y ≥ Z + x |Y ≥ x ) = Pr (Y ≥ Z )
Now, Y and Z are both exponentially distributed random variables with parameter λ, so Pr (Y ≥ Z ) = 1/2.
3.5
Bus arrivals
Buses arrive at a specified stop at 15-minute intervals starting at 7:00 a.m. That is, they arrive at 7:00, 7:15, 7:30,
7:45, and so on. If a passenger arrives at the stop at a time that is uniformly distributed between 7 and 7:30, find
the probability that he waits
1. less than 5 minutes for a bus
Solution The passenger’s arrival time is uniformly distributed between 7:00 and 7:30. We can write this as
a uniform random variable with
(
1/30 if 0 ≤ x ≤ 30
f (x) =
0
otherwise
The passenger will wait less than 5 minutes for a bus if he arrives between 7:10 and 7:15, or between 7:25 and
7:30. The probability of this happening is
ˆ
ˆ
15
30
1/30 dx +
1/30 dx = 1/3
10
25
2. more than 10 minutes for a bus.
Solution The passenger will wait more than 10 minutes for a bus if he arrives between 7:00 and 7:05, or
between 7:15 and 7:20. The probability of this happening is
ˆ
ˆ
5
20
1/30 dx +
0
1/30 dx = 1/3
15
5
3.6
Bus breakdown
A bus travels between two cities A and B, which are 100 miles apart. If the bus has a breakdown, the distance from
the breakdown to city A has a uniform distribution over (0, 100). There is a bus service station in city A, in B, and
in the center of the route between A and B. It is suggested that it would be more efficient to have the three stations
located 25, 50, and 75 miles, respectively, from A. Do you agree? Why?
Solution Let X ∼ U (0, 100) denote the place where the bus has a breakdown. Let d1 ( X ) denote the distance
from X to the nearest service station using the current setup, and let d2 ( X ) denote the distance from X to the
nearest service station using the newly suggested setup. We have
d1 ( X )
d2 ( X )

X



50 − X

X − 50



100 − X

25 − X





X − 25



50 − X

X − 50





75
−X



X − 75
=
=
if X ≤ 25
if 25 < X ≤ 50
if 50 < X ≤ 75
if X > 75
if X ≤ 25
if 25 < X ≤ 37.5
if 37.5 < X ≤ 50
if 50 < X ≤ 62.5
if 62.5 < X ≤ 75
if X > 75
The expected waiting time under the current scheme is
ˆ
E (d1 ( X ))
100
=
d1 ( x ) f ( x ) dx
0
ˆ
100
=
d1 ( x ) (1/100) dx
0
1
100
12.5
=
=
ˆ
25
x dx +
0
1
100
ˆ
50
50 − x dx +
25
1
100
ˆ
75
x − 50 dx +
50
1
100
ˆ
100
100 − x dx
75
The expected waiting time under the new scheme is
ˆ
E (d2 ( X ))
100
=
d2 ( x ) f ( x ) dx
0
ˆ
100
=
0
=
=
1
100
d2 ( x ) (1/100) dx
ˆ
1
+
100
9.375
25
25 − x dx +
0
ˆ
75
1
100
ˆ
37.5
x − 25 dx +
25
1
75 − x dx +
100
62.5
ˆ
100
x − 75 dx
75
So, this is indeed a preferable scheme.
3.7
Gamma distribution (this one’s hard)
If X is an exponential random variable with mean 1/λ, show that
E X k = k!/λk
for k = 1, 2, . . . .
6
1
100
ˆ
50
50 − x dx +
37.5
1
100
ˆ
62.5
x − 50 dx
50
Hint Write out the expectation
ˆ
E Xk =
∞
ˆ
∞
x k f ( x ) dx =
0
ˆ
x k λe−λx dx = λ
0
∞
x k e−λx dx
0
Then, apply a change of variables y = λx and use the identity
ˆ ∞
Γ ( t ) = ( t − 1) ! =
e−y yt−1 dy
0
Solution Following the hint, we write
E Xk
ˆ
= λ
∞
x k e−λx dx
0
We let y = λx and hence dx = 1/λdy, so
E X
k
ˆ
∞
= λ
0
ˆ
(y/λ)k e−y · (1/λ) dy
∞
(1/λ)k yk e−y · (1/λ) dy
0
ˆ ∞
= (1/λ)k
yk e−y dy
= λ
0
k
= (1/λ) Γ (k + 1) =
k!
λk
as desired.
4
4.1
The normal distribution
Normal approximation to binomial
Let X be the number of times that a fair coin, flipped 40 times, lands heads. Find the probability that X = 20. Use
the normal approximation and then compare it to the exact solution.
Solution The normal approximation for Pr ( X = 20) is Pr (19.5 ≤ Y ≤ 20.5), where Y ∼ N (20, 10), so


Pr (19.5 ≤ Y ≤ 20.5)


 19.5 − 20
Y − 20
20.5 − 20 

√
√
√
= Pr 
≤
≤

10
10
10 


| {z }
∼N (0,1)
≈ Φ (0.16) − Φ (−0.16) ≈ 0.1272
The exact value is
where C (n, k) =
4.2
Pr ( X = 20) = C (40, 20) (0.5)40 ≈ 0.1254
n!
.
k!(n−k)!
Signal transmission
Suppose that a binary message – either 0 or 1 – must be transmitted by wire from location A to location B. However,
the data sent over the wire are subject to a channel noise disturbance, so to reduce the possibility of error, the value
2 is sent over the wire when the message is 1 and the value −2 is sent when the message is 0. If m ∈ {−2, 2} is the
value sent at location A, then R, the value received at location B, is given by R = m + X, where X is the channel
noise disturbance. When the message is received at location B, the receiver decodes it according to the following
rule:
7
Figure 1: A system of components
• If R ≥ 0.5, then 1 is concluded.
• If R < 0.5, then 0 is concluded.
Assume that X ∼ N (0, 1). Compute the probability that an error occurs in decoding (for the case that m = −2
and the case that m = 2).
Solution There are two types of errors that can occur; we either mistake a 1 for a 0 or a 0 for a 1. Suppose that
the initial message is 1, and so m = 2. The probability of an error is precisely the probability that R = 2 + X ≤ 0.5.
This is
Pr (2 + X ≤ 0.5)
= Pr ( X ≤ −1.5)
= Φ (−1.5) ≈ 0.0668
If the initial message is 0, so that m = −2, then the probability of an error is precisely the probability that R =
−2 + X ≥ 0.5. This is
Pr (−2 + X ≥ 0.5)
= Pr ( X ≥ 2.5)
= 1 − Φ (2.5) ≈ 0.0062
Hence, the probability of an error is approximately 0.073.
5
5.1
Reliability theory
System reliability
Find the reliability of the system shown in figure 1.
8