# Random function “returns a uniformly distributed int”. Does this mean the probability of every number is the same?

Most functions that generate random numbers are described as:

Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive)

If I use it to generate a number in the range [0..9], does uniformly distributed mean that the probability for 3 and 8 is the same?

As I understand it, if I run the function a sufficient number of times, I'll have the same number of occurrences for each number, 0 through 9. Is this correct?

Alternatively, would we instead have a normal distribution where we would get more occurrences of the numbers 4, 5, and 6, as they are closer to the mean and hence have a higher probability of occurring?

Uniform distribution is when all values have the same probability. A random uniformly distributed integer in the range $0,\ldots,9$ will attain each of the values with probability $1/10$. In practice, you function is not truly random but only pseudorandom, so the probabilities won't be exactly $1/10$ but only very close to $1/10$.
• _ If we "bin" them then we get a normal distribution on the integers. If we "cap" it_ - thanks, where can I read about bin and cap you're talking about? – Max Koretskyi May 18 '17 at 16:06