Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

Math.Random.NormalDistribution

Generates a random number using normal distribution.

Component Version macOS Windows Linux Server iOS SDK
Math 14.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "Math.Random.NormalDistribution"; Mean; StdDev )   More

Parameters

Parameter Description Example
Mean The mean value to use. 1
StdDev The standard deviation. 1

Result

Returns number or error.

Description

Generates a random number using normal distribution.
Generates random numbers according to the Normal (or Gaussian) random number distribution.

Examples

Get a list of 10 values:

While(
    [
        count = 10;
        sum = 0;
        i = 0;
        list = ""
    ];
    i < count;
    [
        value = MBS( "Math.Random.NormalDistribution"; 5; 2);
        sum = sum + value;
        list = list & value & ¶;
        i = i + 1
    ];
    list & ¶ & sum / count
)

Example result:
3.6038098422522244491
2.5246072415246310072
5.0915417012534662788
2.8356611605875863269
6.554846411893681335
6.5520748518280109707
3.7975706085274518742
3.0501099719076316674
4.7609487612221670361
6.0470189060110168811

4.4818189457007867827

See also

Release notes

Blog Entries

This function is free to use.

Created 2nd December 2023, last changed 2nd December 2023


Math.Random.ExponentialDistribution - Math.Random.PoissonDistribution

💬 Ask a question or report a problem