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.

No comments :