# Does rnorm produce numbers with replacement/without replacement?

rnorm is an R language function defined as:

rnorm.X generates multivariate normal random variates in the space X.


Consider rnorm(1000, 50, 5), drawing 1000 values from a normal distribution with mean 50 and standard deviation 5.

Are these 1000 values iid? If they are then the sampling is done with replacement. Are rnorm and runif samples generated with replacement or without replacement?

• That is not the normal distribution in base R package stats. – Rui Barradas Feb 29 at 14:54
• @RuiBarradas Care to explain? rnorm is the way you draw random numbers from a normal distribution in base R. – Ingolifs Feb 29 at 21:14
• @Ingolifs The link is to a function in a contributed package, that help page list 9 rnorm.X, functions, not rnorm, the base R function. – Rui Barradas Feb 29 at 22:54

Both the normal and uniform distributions are continuous; ie, any particular value has probability of zero. Obviously there is numerical precision and other considerations involved with a machine-specific implementation but for all intents and purposes, you can suppose that $$\mathbb P(X = x) = 0$$ for any particular $$x$$; ie, the probability that you randomly draw a value identical to any particular point you specify is $$0$$. Further, if you have any countable (ie, you could count it out, possibly infinite) or finite (ie, you have a set with a fixed number of elements) set $$\mathcal X$$, $$\mathbb P(X \in \mathcal X) = 0$$ as well. That is, for any countable set of real numbers within the support of the distribution (for the uniform case, this would be $$[0, 1]$$, and for the normal case, the support is just all of the reals) there is also a probability of $$0$$ that a "new draw" or any finite number of draws will be equal to any of them (this applies for all continuous distributions; one can define mixed distributions in which this is NOT the case, but for continuous random variables, this is always the case as by definition a continuous distribution is defined over uncountably infinitely many points). There is no such thing as "with replacement" and "without replacement" if the distn function is continuous; further, if the distribution is discrete "without replacement" explicitly violates $$iid$$ (as you are specifically and deliberately omitting values from the possible sets of values based completely on the values you have already obtained). rnorm and runif generate $$iid$$ samples.