hw09 Sol
hw09 Sol
hw09 Sol
1 Probability Potpourri
Note 13 Provide brief justification for each part.
Note 14
(a) For two events A and B in any probability space, show that P[A \ B] ≥ P[A] − P[B].
(b) Suppose P[D | C] = P[D | C], where C is the complement of C. Prove that D is independent of
C.
(c) If A and B are disjoint, does that imply they’re independent?
Solution:
We can see here that P[A] = P[A ∩ B] + P[A \ B], and that P[B] = P[A ∩ B] + P[B \ A].
Looking at the RHS, we have
2 Independent Complements
Note 14 Let Ω be a sample space, and let A, B ⊆ Ω be two independent events.
Solution:
(c) False in general. If 0 < P[A] < 1, then P[A ∩ A] = P[∅] = 0 but P[A]P[A] > 0, so P[A ∩ A] ̸=
P[A]P[A]; therefore A and A are not independent in this case.
(d) True. To give one example, if P[A] = P[B] = 0, then P[A ∩ B] = 0 = 0 × 0 = P[A]P[B], so A
and B are independent in this case. (Another example: If A = B and P[A] = 1, then A and B are
independent.)
(a) There are n doors for some n > 2. One has a car behind it, and the remaining n − 1 have goats.
As in the ordinary Monty Hall problem, Monty will reveal one door with a goat behind it after
you make your first selection. Compute the probability of winning if you switch, as well as the
probability of winning if you don’t switch, and compare the results.
(Hint: Think about the size of the sample space for the experiment where you always switch.
How many of those outcomes are favorable?)
(b) Again there are n > 2 doors, one with a car and n − 1 with goats, but this time Monty will
reveal n − 2 doors with goats behind them instead of just one. How does switching affect the
probability of winning in this modified scenario?
(c) Finally, imagine there are k < n − 1 cars and n − k goats behind the n > 2 doors. After you
make your first pick, Monty will reveal j < n − k doors with goats. What values of j, k max-
imize the relative improvement in your probability of winning if you choose to switch? (i.e.
what j, k maximizes the ratio between your probability of winning when you switch, and your
probability of winning when you do not switch?)
Solution:
Throughout the solution, we will refer to W as the event that the contestant wins, and PS [W ]
and PN [W ] as the probabilities of this event happening if the contestant is (S)witching or (N)ot
switching, respectively.
(a) PN [W ] = 1/n since only one out of n initial choices gets us the car. Under the switching
strategy two things can happen: Either the first choice hits the car, and so switching (to any
of the remaining n − 2 doors) will inevitably get us the goat, or our first choice picks a goat,
leaving one of the remaining n−2 doors with the car. This sequence of choices—first choosing
from one of n doors, then switching to one of n − 2 remaining doors—gives us a sample
space of size n(n − 2). If we divide the number of favorable outcomes by the total number of
outcomes, we get
PS [W ] = (n − 1) · 1 / n(n − 2)
| {z } |{z} | {z }
first choice = goat second choice = car total # of choices
n−1 1 n−1
= = ·
n(n − 2) n n − 2
PS [W ] = (n − 1) · 1 / n·1
| {z } |{z} |{z}
first choice = goat second choice = car total # of choices
n−1 1
= = 1−
n n
so switching is again the better strategy.
(c) Now PN [W ] = k/n since k doors hide a car. Reasoning about sample spaces in the same way
we did in part (b) gives us a way to compute the denominator of PS [W ]. However, now the
numerator (number of favorable outcomes in the case where we switch) changes too:
PS [W ] = k · k−1 + (n − k) · k / n(n − j − 1)
|{z} | {z } | {z } |{z} | {z }
first choice = car second choice = car first choice = goat second choice = car total # of choices
k(n − 1) k n−1
= = · .
n(n − j − 1) n n − j − 1
(e) Prove that the probability that the graph contains a k-clique, for k ≥ 4log2 n + 1, is at most 1/n.
Hint: Use the union bound.
Solution:
(a) Between every pair of vertices, there is either an edge or there isn’t. Since there are two choices
n
for each of the n2 pairs of vertices, the size of the sample space is 2(2) .
(b) For a fixed set of k vertices to be a k-clique, all of the 2k pairs of those vertices have to be
k
connected by an edge. The probability of this event is 1/2(2) .
(c) EV1 and EV2 are independent if and only if V1 and V2 share at most one vertex: If V1 and V2
share at most one vertex, then since edges are added independently of each other, we have
P[EV1 ∩ EV2 ] = P[all edges in V1 and all edges in V2 are present]
(|V1 |) (|V2 |)
1 2 1 2
= ·
2 2
= P[EV1 ] · P[EV2 ].
Conversely, if V1 and V2 share at least two vertices, then their intersection V3 = V1 ∩V2 has at
least 2 elements, so we have
(|V3 |) (|V1 |)−(|V3 |) (|V2 |)−(|V3 |)
1 2 1 2 2 1 2 2
P[EV1 ∩ EV2 ] = · ·
2 2 2
|V | |V |
( 1 )+( 2 )−( 3 ) |V |
1 2 2 2
= ̸= P[EV1 ] · P[EV2 ].
2
(e) Let AS denote the event that S is a k-clique, where S ⊆ V is of size k. Then, the event that the
graph contains a k-clique can be described as the union of AS ’s over all S ⊆ V of size k. Using
the union bound,
[ 1
P AS ≤ ∑ P[AS ] = ∑ .
S⊆V,|S|=k
(k )
S⊆V,|S|=k 2 2
S⊆V,|S|=k
5 Symmetric Marbles
Note 14 A bag contains 4 red marbles and 4 blue marbles. Rachel and Brooke play a game where they draw
four marbles in total, one by one, uniformly at random, without replacement. Rachel wins if there
are more red than blue marbles, and Brooke wins if there are more blue than red marbles. If there
are an equal number of marbles, the game is tied.
(a) Let A1 be the event that the first marble is red and let A2 be the event that the second marble is
red. Are A1 and A2 independent?
(b) What is the probability that Rachel wins the game?
(c) Given that Rachel wins the game, what is the probability that all of the marbles were red?
Now, suppose the bag contains 8 red marbles and 4 blue marbles. Moreover, if there are an equal
number of red and blue marbles among the four drawn, Rachel wins if the third marble is red, and
Brooke wins if the third marble is blue. All other rules stay the same.
Solution:
(a) They are not independent; removing one red marble lowers the probability of the next marble
being red.
(b) Let p be the probability that Rachel wins. Since there are an equal number of red and blue
marbles, by symmetry, the probability that Rachel wins and the probability that Brooke wins
is the same. Thus, the probability that there is a tie is 1 − p − p = 1 − 2p.
We now compute the probability that there is a tie. For there tobe a tie, two of the four marbles
need to be red. There are 4 ways to pick 4 marbles, and 42 42 to pick 2 red and blue marbles,
8
6 Socks
Note 13 Suppose you have n different pairs of socks (n left socks and n right socks, for 2n individual socks
Note 14 total) in your dresser. You take the socks out of the dresser one by one without looking and lay
them out in a row on the floor. In this question, we’ll go through the computation of the probability
that no two matching socks are next to each other.
(a) We can consider the sample space as the set of length 2n permutations. What is the size of the
sample space Ω, and what is the probability of a particular permutation ω ∈ Ω?
(b) Let Ai be the event that the ith pair of matching socks are next to each other. Calculate P[Ai ].
(d) Putting these all together, calculate the probability that there is at least one pair of matching
socks next to each other. Your answer can (and should) be expressed as a summation. (Hint:
use Inclusion/Exclusion.)
(e) Using your answer from the previous part, what is the probability that no two matching socks
are next to each other? (This should follow directly from your answer to the previous part, and
also can be left as a summation.)
Solution:
(b) Consider the ith matching pair as a single, condensed unit. As an example, in for n = 3, an
original permutation could look like 132213. Let us condense both the 2’s together, and label
it as B. Then, a resulting string would look like 13B13. Then, there are 2n − 1 ’units’ left that
we can order, and thus (2n − 1)! ways to order them. Also, when we condensed them, either
the left sock or the right sock could’ve came first, so there are 2 ways to condense this pair.
Thus, the probability is 2(2n−1)!
(2n)! .
(c) We will employ an analogous strategy to the previous part. We will consider all k of these
matching socks. There are 2k ways to condense them. Once condensed, there are (2n − k)!
ways to order the remaining units. Thus, the probability is 2k (2n−k)!
(2n)! .