Quantlab Interview Question

How do you sample uniformly from a unit circle?

Interview Answers

Anonymous

Jan 10, 2018

The unit circle probably refers to the area inside the circle, not just the edge of it as fermi answered. You can sample from the unit square then use rejection sampling: if it falls inside the circle, use it as a sample, if it falls outside the circle, throw it away and try again.

Anonymous

Dec 9, 2017

The unit circle is equivalent to the 1D interval [0, 2pi]. Just sample uniformly from U[0,1] and multiply by 2pi and we get uniform sampling over the unit circle.