[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
Solved

# Gaussian distributed pseudorandom number generator

Posted on 2010-08-30
Medium Priority
562 Views
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
0
Question by:InteractiveMind
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points

LVL 74

Assisted Solution

sdstuber earned 200 total points
ID: 33561993
easiest way is to probably to sum groups of the random  numbers.  The central limit theorem dictates the sums should be a normal distribution
0

LVL 32

Accepted Solution

phoffric earned 800 total points
ID: 33561994
0

LVL 2

Assisted Solution

wslb earned 200 total points
ID: 33569444
As phoffric (give him most of the credit) says, http://www.bearcave.com/misl/misl_tech/wavelets/hurst/random.html
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;
``````
0

LVL 4

Assisted Solution

boocko earned 800 total points
ID: 33584092
0

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When we purchase storage, we typically are advertised storage of 500GB, 1TB, 2TB and so on. However, when you actually install it into your computer, your 500GB HDD will actually show up as 465GB. Why? It has to do with the way people and computers…
This article covers the basics of data encryption, what it is, how it works, and why it's important. If you've ever wondered what goes on when you "encrypt" data, you can look here to build a good foundation for your personal learning.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
###### Suggested Courses
Course of the Month13 days, 5 hours left to enroll