Question: Suppose that Bob wants a constant-time method for implementing the random(k) method, which returns a random integer in the range [0, k 1]. Bob
Suppose that Bob wants a constant-time method for implementing the random(k) method, which returns a random integer in the range [0, k − 1]. Bob has a source of unbiased bits, so to implement random(k), he samples [log k] of these bits, interprets them as an unsigned integer, K, and returns the value K mod k. Show that Bob’s algorithm does not return every integer in the range [0, k − 1] with equal probability.
Step by Step Solution
3.30 Rating (165 Votes )
There are 3 Steps involved in it
Suppose we take k 10 Then before he performs his modular reductio... View full answer
Get step-by-step solutions from verified subject matter experts
