hw3 Soln

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Stat 244 Winter 2022 — HW3

Due on Tuesday Feb 1 by 5pm

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):

P(all distinct) = P(2nd # ̸= 1st #, and 3rd # ̸= 1st or 2nd #)


5 4 5
= P(2nd # ̸= 1st #) · P(3rd # ̸= 1st or 2nd # | 2nd # ̸= 1st #) = · = .
6 6 9
Equivalently, if we consider all 63 = 216 possible outcomes for the three dice, each is equally likely,
and there are 6 · 5 · 4 outcomes that have all three numbers distinct. So,
6·5·4 5
P(all distinct) = = .
63 9
Next, if they are indeed all distinct, then the probability that the red die has the middle value, rather
than the lowest value or the highest value, is 13 , by symmetry. So the answer is

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

on this region. Here C is a constant.

(a) Find C and the marginal density of fX (x).

Solution: We know that the density has to integrate to 1. We have


Z 1 Z 1 Z 1 Z 1
1 1 1
xy dy dx = x dx · y dy = · = .
x=0 y=0 0 0 2 2 4

So, C = 4. The support of X is [0, 1]. On this region,


Z 1 Z 1
fX (x) = fX,Y (x, y) dy = 4xy dy = 2x .
y=0 y=0

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 .

Solution: The conditional density formula gives us


fX,Y (x, y) 4xy
fY |X (y|x) = = = 2y ,
fX (x) 2x
on the range 0 ≤ y ≤ 1.

(d) Are the variables X and Y dependent or independent?

Solution: They are independent.

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).

Solution: Applying Markov’s inequality yields


E(X) 1
P(X > b) ≤ = .
b λ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.

Solution: For example let’s take λ = 1, t = 0.5, and b = 10. We have

P(X > b) = e−λb = e−10 = 0.000045

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

If we instead pick λ = 1, t = 0.5, and b = 2, then we have

P(X > b) = e−λb = e−2 = 0.1353

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

(b) What is E(X)? (Hint: think of X as a sum.)

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:

1.0 (0,1) 1.0 (0,1) 1.0


(.1,.9)

0.5 0.5 0.5

(0,.1) (.9,.1) (.1,.1) (.9,.1)


0.0 (1,0) 0.0 Region where Y > .1 0.0 Region where X > .1 and Y > .1
y

-0.5 -0.5 -0.5

-1.0 (0,-1) -1.0 -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 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

P(X > 0.1, Y > 0.1) 0.32


P(X > 0.1 | Y > 0.1) = = = 0.79 .
P(Y > 0.1) 0.405

(b) What is the CDF of the variable X?

Solution:

1.0 (0,1)

(x,1-x)

0.5

0.0 Region where X > x (1,0)


y

-0.5

(x,-1+x)

-1.0 (0,-1)

0.0 0.2 0.4 0.6 0.8 1.0

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

FX (x) = P(X ≤ x) = 1 − P(X > x)


Area of the triangle with vertices (1,0), (x,1-x), and (x,-1+x) (1 − x)2
= 1− = 1− = 2x − x2 .
area of the triangle 1

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: Find the probability of the event {T = T1 } = {T1 < T2 , T1 < T3 }:


Z ∞
P(T1 < T2 , T1 < T3 ) = P (T2 > t, T3 > t|T1 = t)P (T1 = t) dt
0
Z ∞
= P (T2 > T1 , T3 > T1 |T1 = t)P (T1 = t) dt
Z0 ∞
= P (T2 > t, T3 > t)P (T1 = t) dt
Z0 ∞
= P (T2 > t)P (T3 > t)P (T1 = t) dt
Z0 ∞
= e−λ2 t e−λ3 t λ1 e−λ1 t dt
0
Z ∞
λ1
= (λ1 + λ2 + λ3 )e−(λ1 +λ2 +λ3 )t dt
λ1 + λ2 + λ3 0
λ1
= .
λ1 + λ2 + λ3

(b) What is the CDF of T , the lifetime of the circuit?

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

P(S = s) = P(s − 1 < T ≤ s) = P(T ≤ s) − P(T ≤ s − 1)


   
= 1 − e−(λ1 +λ2 +λ3 )s − 1 − e−(λ1 +λ2 +λ3 )(s−1)
= e−(λ1 +λ2 +λ3 )(s−1) − e−(λ1 +λ2 +λ3 )s .

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,

P(N = n, S = s) = P(S = s) · P(N = n|S = s)


  s − 1
= e−(λ1 +λ2 +λ3 )(s−1) − e−(λ1 +λ2 +λ3 )s · pn (1 − p)s−n−1 .
n

Therefore, N takes nonnegative integer values and has PMF equal to


X X
P(N = n) = P(N = n, S = s) = P(N = n, S = s)
s≥1 s≥n+1
X   s − 1
−(λ1 +λ2 +λ3 )(s−1) −(λ1 +λ2 +λ3 )s
= e −e · pn (1 − p)s−n−1 .
n
s≥n+1

You might also like