

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!


CS 5150/6150: Graduate Algorithms Nov 21, 2007
DUE DATE: Dec 3, 2007
A fair coin is one that gives heads and tails with probability 0.5. In all randomized algorithms, we assume that we have access to a source of bits that is fair: i.e gives 0 and 1 with equal probability.
But in general, we may not be so lucky. Coins can be biased, even if slightly so. What’s worse, we may not even know how they are biased, if at all. So how do we generate fair bits?
a) A trick that dates back to Von Neumann solves this problem. Suppose we have a coin that generates heads and tails with different probabilities (that sum to one, of course). Toss the coin twice: if it returns HT, return H; if it returns TH, return T. If it returns HH or TT, discard this pair of throws and repeat. Show that this scheme is correct, in that in the sequence of Hs and Ts it generates, each occurs with equal probability. Notice that you don’t even need to know the actual biased probabilities!
b) The problem with the above scheme is that we waste some tosses. First of all, we have to toss the coin twice to get one bit, and secondly we might have to discard some throws. Suppose we toss the biased coin 2n times. What is the expected number of bits we will get out of it? Assume that the probability of tossing H is p 6 = 1/ 2.
When we toss a fair coin, we expect that we get roughly half-and-half Hs and Ts. Of course, this might not happen in general: the question is, how bad can the difference get?
Consider a sequence of 2 n coin tosses, and let XH be the number of heads and XT be the number of Ts in the resulting sequence. Obviously, EXH = EXT = n, and therefore E(XH − XT ) = 0. Show that for any > 0 , there exists a constant c such that
P r[XH − XT > c
n] ≤
Note the quantification: in general, c will be a function of .
Homework 5: Nov 21, 2007 5-
Solve Problem 13.3 from the textbook
Solve Problem 13.14 from the textbook
Solve Problem 13.16 from the textbook.