3
$\begingroup$

I know this question already asked and actually well explained in those answers, just one thing that actually confuses be in other answers what if i want to generate random points on the surface of n-Sphere with radius r uniformly?

As according to one of the algorithm, generate n-dimensional vector $[x_1,x_2,..,x_n]$, where $x_i$ is random numbers using Normal Distribution N(0,1) and then use following formula to generate random point on the surface of n-Sphere

$$\frac{1}{\sqrt{x_1^2+x_2^2+... +x_n^2}}[x_1,x_2,...,x_n]$$

I presume that this will generate random points uniformly on the surface of unit n-Sphere, so what if we want generate random points on the surface n-Sphere with arbitrary radius r do we need to change the variance in Normal distribution or what?

Please forgive me if its a stupid question.

Regards Ahsan

$\endgroup$
  • $\begingroup$ Just multiply the whole vector by $r$. $\endgroup$ – Rahul Jun 18 '14 at 23:31
  • $\begingroup$ Can u elaborate a bit please? $\endgroup$ – Ahsan Iqbal Jun 19 '14 at 0:03
  • 2
    $\begingroup$ Take the random vector on the unit $n$-sphere, $\frac1{\sqrt{x_1^2+\cdots+x_n^2}}[x_1,\ldots,x_n]$, and multiply it by $r$. $\endgroup$ – Rahul Jun 19 '14 at 2:19
  • $\begingroup$ Rahul is right. $\frac{r}{\sqrt{x_1^2+\cdots+x_n^2}}[x_1,\ldots,x_n]$ is a random vector on the $n$-sphere with radius $r$. $\endgroup$ – mike Jun 19 '14 at 14:00
  • $\begingroup$ Please link the relevant related questions $\endgroup$ – leonbloy Jun 19 '14 at 14:25
1
$\begingroup$

From a comment by Rahul:

Take the random vector on the unit $n$-sphere, $$\frac{1}{\sqrt{x_1^2+...+x_n^2}}[x_1,...,x_n]$$ and multiply it by $r$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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