# Thread:

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:
$<br /> 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:
$<br /> 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.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 10, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.8882752656936646, "perplexity_flag": "middle"}