How is it that each probability in a normal distribution occurs with the same frequency? I recently noticed that if you generate 10000 normally distributed numbers and then find the probability associated with each number (pnorm), each probability from 0 to 1 occurs with approximately the same frequency. Here's how I did it in R:
var2 <- numeric(10000)
normnos <- rnorm(10000)
for (i in 1:10000) {
  var2[i] <- pnorm(normnos[i])
}
hist(var2)


How is this possible? If all probabilities have equal likelihood of occurring, then wouldn't the resulting distribution be uniform instead of normal? I'm really confused and would appreciate an explanation.
 A: *

*pnorm doesn't compute the probability of the sampled number - it rather computes $P(X \leq x)$ - which is the cumulative distribution function. To compute the probability of sampled number, you will have to use the PDF - normal distribution in this case, that is, $p(x_i - \delta < X < x_i + \delta) = N(x_i | \mu = 0, \sigma = 1)$ ($\delta$ very small).

*The histogram you plotted is the distribution of cdf values, which is always uniform regardless of the distribution. This is known as "Universality of the Uniform"

*Mathematically, suppose $X$ is a random variable with pdf $p_X(x)$ and cdf
$F_X(x) = P(X \leq x)$. Let $T$ be the random variable $T = F_X(X)$ -  the samples of which you plotted in the histogram. $T$ is random because $X$ (normal variable in your case) is random. Then,
$$F_T(t) = P(T \leq t) = P(F_X(X) \leq t) = P(X \leq F_X^{-1}(t)) = F_X(F_X^{-1}(t)) = t$$

*$F_T(t) = t$ -- this is the cdf of a uniform distribution. So, the pdf of T is uniform - which is what you plotted. Note that the inverse of $F_{X}(x)$ exists only if $F_X$ is continuous and strictly increasing.

Hope this helps! :)
