Docsity

Algorithms Homework 5: Fair Bias and Discrepancy in Coin Tossing, Assignments of Algorithms and Programming

Toggle sidebar
bg1
CS 5150/6150: Graduate Algorithms Nov 21, 2007
Homework 5
DUE DATE: Dec 3, 2007
5.1 Biased Coins
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 p6= 1/2.
5.2 Discrepancy
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 2ncoin tosses, and let XHbe the number of heads and XTbe 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 csuch that
P r[XH−XT> c√n]≤
Note the quantification: in general, cwill be a function of .
5-1
pf2

Partial preview of the text

Download Algorithms Homework 5: Fair Bias and Discrepancy in Coin Tossing and more Assignments Algorithms and Programming in PDF only on Docsity!

CS 5150/6150: Graduate Algorithms Nov 21, 2007

Homework 5

DUE DATE: Dec 3, 2007

5.1 Biased Coins

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.

5.2 Discrepancy

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-

5.3 Contention Resolution

Solve Problem 13.3 from the textbook

5.4 Randomized Load Balancing

Solve Problem 13.14 from the textbook

5.5 Decoding over a noisy channel

Solve Problem 13.16 from the textbook.