**Normal distribution random**

Pretty sure I haven't seen that one before.

So what exactly is its usage, I mean besides a random generator. I get mean, but sigma???

NormalRandom(mean, sigma)

8 posts
• Page **1** of **1**

Stolen pic from wikipedia:

click for image (didn't embed properly)

Basically, it generates a random number with that kind of distribution. mean = peak, sigma is proportional to the width of the bell shape, and numbers are more likely to be generated where the graph is higher. Note it goes off infinitely in either direction so in theory it could generate any number no matter the mean and sigma, but most of those values would be nigh on impossible. You can always clamp the output for a certain range.

click for image (didn't embed properly)

Basically, it generates a random number with that kind of distribution. mean = peak, sigma is proportional to the width of the bell shape, and numbers are more likely to be generated where the graph is higher. Note it goes off infinitely in either direction so in theory it could generate any number no matter the mean and sigma, but most of those values would be nigh on impossible. You can always clamp the output for a certain range.

**Posts:**24,207**Reputation:**191,712

Scirra Founder

B

386
S

229
G

87
This might be useful, despite thread necromancy from 2008.

Sigma is the Standard Deviation for a Normal curve. For any given normal curve (shown in that linked picture above) there is a standard deviation where ~34% either side of the mean (peak) will fall.

There's a great picture on the wikipedia page:

[url:2xpqpmdh]http://en.wikipedia.org/wiki/Normal_distribution#Standardizing_normal_random_variables[/url:2xpqpmdh].

Normal random vs ...*typical* random.

If you drew a normal random from 100, you are equally as likely to get 2 or 98 (each is 1/100 chance) as you are to get 45, 50, 60, 73 etc. With a normal curve, the further you are from the mean (50), the lower the chance of that number appearing. So, 2 or 98 will occur very infrequently (~1%) and most results will land around the 50 mark. If your sigma is larger, then the curve is flatter and in the 1-100 example, there will be a greater chance to get numbers between 30 and 70.

This is a really cool feature, although I haven't actually found a use for it yet.

Sigma is the Standard Deviation for a Normal curve. For any given normal curve (shown in that linked picture above) there is a standard deviation where ~34% either side of the mean (peak) will fall.

There's a great picture on the wikipedia page:

[url:2xpqpmdh]http://en.wikipedia.org/wiki/Normal_distribution#Standardizing_normal_random_variables[/url:2xpqpmdh].

Normal random vs ...

If you drew a normal random from 100, you are equally as likely to get 2 or 98 (each is 1/100 chance) as you are to get 45, 50, 60, 73 etc. With a normal curve, the further you are from the mean (50), the lower the chance of that number appearing. So, 2 or 98 will occur very infrequently (~1%) and most results will land around the 50 mark. If your sigma is larger, then the curve is flatter and in the 1-100 example, there will be a greater chance to get numbers between 30 and 70.

This is a really cool feature, although I haven't actually found a use for it yet.

**Posts:**42**Reputation:**884

B

2
S

1
G

2
Actually since your output can range from positive to negative, unlike the regular random, I found its quite useful for generating a random sinus curve.

With that you can make a ai type movement that is limited to a set of certain x, or y coords on the screen without using clamp.

With that you can make a ai type movement that is limited to a set of certain x, or y coords on the screen without using clamp.

**Posts:**8,173**Reputation:**103,442

B

167
S

50
G

160
8 posts
• Page **1** of **1**

Return to Help & Support using Construct Classic

## Who is online |

Users browsing this forum: No registered users and 1 guest |