- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# Why Output of mean of normal random variable created using rnorm equals to 10 is not 10 in manual calculation with R?

When we find the mean of normal random variable which is created with rnorm(“sample_size”,10) is not 10 because rnorm will create a random variable hence mean will be changed but as we increase the sample size the mean will become closer to 10.

Check out the Examples given below to understand the variation in the Outputs as the sample size increases.

## Example

The variation in the Outputs of mean of normal random variable created by using rnorm as the sample size increases is explained below −

mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(100,mean=10)) mean(rnorm(1000,mean=10)) mean(rnorm(1000,mean=10)) mean(rnorm(1000,mean=10)) mean(rnorm(10000,mean=10)) mean(rnorm(10000,mean=10)) mean(rnorm(10000,mean=10)) mean(rnorm(10000,mean=10)) mean(rnorm(10000,mean=10)) mean(rnorm(100000,mean=10)) mean(rnorm(100000,mean=10)) mean(rnorm(100000,mean=10)) mean(rnorm(100000,mean=10)) mean(rnorm(100000,mean=10)) mean(rnorm(1000000,mean=10)) mean(rnorm(1000000,mean=10)) mean(rnorm(1000000,mean=10)) mean(rnorm(1000000,mean=10)) mean(rnorm(1000000,mean=10)) mean(rnorm(10000000,mean=10)) mean(rnorm(10000000,mean=10)) mean(rnorm(10000000,mean=10)) mean(rnorm(100000000,mean=10))

The Output is as follows

[1] 10.13626 [1] 9.892686 [1] 9.938534 [1] 9.918113 [1] 10.12262 [1] 10.05268 [1] 10.06714 [1] 9.953736 [1] 10.02104 [1] 9.973183 [1] 9.994081 [1] 10.00588 [1] 9.983589 [1] 10.00452 [1] 10.00093 [1] 9.999846 [1] 9.999979 [1] 9.996462 [1] 10.00455 [1] 10.00049 [1] 9.999261 [1] 9.998425 [1] 9.999633 [1] 10.00064 [1] 9.998785 [1] 10.00003 [1] 9.999948 [1] 9.99997

- Related Questions & Answers
- How to generate a normal random vector using the mean of a vector in R?
- How to perform rounding in R to next 10 instead of nearest 10?
- Generating a unique random 10 character string using MySQL?
- Generate 10 random four-digit numbers in Java
- In Ramayana, why Raavan had 10 heads?
- 10 Reasons why you should Learn Python
- Why scale_fill_manual does not fill the bar with colors created by using ggplot2 in R?
- Local Variable Type Inference or LVTI in Java 10
- What is 10 Gigabit Ethernet?
- How to generate standard normal random numbers in R?
- Complement of Base 10 Integer in Python
- How to find the mean of each variable using dplyr by factor variable with ignoring the NA values in R?
- 10-Gigabit Ethernet
- Windows 10 Toast Notifications with Python
- How to get Natural logarithm of 10 in JavaScript?

Advertisements