![]() |
| サイトマップ | |
|
この関数は、指定した平均と標準偏差を使って、指定した個数分の正規分布 (ガウスあるいは ”bell” の形状) に従う数値をシード値にもとづいて発生させます。
gaussian
(number, seed, mean, stddev)
引数 number は発生させる乱数の数を指定します。
引数 seed は関数で使用する乱数発生の種 (シード) です。毎回発生させる乱数の配列を違うものにしたい場合は、引数 seed に 0/0 を指定します。同じ数値を入力すると同じ乱数の配列を発生させることができます。引数 seed を省略すると無作為に選択されたシード値が使用されます。
引数 mean と stddev は正規分布曲線のそれぞれ平均と標準偏差を指定します。これらを省略すると、平均 0、標準偏差 1 の規定値が適用されます。
関数の引数は右から左に省略していく点に注意してください。引数 stddev を指定したい場合は、引数 mean に特定の値を指定するか、引数 mean に 0/0 を指定してその省略を明示する必要があります。
gaussian(100)
では、0 をシード値として平均 0.0、標準偏差 1.0 の正規分布に従う 100 個の数値を発生します。
This function generates a specified number of normally (Gaussian or “bell” shaped) distributed numbers from a seed number, using a supplied mean and standard deviation.
gaussian(number,seed,mean,stddev)
The number argument specifies how many random numbers to generate.
The seed argument is the random number generation seed to be used by the function. If you want to generate a different random number sequence each time the function is used, enter 0/0 for the seed. Enter the same number to generate an identical random number sequence. If the seed argument is omitted, a randomly selected seed is used.
The mean and stddev arguments are the mean and standard deviation of the normal distribution curve, respectively. If mean and stddev are omitted, they default to 0 and 1.
Note that function arguments are omitted from right to left. If you want to specify a stddev, you must either specify the mean argument or omit it by using 0/0.
The operation gaussian(100) uses a seed of 0 to produce 100 normally distributed random numbers, with a mean of 0.0 and a standard deviation of 1.0.