Showing posts with label Random Number Generator. Show all posts
Showing posts with label Random Number Generator. Show all posts

Monday, April 30, 2012

Given a function bool Zoo(int x) and its called for y times , how you will generate the true with probability x/y times .

lest say if x = 65 & y=100, how will you generate true with probability 65/100. You can represent true by 1 and false by 0.