Distributions · Definition

Uniform distribution

probabilitydistributions

Before you start you need to know

It is the «no preference» model: it picks a point at random on a segment and underlies the simulation of other random variables.

Definition

A continuous uniform variable takes values in an interval with the same density at every point, so intervals of equal length have equal probability.

\[f(x)=\frac{1}{b-a},\quad a\le x\le b\]

If a bus comes every 10 minutes and you arrive without checking the clock, your waiting time can be modeled as uniform on \([0,10]\). Outside the interval the density is 0 and inside it equals \(1/(b-a)\), the value that makes the total area of the rectangle 1. We write \(X\sim U(a,b)\).

Because the density is constant, the probability of a subinterval is proportional to its length: \(P(c<X<d)=(d-c)/(b-a)\) when \(a\le c<d\le b\). The distribution function grows linearly, \(F(x)=(x-a)/(b-a)\) for \(a\le x\le b\), and is 0 before \(a\) and 1 after \(b\).

The expectation is the midpoint, \(E[X]=(a+b)/2\), by symmetry, and the variance is \(\operatorname{Var}(X)=(b-a)^2/12\). Note that the variance depends only on the length of the interval, not its position: shifting the interval moves the mean but not the spread.

A common mistake is to treat the density as a probability: \(f(x)=1/(b-a)\) can exceed 1 (for \(U(0,\tfrac12)\) it equals 2) and \(P(X=c)=0\) for every \(c\). Also, conditioning on a subinterval leaves the variable uniform on it. The \(U(0,1)\) is the building block of random number generators.

Think about it

Can the density of a uniform variable exceed 1?

Yes: for \(U(0,\tfrac12)\) the density is 2. What cannot exceed 1 is the area under the curve.

If \(X\sim U(0,8)\), what is the probability that \(X\) lies between 2 and 5?

\((5-2)/8=3/8\).

Exercises 10

References

  • Joseph K. Blitzstein, Jessica Hwang, Introduction to Probability, 2nd edition, CRC Press, 2019. §5.2
  • Sheldon Ross, A First Course in Probability, 10th edition, Pearson, 2019. §5.3
  • Ronald E. Walpole, Raymond H. Myers, Sharon L. Myers, Keying Ye, Probabilidad y estadística para ingeniería y ciencias, 9.ª edición, Pearson, 2012. §6.1