You are on page 1of 1

Dr.

Surender Baswana

IS

UN

FR 6.2 Informatik

E R SIT

I N F O R M A T I K

SA

Universitat
des
Saarlandes

IV

A VIE N

WS 2004/5

Exercises for Randomized Algorithms


2. Assignment

Due : 26 November

Exercise 1 (4)
We have n balls numbered 1 to n and placed in a bag. We select a ball from the bag randomly, note its number
and place it back into the bag. Let its number be i. If i = 1, we stop, otherwise we continue selecting balls
(with replacement) until we select a ball with number less than i (the number of the ball selected at first). What
is the expected number of balls we need to pick before we stop ?
Exercise 2 (4+2)
A graph is empty if there are no edges in it. A graph is connected if there is a path between each pair of vertices.
Let S be the set of all possible edges in a graph of n vertices. We start with an empty undirected graph having
n vertices, and repeat the following step until the graph becomes connected :
Sample (with replacement) an edge from set S uniformly randomly and add it to the graph if it is not already
present in the graph.
Note that in the beginning of each step the set S is same (the set of all possible edges), so there is a possibility
that an edge is sampled more than once in this process, however, it is added to the graph only once.
a) Show that the expected number of samplings on the set S until the graph becomes connected is no more
than n loge n.
b) Now let us modify the sampling scheme as follows : each edge that gets sampled from the set S is
added to the graph and removed forever from S . Show that the expected number of samplings (without
replacement) on the set S until the graph becomes connected is no more than n loge n.
(Hint : use a) and stochastic dominance)
Hence, conclude that the expected number of edges in the final connected graph is no more than n loge n.
Exercise 3 (5)
Consider a person standing on a long straight road. The road is along east-west direction and assume that it is
endless in both the directions. The person moves one step every second towards either east or west on the road.
The probability of taking a step towards east or west is same and is independent of all the previous steps he has
p
taken. Show that after n seconds, he is with in 2 n loge n steps away from his starting point with probability
at-least 1 n12 .

You might also like