randomGaussian()

Generate a random number based on a Gaussian probablity distribution

Example

    circle(randomGaussian(150, 15), randomGaussian(150, 15), 25)

Syntax

randomGaussian([mean], [std])
InputDescription

mean

the mean of the distribution

std

the standard deviation of the distribution

    circle(randomGaussian(150, 50), randomGaussian(150, 50), 25)a

Description

This function picks a random value from a gaussian distribution of a specified mean µ and standard deviation σ. The gaussian distribution prefers those points around the mean more that others. The farther the point is from the mean the less likely it is to be picked. But how far? the standard deviation parameter specifies that.

f(x)=1σ2π e12(xμσ)2f(x) =\frac 1 {\sigma \sqrt {2\pi}}\ e^{-\frac 1 2 (\frac {x-\mu} {\sigma})^2}

Find these documents helpful? Let the people who made them help your child learn to code at Strivemath!

We'd love to hear your Feedback/Comments here.

Last updated