# Lecture 21 - Randomized Algorithms Flashcards

1
Q

Why do we use randomized algorithms?

A

Can lead to simplest, fastest, or only known algorithm for a particular problem.

2
Q

Define the Global Min Cut problem in words.

A

Given a connected, undirected graph G=(V,E), find a cut with minimum cardinality.

3
Q

Explain the Network solution to Gobal Min Cut.

A
• Replace every edge (u,v) with 2 antiparallel edges (u,v) & (v,u)
• Pick some vertex s, and compute min s-v cut for each other vertex v.
4
Q

True or False:

Global min-cut is harder that min s-t cut.

A

False

5
Q

Explain the Contraction algorithm.

A

・Pick an edge e = (u, v) uniformly at random.
・Contract edge e.
- replace u and v by single new super-node w
- preserve edges, updating endpoints of u and v to w
- keep parallel edges, but delete self-loops
・Repeat until graph has just two nodes v1 and v1.
・Return the cut (all nodes that were contracted to form v1)

6
Q

Does the contraction algorithm always return the optimal solution?

A

No.

7
Q

Prove:

The contraction algorithm returns a min cut with prob ≥ 2 / n^2.

A

Consider a global min-cut (A, B) of G.
・Let F* be edges with one endpoint in A* and other in B.
・Let k = |F
| = size of min cut
・in first step, algorithm contract an edge in F* with probability k/ |E|
・Every node has degree >= k since otherwise (A,B) would not be a min-cut => |E| >= 1/2 k n <=> k/ |E| <= 2/n
・Thus, algorithm contracts an edge in F
with probability <= 2/n.

ITERATE
・Let G’ be graph after j iterations. There are n’ = n – j supernodes.
・Suppose no edge in F* has been contracted. The min-cut in G’ is still k.
・Since value of min-cut is k, | E’ | ≥ ½ k n’.
・Thus, algorithm contracts an edge in F* with probability ≤ 2 / n’.
・Let Ej = event that an edge in F* is not contracted in iteration j

Pr[E1 ∩E2 … ∩ En−2 ] = Pr[E1] × Pr[E2 | E1] × … × Pr[En−2 | E1∩ E2…∩ En−3]
≥ ( 1 - 2/n) (1-2/(n-1)) … (1-2/4) ( 1-2/3)
= 2/n(n-1)
≥ 2/n^2

8
Q

In the contraction algorithm, why does every node have a degree >= k? (VERY IMPORTANT)

A

If one node had less than k degrees, we could put that node in one partition vs every other node, and that cut would be the new min-cut.

9
Q

What’s the probability of the algorithm failing after n^2ln*n times?

A

<= 1/n^2

10
Q

Define the maximum 3-satisfiability problem.

A

Given a 3-SAT formula, find a truth assignment that satisfies as many clauses as possible.
ex:
C1 = x2 or not(x3) or not(x4) etc..

11
Q

Prove:

Given a 3-SAT formula with k clauses, the expected number of clauses satisfied by a random assignment is 7k / 8.

A

Consider random variable
Zj = 1 if clause Cj is satisfied
0 otherwise

Let Z = weight of clauses satisfied by assignment Zj
E[Z] = sum(j=1->k) E[Zj]
= sum(j=1->k) Pr [ Clause Cj is satisfied]
= 7/8k

12
Q

Prove: For any instance of 3-SAT, there exists a truth assignment that satisfies at least a 7/8 fraction of all clauses.

A

Random variable is at least its expectation some of the time.

13
Q

Prove: The probability that a random assignment satisfies ≥ 7k / 8 clauses is at least 1 / (8k).

A

Pf. Let pj be probability that exactly j clauses are satisfied;
let p be probability that ≥ 7k / 8 clauses are satisfied.

see slide (17)

Rearranging terms yields p ≥ 1 / (8k). ▪

14
Q

What’s the Johnson’s algorithm?

A

Repeatedly generate random truth assignments until one of them satisfies ≥ 7k / 8 clauses.

15
Q

Prove the following: Johnson’s algorithm is a 7/8-approximation algorithm

A

By previous lemma, each iteration succeeds with probability ≥ 1 / (8k).

By the waiting-time bound, the expected number of trials to find the satisfying assignment is at most 8k. ▪

16
Q

Define the Monte Carlo and Las Vegas algorithms and their difference. Give an example of each.

Which one can always be converted into the others, and not vice versa?

A

Monte Carlo: Guaranteed to run in poly-time, likely to find correct answer.
Ex: Contraction algorithm for global min cut.

Las Vegas: Guaranteed to find correct answer, likely to run in poly-time.
Ex: Randomized quicksort, Johnson’s MAX-3-SAT algorithm.

Can always convert a Las Vegas algorithm into Monte Carlo, but no known method (in general) to convert the other way.