Hi,

Let f() gives 0 with probability 0.6 and 1 with probability 0.4.

boolean f50() {
int p = f();
int q = f();
if (p==1 && q==0) return 1;
else if (p==0 && q==1) return 0;
else return f50();
}

On Mon, Jul 18, 2011 at 2:18 PM, SkRiPt KiDdIe <anuragmsi...@gmail.com>wrote:

> int generate()
> {
> x=bit();
> y=bit();
> if(x^y == 0) return generate();
> return x;
>
> }
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 

Atul Purohit

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to