Problem bank
Problem 251 of 333MediumCodingP251
Uniform point in a disk without rejection
Write a function that returns a uniformly distributed point in the unit disk using exactly two calls to
random.random()and no retry loop. A colleague proposes , . What fraction of the colleague's points land within distance of the center, and what fraction should?See the hint and solution with a free account
Every problem on Quant Engine is free, with a hint and a full worked solution. Making an account takes 30 seconds and no card. Then you can see them and track what you have solved.