hw3 Soln
hw3 Soln
hw3 Soln
1. Suppose you roll three fair dice—one red, one blue, and one green. What’s the probability that the
number on the red die, lies strictly between the other two numbers? For this problem, your solution
should be short and intuitive, with a final answer that is a single number (e.g., a fraction) rather than
anything in summation form or similar.
Solution: First, we calculate the probability that the three numbers are distinct (no repeats):
5 1 5
· = .
9 3 27
2. Let X and Y be random variables supported on [0, 1] × [0, 1], with joint density
f (x, y) = C · xy
1
Y
(b) Compute E
X
Solution:
Z 1 Z 1
Y y
E = 4 · xy dydx
X x=0 y=0 x
Z 1
= 4 y 2 dy
0
4
= .
3
(c) Calculate the conditional density fY |X (y|x) for (x, y) ∈ [0, 1]2 .
3. Let X ∼ Exponential(λ) and let t be a constant with 0 < t < λ. Let b > 0 be any value.
(a) Calculate P(X > b) exactly.
Solution: The CDF is FX (x) = 1 − e−λx for x > 0, so P(X > b) = 1 − FX (b) = e−λb .
(b) Now suppose we didn’t know the answer to (a), i.e., we could not calculate P(X > b) exactly.
Recalling that E(X) = λ1 , use Markov’s inequality to establish an upper bound on P(X > b).
(c) Next we’ll apply Markov’s inequality in a different way. First, calculate E(etX ).
Solution:
∞ ∞
1 −(λ−t)x i∞
Z Z
−λx
h λ
E(e tX
)= e tx
· λe dx = λ e−(λ−t)x dx = λ · − e = .
x=0 x=0 λ−t x=0 λ−t
2
(d) Next, use the Markov inequality to prove a bound on P(etX ≥ a) (here a > 0 is any positive
number, while we assume 0 < t < λ as before).
Solution:
E(etX ) λ
P(etX ≥ a) ≤ = .
a a(λ − t)
(e) Finally, using your answer to part (d), derive a bound on P(X ≥ b) (here b > 0 is any positive
number, and again 0 < t < λ). You will have to choose the value of a to use.
Solution:
λ λ
P(X ≥ b) = P(etX ≥ etb ) ≤ = e−tb · .
etb (λ − t) λ−t
(f) Now let’s compare. Pick some values for λ, b, and t. Compute the exact value of P(X > b) as
in part (a), the upper bound on P(X > b) as in part (b), and the alternative upper bound on
P(X > b) as in part (e). How close are these upper bounds to the real probability? Which bound
is better? Try this for a few values of λ, b, t and describe what you see.
The first upper bound (via the direct application of Markov’s inequality) is
1
P(X > b) ≤ = 0.1.
λb
The second upper bound (via the application of Markov’s inequality to the exponential) is
λ
P(X > b) ≤ e−tb = 2e−5 = 0.01347.
λ−t
The first upper bound (via the direct application of Markov’s inequality) is
1
P(X > b) ≤ = 0.5.
λb
The second upper bound (via the application of Markov’s inequality to the exponential) is
λ
P(X > b) ≤ e−tb = 2e−1 = 0.7357.
λ−t
In general if we have picked a larger value of b, we will likely see that the second version of
Markov’s inequality gives a much tighter upper bound (i.e., it’s much less of an overestimate), if
we choose t not too close to 0 or λ (e.g., t = λ/2). If we pick a smaller value of b, we are likely to
get a better bound with the direct application of the Markov inequality instead.
3
4. (a) Suppose you flip a fair coin 10 times. Let X be the total number of times that you see the sequence
HT. What is P(X = 0)?
Solution: To get X = 0, we need to never have a Heads followed by a Tails. The only way this
is possible is to have a stretch of all tails for the first n flips followed by only Heads for the next
10 − n flips, where we could have n = 0, 1, . . . , 10. Each of these possibilities has probability 0.510 ,
so
X10
P(X = 0) = P(n Tails and then (10 − n) Heads) = 11 · 0.510 = 0.0107 .
n=0
Solution: Let Ai be the event that coin flips #i and #(i + 1) give the sequence HT. Then we
have
X = 1A 1 + · · · + 1A 9 .
For each i, we have P(Ai ) = 0.25 (i.e., 1Ai ∼ Bernoulli(0.25)) and so
E(X) = E(1A1 ) + · · · + E(1A9 ) = 9 · 0.25 = 2.25 .
5. Suppose that (X, Y ) is a point chosen uniformly at random from the triangular region formed by
connecting the points (1, 0), (0, 1) and (0, −1).
(a) Calculate P(X > 0.1 | Y > 0.1).
Solution:
0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0 0.0 0.2 0.4 0.6 0.8 1.0
x x x
Let T be the triangular region (left figure). First, the region T ∩{y > 0.1} is a triangle with vertices
(0.9, 0.1), (0, 0.1), (0, 1) so it has area .81 · 1/2 = .405. Next, the region T ∩ {x > 0.1, y > 0.1} is
4
a triangle with vertices (0.9, 0.1), (0.1, 0.1), (0.1, 0.9), so it has area .8 · .8/2 = .32. The total area
of the region T is 1. So the probability is
Solution:
1.0 (0,1)
(x,1-x)
0.5
-0.5
(x,-1+x)
-1.0 (0,-1)
The range of possible values for X is the interval [0, 1], so we only need to calculate FX (x) for
0 ≤ x ≤ 1. We have
6. We have three light bulbs with lifetimes T1 , T2 , T3 distributed according to Exponential(λ1 ), Exponential(λ2 ),
Exponential(λ3 ). In other word, for example bulb #1 will break at a random time T1 , where the dis-
tribution of this time T1 is Exponential(λ1 ). The three bulbs break independently of each other.
The three light bulbs are arranged in series, one after the other, along a circuit—this means that as
soon as one or more light bulbs fail, the circuit will break. Let T be the lifetime of the circuit—that
is, the time until the circuit breaks.
5
(a) Suppose we observe a circuit break, what is the probability of it is caused by the bulb #1?
Solution: T = min(T1 , T2 , T3 ) since if anyone of the light bulbs fails, the circuit breaks. For each
bulb i = 1, 2, 3, its CDF is
Z t
FTi (t) = P(Ti ≤ t) = λi e−λi x dx = 1 − e−λi t .
x=0
Now let’s calculate the CDF of T . T is supported on (0, ∞), and for t ≥ 0,
FT (t) = P(T ≤ t)
= 1 − P(T > t)
= 1 − P(min(T1 , T2 , T3 ) > t)
= 1 − P(T1 > t, T2 > t, T3 > t)
= 1 − P(T1 > t)P(T2 > t)P(T3 > t)
= 1 − e−(λ1 +λ2 +λ3 )t .
(Note that this is in fact the CDF of the Exponential(λ1 + λ2 + λ3 ) distribution.)
(c) Next, suppose that we only check on the circuit once every second (assume the times T1 , T2 , T3 , T
are measured in seconds). Let S be the first time we check the circuit and see that it’s broken.
For example, if the circuit breaks after 3.55 seconds, we will only observe this when 4 seconds
have passed, and so S = 4. Calculate the PMF of S.
Solution: The possible values of S are the positive integers s = 1, 2, . . . . For each positive
integer s, S = s means that the circuit had not yet broken at time s − 1, but has broken by time
s. So, we have
6
(d) Finally, suppose that instead of checking on the circuit every second, we instead do the following:
after each second, we randomly decide whether to check on the circuit or not. With probability
p we check, and with probability 1 − p we do not check. This decision is made independently at
each time. Now let N be the number of times we check and see the circuit working. For example,
if the circuit breaks at time 3.55, and our choices were to check at time 1 second, not to check at
times 2 or 3 or 4, and to check at time 5, then N = 1, since the circuit was broken the 2nd time
we checked.
What is the PMF of N ? (Hint: start by finding the joint PMF of N and S. It’s fine if your
answer is in summation form.)
Solution: N takes nonnegative integer values. We will first calculate the joint PMF of N and
S. For any positive integers n and s, if N = n and S = s this means that the circuit was working
at times 1, . . . , s − 1 and broken at time s, and furthermore, the n-th time we checked was time
s − 1 or before while the (n + 1)st time we checked was time s or later. In other words, during
times 1, 2, . . . , s − 1, we checked exactly n times. We can observe that, conditional on S = s, the
distribution of N is Binomial(s − 1, p). So,