Getting a list of random numbers in normal distribution

A PHP Error was encountered

Severity: Warning

Message: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

Filename: blog/post_details.php

Line Number: 38

Backtrace:

File: /home/solutio1/public_html/application/views/blog/post_details.php
Line: 38
Function: strtotime

File: /home/solutio1/public_html/application/controllers/Blog.php
Line: 14
Function: view

File: /home/solutio1/public_html/index.php
Line: 315
Function: require_once

A PHP Error was encountered

Severity: Warning

Message: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone.

Filename: blog/post_details.php

Line Number: 38

Backtrace:

File: /home/solutio1/public_html/application/views/blog/post_details.php
Line: 38
Function: date

File: /home/solutio1/public_html/application/controllers/Blog.php
Line: 14
Function: view

File: /home/solutio1/public_html/index.php
Line: 315
Function: require_once

2019-08-19
Rahul Swami Download Code
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.

 

 

 

 

 


About author

Card image cap
Rahul Swami

Experienced in providing key insights with advanced statistical methods, data modeling, and graphical display, utilizing the software that best suits your needs, with advanced skill in R.!

-R Developer

0 Comments