easiest way is to probably to sum groups of the random numbers. The central limit theorem dictates the sums should be a normal distribution

Solved

Posted on 2010-08-30

Suppose X is a uniform random variable in the interval [0,1), how do I transform it so as to form a Gaussian distribution?

Thanks

Thanks

4 Comments

http://www.bearcave.com/mi

http://www.taygeta.com/ran

But here are the details you want:

You call your random number X, int he code below, each call to randf() returns another pseudorandom number. If you're not used to c programming, note the the point of the

do {...} while while ( w >= 1.0 );

part is to keep trying the {..} portion until you get a w<1. Once you have x1 and x2 that result in w<1, then you use them to calculate the Gaussina-distributed pseudorandom number y1.

```
// from http://www.taygeta.com/random/gaussian.html
// Algorithm by Dr. Everett (Skip) Carter, Jr.
float x1, x2, w, y1, y2;
do {
x1 = 2.0 * ranf() - 1.0;
x2 = 2.0 * ranf() - 1.0;
w = x1 * x1 + x2 * x2;
} while ( w >= 1.0 );
w = sqrt( (-2.0 * ln( w ) ) / w );
y1 = x1 * w;
```

http://en.wikipedia.org/wi

Title | # Comments | Views | Activity |
---|---|---|---|

Statistics & Data Sceicne | 2 | 78 | |

Visual Studio unable to copy the file ‘Application.Designer.vb’ from the project template to the project. Access is denied. | 15 | 83 | |

recursion example | 16 | 68 | |

hardness of water, iron in it, and effect on humans.. | 6 | 37 |

This tutorial demonstrates a quick way of adding group price to multiple Magento products.

Join the community of 500,000 technology professionals and ask your questions.

Connect with top rated Experts

**19** Experts available now in Live!