You are on page 1of 12

1. Random graphs!

Let Gn,p be an undirected graph with no multiedges, where each edge has
a probability p of existing independently of all other edges.
(a) Whats the probability that the graph is fully connected? (every edge exists).
(b) What is the expected number of triangles? (3 nodes that are all connected to each other)
(c) For Gn,p , whats the probability it has exactly n edges?

Solution:
n
(a) p( 2 )

(b) n3 p3
n 
n
(c) (n2 ) pn (1 p)( 2 )n

2. Whats wrong with the following?


(a) For Gn,p , if T is the number of triangles, then T B

n
3


, p3 . So E[T ] =

n
3

p3

(b) You have a plane with n seats and n passengers. Each passenger sits in a random seat.
However, if 1 passenger gets in their correct seat, then they every passenger will get up
and sit in their correct seat. Whats the expected number of passengers who sit in their
correct seat?
Proposed solution: Let X be the number of passengers that sit in their correct seat. Let
Xi be the indicator that passenger i sat in their correct seat. X = X1 + + Xn , so
E[X] = E[X1 ] + + E[Xn ] = n E[X1 ] = n n1 = 1.

Solution:
(a) T isnt binomially distributed because because each triangle happening isnt independant
of the others triangles happening. For example, if one triangle happens, then the adjacent
triangles are more likely to happen because some of their edges already exist.
(b) Wrong because E[X1 ] 6= n1 . The passengers are more likely to find their seat because if
any passenger finds their seat, then every passenger will.

3. You want to find the actual fraction of people f who smoke weed in Berkeley, but are scared
that people will lie if you simply poll them so youll get incorrect results. One great way to
circumvent this is to ask people to lie with some probability p (e.g. make them lie 40% of
the time) so that they feel safe doing what we tell them to, and no one will know their actual
answer. However, we can still estimate the true fraction of the Berkeley population that
smokes weed from these noisy measurements.
(a) Assume, after polling people in this special manner, you found the fraction of n Berkeley
students that smoke weed to be q. From this, find an unbiased estimate f for the true
fraction of Berkeley students who smoke weed.
(b) Using Chebyshevs inequality, find a sufficiently large n so that f is within  of the true f
with probability at least 1 . Focus more on setting up equations from your knowledge
of probability. Dont focus as much on the algebra and solving. (Hint: recall that a
bound on the variance for ANY Bernoulli r.v. is 14 ).

Solution:

Our estimator, f solves the equation




q = (1 p) f + p 1 f

so we get that

qp
f =
1 2p

A bound on the variance of this unbiased estimator will be


 
1
V ar f
4n (1 2p)2
So we get the final relation to make our estimator good enough:
1

2p)2

4n2 (1
So the number of samples we need is
n

1
2p)2

42 (1

1
which is just more than usual by a factor of (12p)
2 . For a lieing probability of p = 35%, this
corresponds to needing around 11 times more samples.

4. You have a coin that is equally likely to have a bias of either p > .5 or 1 p < .5. We want
to bound the number of times we need to flip the coin until were sure with probability 1
which bias we have.
(a) Our rule for guessing which bias we have will be to choose the p bias if we have more
than half heads, choose the 1 p bias if we have less than half heads, else we simply give
up and get the answer wrong if we get exactly half heads. If we toss the coin n times,
use Chebyshevs to bound the probability that this guessing scheme will make an error.
(b) Find a sufficiently large n such that the probability of error is at most .

Solution:

Probability of making an error, by Chebyshevs, will be bounded by


p (1 p)
(p .5)2 n

so the number of flips we need is bounded by


n

p (1 p)
(p .5)2

5. Youre trying to teach a student a concept. He starts off knowing the concept with probability
0. Every day, if he doesnt know the concept, hell learn it with probability 1 p, and if he
does know the concept, he wont forget it. Teaching the student costs C dollars every day.
You get a reward R dollars if you stop teaching the student and hes actually learned the
concept, else you get a reward of 0. How many days n should you teach the student so that,
on average, you get the maximum reward in dollars? You can leave n as a non-integer number
d x
of days. (Hint: dx
a = ax ln a)

Solution:

If you teach a student for n days, then the average reward you get will be
(1 pn ) R Cn

To maximize this, we find when the derivative with respect to n gives 0 and get that
   
R
ln ln p1 C
 
n=
ln p1

10

6. You and 2 other friends are entering a martial arts tournament with 2n people (including you
three). You dont want to fight each other for the first round. Assuming everyone is paired
randomly to fight in the first round, whats the probability you and your two friends dont
have to fight each other?

11

Solution: The number of possible pairings: (2n)!


n!2n . The number of pairings where 2 of

3 (2(n1))!
you are fighting: 2 (n1)!2n1 . So the probability you guys arent fighting (after a lot of
simplification) is
3
1
2n 1

12

You might also like