hw10_sol.pdf
hw10_sol.pdf
Note: This homework consists of two parts. The first part (questions 1-5) will be graded and will
determine your score for this homework. The second part (questions 6-7) will be graded if you
submit them, but will not affect your homework score in any way. You are strongly advised to
attempt all the questions in the first part. You should attempt the problems in the second part only
if you are interested and have time to spare.
For each problem, justify all your answers unless otherwise specified.
(e) In general, let IA and IB be the indicators for events A and B in a probability space (Ω, P). What
is E[IA IB ], in terms of the probability of some event?
Solution:
P[X = 0] = P[X = 0,Y = 0] + P[X = 0,Y = 1] + P[X = 0,Y = 2] = 1/3 + 0 + 1/3 = 2/3
As a sanity check, these three numbers are all positive and they add up to 2/3 + 1/9 + 2/9 = 1
as they should. The same kind of calculation gives
and thus
(d) We know that taking the expectation of an indicator for some event gives the expectation of
that event, so
The random variable IJ is equal to one if I = 1 and J = 1, and is zero otherwise. In other
words, it is the indicator for the event that I = 1 and J = 1:
(e) By what we said in the previous part of the solution, IA IB is the indicator for the event A ∩ B,
so
E[IA IB ] = P[A ∩ B].
Solution:
(a) No such random variables can exist; let’s prove it by contradiction. From the desired joint
distribution of X1 and X2 , we claim that X1 = −X2 (by which we mean that for every ω in the
sample space X1 (ω) = −X2 (ω)). Similarly, we would need to have X2 = −X3 and X3 = −X1 .
But now
X1 = −X2 = X3 = −X1 ,
a contradiction since X1 ∈ {+1, −1}.
(b) This is only possible if n is even. When n = 2k + 1, the same argument as above gives us
a contradiction for the same reason as before. However, when n = 2k, we can set X1 , ..., X2k to
have the joint distribution
3 Random Tournaments
A tournament is a directed graph in which every pair of vertices has exactly one directed edge
between them—for example, here are two tournaments on the vertices {1, 2, 3}:
In order for each σ to correspond to an actual Hamiltonian path in T , the edges σ (i) → σ (i + 1),
for i = 1, ..., n − 1 must all be included in the graph. Since the orientations of the edges in T are
independent, with σ (i) → σ (i + 1) occurring with probability 1/2, the probability that they are all
included is 2−(n−1) . There are n! possible permutations, so we have
n!
E [# Hamiltonian Paths] = .
2n−1
The situation for Hamiltonian cycles is similar. Each possible Hamiltonian cycle each possible
cycle corresponds to a permutation σ , but this time in order for σ to be a valid Hamiltonian cycle,
T must include the edges σ (i) → σ (i + 1) for all i = 1, ..., n − 1, as well as the edge σ (n) → σ (1).
As above, these n edges are oriented independently of one another, so
n!
E [# Hamiltonian Cycles] = .
2n
connecting vertices 1, 2, and 3. Thus the probability that all three of these edges exist is
n
3 (2)−3
3 m−3
P[1, 2, and 3 form a triangle] =
(n2)
m
In fact, there was nothing special about vertices 1, 2, 3 in this calculation. The probability that
the three edges connecting some triplet of distinct vertices i, j, k is equal to the quantity above.
Now, for each subset {i, j, k} ⊂ {1, ..., n}, let Ii, j,k be the indicator that these three vertices form a
triangle. We then have
5 Variance
A building has n upper floors numbered 1, 2, . . . , n, plus a ground floor G. At the ground floor, m
people get on the elevator together, and each person gets off at one of the n upper floors uniformly
at random and independently of everyone else. What is the variance of the number of floors the
elevator does not stop at?
Solution: Let N be the number of floors the elevator does not stop at. We can represent N as the
sum of the indicator variables I1 , . . . , In , where Ii = 1 if no one gets off on floor i. Thus, we have
n − 1 m
E[Ii ] = P[Ii = 1] = ,
n
and from linearity of expectation,
n n − 1 m
E[N] = ∑ E[Ii ] = n .
i=1 n
Note: This concludes the first part of the homework. The problems below are optional, will not
affect your score, and should be attempted only if you have time to spare.
It may be useful to prove that X = XI, and to consider the random variable (X +aI)2 for various
values of a ∈ R.
Solution:
(a) Directly from the definition, E[X] = ∑ω∈Ω P[ω]X(ω), and the right hand side is a sum of
nonnegative terms.
(b) Let’s write the sum using the indicators I1 , ..., In for the events A1 , ..., An . Then,
n n n n hn n i
∑ ∑ αiα j P[Ai ∩ A j ] = ∑ ∑ i j ij
α α E[I I ] = E ∑ ∑ αiα j IiI j
i=1 j=1 i=1 j=1 i=1 j=1
h n n i h n 2 i
=E ∑ αiIi ∑ α j I j = E ∑ αi Ii ≥ 0.
i=1 j=1 i=1
(c) As suggested, note that X = XI, since if X(ω) = 0, then I(ω) = 0, and if X(ω) > 0, I(ω) = 1.
We know that for any a, (aX + I)2 is a positive random variable, so from the first part of the
problem,
0 ≤ E[(aX + I)2 ] = a2 E[X 2 ] + 2a E[XI] + E[I 2 ] = a2 E[X 2 ] + 2a E[X] + P[X > 0].
Rearranging gives
P[X > 0] ≥ −2a E[X] − a2 E[X 2 ],
and setting a = − E[X]/ E[X 2 ] will give us the requested lower bound.
(a) As a warm-up, let’s compute the probability that 1 and 2 are swapped. There are n! possible
permutations, and (n − 2)! of them have π(1) = 2 and π(2) = 1. This means
(n − 2)! 1
P[(1, 2) are a swap] = = .
n! n(n − 1)
There was nothing special about 1 and 2 in this calculation, so for any {i, j} ⊂ {1, ..., n}, the
probability that i and j are swapped is the same as above. Let’s write Ii, j for the indicator that
i and j are swapped, and N for the total number of swaps, so that
" #
1 n 1
E[N] = E ∑ Ii, j = ∑ P[(i, j) are swapped] = n(n − 2) 2 = 2 .
{i, j}⊂{1,...,n} {i, j}⊂{1,...n}
(b) For the variance, when we expand N 2 as a sum over pairs {i, j}, {k, l}, we’ll need to know
E[Ii, j Ik,l ], which is just the probability that i and j are swapped and k and l are swapped as
well. There are three cases to consider. If {i, j} = {k, l}, then the probability is exactly what
we computed above. If the two pairs share one element, then it is impossible that they are both
swaps. If the pairs are disjoint, then of the n! possible permutations, (n − 4)! include the two
swaps we are concerned with. Thus
For the variance, we need to know E[I(i1 ,...,is ) I( j1 ,..., js ) ], the probability that both (i1 , ..., is ) and
( j1 , ..., js ) are s-cycles. We have already computed this probability if the two cyclic orderings
are the same, and we know that it is zero if they overlap but are not equal. If they are dis-
joint, then there are (n − 2s)! permutations in which both are s-cycles, so E[I(i1 ,...,is ) I( j1 ,..., js ) ] =
(n−2s)!
n! , and there are
n! (n − s + 1)! 1
(n − s)! (n − 2s)! s2
ways to choose the two disjoint cyclic orderings, so mirroring the calculation earlier,
1 1
E[N 2 ] = + ,
s s2
and var(N) = 1s .