

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


(a) Given a coin C of bias p, give an algorithm for generating a coin toss with bias 1 / 2 , using as few tosses of C (in expectation) as possible. Can you design an algorithm that does not require knowledge of p? (b) Sometimes, to the contrary, we have available a coin of bias 1 / 2 , but require a coin of bias p for some value p < 1 / 2. Give an algorithm for generating a coin toss of bias p using a coin C with bias 1 / 2 using as few tosses of C as possible. (c) Given a deck of n cards, you want to shuffle the cards so that any permutation of the cards is equally likely. Show how to do this using a coin of bias 1 / 2. How many coin tosses do you require?
e. Our goal is to find a maximum s-t flow in the graph with the minimum possible cost, where the cost of a valid flow f is defined as(f ) =e fee. We will solve this problem using the **min-cost circulation (MCC)** problem. A valid circulation is a flow f that satisfies capacity constraints, as well as flow-conservation at _every_ node, including s and t. In the MCC, our goal is to come up with a valid circulation f minimizing the cost(f ). Note that we do not require a “maximum” circulation; if the graph has no negative-cost cycles, then the optimal solution to the problem is a circulation that is zero on every edge.
(a) Give a polynomial-time reduction from MCMF to MCC.
Consider the following natural variant of Ford-Fulkerson for the MCC: Start with a zero flow, f = 0; maintain an appropriate residual graph Gf at every step; find a negative-cost cycle in Gf ; saturate this cycle with flow, add it to f , and recurse; the algorithm terminates when no negative-cost cycles are found.
(b) Specify how to set costs and capacities on the residual graph Gf. (c) Prove that the algorithm always terminates. (d) Prove that this algorithm solves the MCC correctly. (Hint: Suppose that a different circulation f ∗^ has smaller cost than f_. Use_ f ∗^ and f to find a witness to contradict the fact that the algorithm terminated.)
SELECT(An unordered list A, and an integer k) /* Finds the k-th largest element in list A */ (a) Pick an element of A uniformly at random, say x. (b) Partition A into A< and A>, where A< contains all the elements in A smaller than x and A> contains all the elements in A larger than x. (c) If |A>| = k − 1 , then return x. Else if |A>| ≥ k then run SELECT(A>, k). Else run SELECT(A<, k − |A>| − 1 ).
Prove that the expected running time of this algorithm is O(n). (Hint: Divide the process of selection into log n rounds, where in round i the size of the list under consideration is between 2 i^ and 2 i+1 , and analyze the expected running time of each round separately.)
(a) Consider the following na¨ıve algorithm—for some number p < 1 , the algorithm picks each subset inde- pendently with probability p. Assuming that every element is contained in exactly F subsets, compute the expected number of elements uniquely covered. For what value of p is this expectation maximized? (b) Assuming that each element is contained in at most F subsets and at least F/ 2 subsets, give a constant factor approximation to unique set cover using the algorithm from part (a). (c) Extend the algorithm from part (b) to obtain an O(log m) approximation in general (without assumptions on the frequency of any element). (Hint: Try reducing this problem to the one in part (b).) (d) Can you improve the approximation from part (c) to a factor of O(log n)?