Question: Describe a procedure that takes as input two integers a and b such that 0 < a < b and, using fair coin flips, produces
Describe a procedure that takes as input two integers a and b such that 0 < a < b and, using fair coin flips, produces as output heads with probability a/b and tails with probability (b – a)/b. Give a bound on the expected number of coin flips, which should be O(1). Represent a/b in binary.
Step by Step Solution
3.42 Rating (155 Votes )
There are 3 Steps involved in it
This is actually tricky You represent abab as binary Then you start flipping ... View full answer
Get step-by-step solutions from verified subject matter experts
