# Math Help - Normal distribution Interpretation Algorithm

1. ## Normal distribution Interpretation Algorithm

Hi all, in a program I have to generate a random number using the Normal distribution, the algorithm found online, but I'd like to help us understand complemtamente the theoretical foundation behind it: Let's see:

The random number is generated by a normal distribution, which receives the parameters $\mu$ and $\sigma$, in my case $\mu = 80$, and $\sigma = 15$. The code is as follows:

Function xNORMAL(mu, sigma)
Dim NORMAL01
Const Pi As Double = 3.14159265358979
Randomize
NORMAL01 = Sqr((-2 * LN(Rnd))) * Sin(2 * Pi * Rnd)
xNORMAL = mu + sigma * NORMAL01
End Function
Function LN(x)
LN = Log(x) / Log(Exp(1))
End Function
In this part: xNORMAL = mu + sigma * NORMAL01, I understand that what they do is to clear the typing X given by:
$
Z = \displaystyle\frac{X- \mu}{\sigma}$

But I have no clear rationale behind this calculation:

I guess it is to find the value of the random variable on an integration of the density function that appears in this link:

Normal distribution - Wikipedia, the free encyclopedia

Whose limits in this case would be Ln (Rnd), is this how I think?

But why the function is expressed in terms of Sin (x)?. Perhaps using Fourier transform?

Thank you if you help me solve these questions.

A greeting.

Dogod.

2. Originally Posted by Dogod11
Hi all, in a program I have to generate a random number using the Normal distribution, the algorithm found online, but I'd like to help us understand complemtamente the theoretical foundation behind it: Let's see:

The random number is generated by a normal distribution, which receives the parameters $\mu$ and $\sigma$, in my case $\mu = 80$, and $\sigma = 15$. The code is as follows:

In this part: xNORMAL = mu + sigma * NORMAL01, I understand that what they do is to clear the typing X given by:
$
Z = \displaystyle\frac{X- \mu}{\sigma}$

But I have no clear rationale behind this calculation:

I guess it is to find the value of the random variable on an integration of the density function that appears in this link:

Normal distribution - Wikipedia, the free encyclopedia

Whose limits in this case would be Ln (Rnd), is this how I think?

But why the function is expressed in terms of Sin (x)?. Perhaps using Fourier transform?

Thank you if you help me solve these questions.

A greeting.

Dogod.