Problem bank

Problem 251 of 333MediumCodingP251

Uniform point in a disk without rejection

  1. 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 r=U1r = U_1, θ=2πU2\theta = 2\pi U_2. What fraction of the colleague's points land within distance 1/21/2 of the center, and what fraction should?