
CS 174, Fall, 05, Steiger
Instructions: Do all your work in the blue exam books. Please write your answers IN
THE GIVEN ORDER, though you may solve problems in any order. There is no need to
reduce answers to simplest terms. You may use one page of prepared notes, but all work
must be your own. Show ALL your work. You will get little or no credit for an
unexplained answer. The value of each question appears in parentheses. Use this as a
guide in allocating your time. There are 80 points, and you have 80 minutes.
1. (10 pts) This question concerns Karger’s basic min-cut algorithm (ALG 0): We start
with a connected graph G = (V,E) having n vertices and m _ n − 1 undirected edges (each
of weight one). While our (multi)graph has more than 2 vertices we contract a randomly
chosen edge (deleting any loops). At the end we output the remaining edges that join the
final two vertices; they are a cut in the original G. In this problem G is a cycle of length
n−1 plus a single edge attached to it (so G has n vertices and edges which we take as v
1
v
2
,
v
2
v
3
, . . . , v
n−2
v
n−1
, v
n−1
v
1
and v
1
v
n
).
(a) Draw G. Identify all min-cuts of G. What is the probability that the first edge selected
by the algorithm is NOT in a min cut?
(b) What is the probability that ALG 0 will find a min-cut? Explain your answer (you
should describe how G contracts to the final min-cut during a successful contraction
sequence, showing the last two contraction steps). Can you think of a connected graph
with n vertices on which the algorithm is certain to find a min cut?
2. (30 pts) X and Y are random variables on the same probability space. X has mean E(X)
= 2, variance V (X) = 9, and P(X > 10) = 0. Y has mean E(Y ) = 3, and E(XY ) = 6. For
each of the following statements, decide whether it is TRUE or FALSE (“TRUE” means
that the statement must always be true for random variables satisfying the given
conditions). If you say TRUE, give a convincing reason. If you say FALSE, give a
counter-example.
(a) P(Y = 3) < 1
(b) P(X ≥ 1) ≥ 1/10
(c) V (X + Y) = 9 + V (Y )
(d) P(X ≥ 8) ≤ 1/4
(e) P(X ≥ 5) ≤ 2/5
(f) X and Y are independent.
3. (20 pts) This question deals with random permutations. The probability space is S = {π
= (π
1
< · · · <π
k
)} of permutations of 1, . . . , n under equally likely probability. Here n =
2k + 1 is odd.
(a) Let A be the event that the first k elements of π are increasing (π
1
< · · · <π
k
)? Find
P(A) and explain how you did it. Next, explain in English how you would efficiently
generate a permutation in A under equally likely probability. What is the running time of
your algorithm?
(b) Let B be the event that the last k +1 elements of π are decreasing (π
k+1
> · · · > π
2k+1
).
Find P(B) and explain how you did it. Are A and B independent? Explain.