You are given a black-box function, notrand(), which returns 0 with 60% probability and 1 with 40% probability. Create a new function, rand(), which returns 0 and 1 with equal probability (i.e. 50% each) using only notrand() as your source of randomness.
I've heard many interesting approaches to the problem. I'll post my own solution later after hearing some from the community!