Solutions Touch
← Back to all blogs

August 19, 2019

Getting a list of random numbers in normal distribution

By Rahul Swami

Getting a list of random numbers in normal distribution

A distribution of values that cluster around an average.

a <- floor(rnorm(10000, 500, 100))

In a normal distribution, the first row produces a list of 10,000 random numbers so that the mean of those numbers is 500 and the standard deviation is 100.

In this list, the floor function takes each number and removes the decimal point.

In the R console you can even attempt to run this code individually and see the output as:

a <- floor(rnorm(10000, 500, 100))
a

Counting occurrences of each value

The table feature requires these numbers 10,000 and counts each frequency

a <- floor(rnorm(10000, 500, 100))
s <- table(a)
s

 

Since it is a normal distribution, as we approach the mean, you can obviously see the number frequencies gradually rise.

 

 

 

 

 

gaussian random number generator random number normal distribution excel random number generator with mean and standard deviation excel gaussian random number generator python normally distributed random numbers matlab gaussian random number generator in c random normal distribution python normal distribution formula Getting a list of random numbers in normal distribution r programming random numbers in r r rando