Domanda di colloquio di Quantlab

How do you sample uniformly from a unit circle?

Risposte di colloquio

Anonimo

10 gen 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.

Anonimo

9 dic 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.