Pergunta de entrevista da empresa Quantlab

How do you sample uniformly from a unit circle?

Respostas da entrevista

Sigiloso

10 de jan. de 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.

Sigiloso

9 de dez. de 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.