0
$\begingroup$

Can one uniformly generate complex numbers of absolute value less than a given constant R?

This would appear to be equivalent to picking points $(x,y)$ uniformly in a disk of radius R, where $x$ is the real component of the complex number, and $y$, its complex component.

This question appears to differ from numerous others that have been asked, in that $R$ is not assumed to equal 1 (that is, the unit disc).

(Note: I am a Mathematica user MathematicaQuestions, not an R [no pun, intended] user.)

$\endgroup$
1
  • 1
    $\begingroup$ You may always take $R=1$ by choosing the disk's radius to be your unit of measurement. Regardless, fully general answers have been posted in the duplicate threads. $\endgroup$
    – whuber
    Commented Dec 29, 2020 at 19:18

1 Answer 1

0
$\begingroup$

The MathWorld entry DiskPointPicking asserts (without an explicit proof) that to generate uniformly distributed points ($x,y)$ in the unit disk, one should employ \begin{equation} x=\sqrt{r} \cos{\theta},\hspace{.2in} y=\sqrt{r} \sin{\theta}. \end{equation} where $r \in [0,1]$, and $\theta \in [0, 2 \pi]$ are uniformly distributed variables.

So for points ($x,y)$ in a disk of radius $R$, it appears then that one should employ \begin{equation} x=\sqrt{\tilde r} \cos{\theta},\hspace{.2in} y=\sqrt{\tilde r} \sin{\theta}. \end{equation} where $\tilde r \in [0,R^2]$, and $\theta \in [0, 2 \pi]$ are uniformly distributed variables.



Upon further reflection/application, I'm somewhat confused here by my original answer (trying to apply the MathWorld argument).

Say, the maximum absolute value $R$ of the complex numbers $x+ I y$, I want to generate is $\frac{1}{2}$. Now (assuming $x=y$, which seems permissible), we have the relation, \begin{equation} \sqrt{(\frac{1}{\sqrt{8}})^2+(\frac{1}{\sqrt{8}})^2}=\sqrt{\frac{1}{4}}= \frac{1}{2}. \end{equation}

So, it seems that I want to choose $\tilde{r}$--before taking its square root--from $[0,\frac{1}{8}]$, not $[0,R^2 =\frac{1}{4}]$.

???

$\endgroup$
3
  • $\begingroup$ The proof for the radius distribution is that $(\rho,\theta)$ has density$$\rho\mathbb I_{0<\rho<R}\mathbb I_{0<\theta<2\pi}/R^2\pi$$ when moving from Euclidean to polar coordinates. Hence $r=\rho^2$ has density$$\mathbb I_{0<r<R^2}/R^2$$ $\endgroup$
    – Xi'an
    Commented Dec 29, 2020 at 10:00
  • $\begingroup$ @Xi'an Don't understand the double-bar notation. $\endgroup$ Commented Dec 29, 2020 at 18:10
  • 1
    $\begingroup$ $\mathbb I$ is an indicator function. $\endgroup$
    – whuber
    Commented Dec 29, 2020 at 19:20

Not the answer you're looking for? Browse other questions tagged or ask your own question.