6.5. Uniform Distribution

After exploring the mathematical elegance and complexity of the normal distribution, we now turn to perhaps the simplest of all continuous distributions: the uniform distribution.

Road Map 🧭

  • Understand the uniform distribution as representing constant probability density over a fixed interval.

  • Develop geometric intuition for probability as rectangular areas.

  • Learn the mathematical formulation of uniform PDF and CDF, and explore the key properties.

6.5.1. The Essence of Uniform Randomness

A uniform distribution assigns equal probability density to every point within its support interval \([a, b]\) for some \(a < b\).

The Uniform PDF

A continuous random variable \(X\) follows a uniform distribution on the interval \([a, b]\) if its probability density function is:

\[\begin{split}f_X(x) = \begin{cases} \frac{1}{b-a} & \text{for } a \leq x \leq b \\ 0 & \text{elsewhere} \end{cases}\end{split}\]

We write \(X \sim \text{Uniform}(a,b)\) or sometimes \(X \sim U(a,b)\).

The PDF plot of a uniform distribution

Fig. 6.20 A Uniform PDF

Determining the Constant Height

The constant \(\frac{1}{b-a}\) isn’t arbitrary—it’s the unique value that makes the PDF valid. Since the distribution forms a rectangle with base \((b-a)\) and height \(c\), the total area is \(\text{Area} = \text{base} \times \text{height} = (b-a) \times c\). For this to equal 1, we need:

\[(b-a) \times c = 1 \implies c = \frac{1}{b-a}\]

This geometric argument shows why the height must be the reciprocal of the interval length.

The Uniform CDF

The cumulative distribution function for a uniform distribution increases linearly from 0 to 1 over the supprt interval:

\[\begin{split}F_X(x) = \begin{cases} 0 & \text{for } x < a \\ \frac{x-a}{b-a} & \text{for } a \leq x < b \\ 1 & \text{for } x \geq b \end{cases}\end{split}\]
The CDF plot of a uniform distribution

Fig. 6.21 A Uniform CDF

Deriving the CDF

  • Before the rectangle begins, zero area is accummulated on the PDF. Thus the CDF is 0 for \(x < a\).

  • After the rectangle is complete, all existing area in the PDF has been accummulated. The CDF is 1 for \(x \geq b\).

  • For an \(x\) between \(a\) and \(b\), the CDF represents the area under the PDF from \(-\infty\) to \(x\). Since the PDF is zero before point \(a\) and constant at height \(\frac{1}{b-a}\) from \(a\) to \(x\), this area forms a rectangle:

\[F_X(x) = \text{width} \times \text{height} = (x-a) \times \frac{1}{b-a} = \frac{x-a}{b-a}.\]

6.5.2. The Length Principle

Since the uniform PDF has constant height \(\frac{1}{b-a}\) across its support, the probability of any interval equals the area of the corresponding rectangle:

\[\begin{split}P(c \leq X \leq d) &= \text{width} \times \text{height} = (d-c) \times \frac{1}{b-a} \\ &= \frac{d-c}{b-a} =\frac{\text{length of interval of interest}}{\text{total length of support}}\end{split}\]

Notice that this probability depends only on the interval length \((d-c)\) and the total support length \((b-a)\). The specific values of \(c\) and \(d\) don’t matter—only how far apart they are.

Example💡: Unifrom Probabilities

Consider \(X \sim \text{Uniform}(0, 10)\).

  1. Find \(P(1 \leq X \leq 3)\).

    \[P(1 \leq X \leq 3) = \frac{3-1}{10-0} = \frac{2}{10} = 0.2\]
  2. Find \(P(4.7 \leq X \leq 6.7)\).

    \[P(4.7 \leq X \leq 6.7) = \frac{6.7-4.7}{10-0} = \frac{2}{10} = 0.2\]

    Note that the two intervals in #1 and #2 have the same length. they also share the same probability.

  3. Find \(P(8.5 \leq X \leq 10.5)\).

    \[\begin{split}P(8.5 \leq X \leq 10.5) &= P(8.5 \leq X \leq 10) + P(10 < X \leq 10.5)\\ &= \frac{1.5}{10} + 0 = 0.15\end{split}\]

    🛑 The interval in this probability statement extends beyond the support. Our calculation must reflect the fact that the probability of \(X\) taking any value greater than 10 is zero. This is an important example that highlights the role of the support in probability calculations.

6.5.3. Expected Value and Variance of Uniform Distribution

The uniform distribution’s symmetry and rectangular shape make its expected value geometrically obvious, while its variance can be computed through either geometric reasoning or algebraic integration.

Expected Value: The Midpoint

By symmetry, the expected value of a uniform distribution must lie at the center of its support interval:

\[E[X] = \mu_X = \frac{a+b}{2}\]

Algebraic Verification of Expected Value

We can confirm this geometric insight through integration:

\[\begin{split}E[X] &= \int_{-\infty}^{\infty} x \cdot f_X(x) \, dx = \int_a^b x \cdot \frac{1}{b-a} \, dx\\ &=\frac{1}{b-a} \int_a^b x \, dx = \frac{1}{b-a} \cdot \frac{x^2}{2}\Big|_a^b = \frac{1}{b-a} \cdot \frac{b^2-a^2}{2}\\ &= \frac{1}{b-a} \cdot \frac{(b-a)(b+a)}{2} = \frac{b+a}{2}✔\end{split}\]

Variance

For variance, we’ll use the computational formula \(\text{Var}(X) = E[X^2] - (E[X])^2\). We already know \(E[X]\), so we need to find \(E[X^2]\):

\[\begin{split}E[X^2] &= \int_a^b x^2 \cdot \frac{1}{b-a} \, dx = \frac{1}{b-a} \int_a^b x^2 \, dx\\ &= \frac{1}{b-a} \cdot \frac{x^3}{3}\Big|_a^b = \frac{1}{b-a} \cdot \frac{b^3-a^3}{3}\end{split}\]

Now we use the algebraic identity \(b^3 - a^3 = (b-a)(b^2 + ab + a^2)\):

\[E[X^2] = \frac{1}{b-a} \cdot \frac{(b-a)(b^2 + ab + a^2)}{3} = \frac{b^2 + ab + a^2}{3}\]

Finally, we compute the variance:

\[\begin{split}\text{Var}(X) &= E[X^2] - (E[X])^2 = \frac{b^2 + ab + a^2}{3} - \left(\frac{a+b}{2}\right)^2\\ &= \frac{b^2 + ab + a^2}{3} - \frac{a^2 + 2ab + b^2}{4}\\ &= \frac{4b^2 + 4ab + 4a^2 - 3a^2 - 6ab - 3b^2}{12}\\ &= \frac{b^2 - 2ab + a^2}{12} = \frac{(b-a)^2}{12}\end{split}\]

The Result

The variance and standard deviation of a uniform distribution is:

\[\text{Var}(X) = \frac{(b-a)^2}{12} \quad \text{ and } \quad \sigma_X = \sqrt{\text{Var}(X)} = \frac{b-a}{\sqrt{12}}\]

The variance depends only on the length of the support interval \((b-a)\)—wider intervals create more variability.

Example💡: Expectation, SD, and Percentile of a Uniform Random Variable

Suppose a factory produces metal bolts with diameters that fall between 10 mm and 30 mm evenly. Find the expected value, standard deviation, and the 25th percentile of the diameters.

Let \(X\) denote the diameters of metal bolts. \(X \sim \text{Uniform}(10, 30)\).

  • \(E[X] = \frac{10+30}{2} = 20\)

  • \(\sigma_x = \frac{30-10}{\sqrt{12}} = 5.7735\)

  • For the 25th percentile \(x_{0.25}\), we must solve \(F_X(x_{0.25})=0.25\).

    \[\frac{x_{0.25}-a}{b-a} =0.25 \implies x_{0.25} = 10 + 0.25(30-10) = 10 + 5 = 15\]

    25% of the bolts produced in this factory has a diameter less than or equal to 15 mm.

6.5.4. Properties Summary

For quick reference, here are the essential properties of the uniform distribution:

Notation: \(X \sim \text{Uniform}(a,b)\) or \(X \sim U(a,b)\)

Parameters: \(a\) (lower bound) and \(b\) (upper bound), where \(a < b\)

Support: \([a, b]\)

PDF: \(f_X(x) = \begin{cases} \frac{1}{b-a} & \text{for } a \leq x \leq b \\ 0 & \text{elsewhere} \end{cases}\)

CDF: \(F_X(x) = \begin{cases} 0 & \text{for } x < a \\ \frac{x-a}{b-a} & \text{for } a \leq x < b \\ 1 & \text{for } x \geq b \end{cases}\)

Expected Value: \(E[X] = \frac{a+b}{2}\)

Variance: \(\text{Var}(X) = \frac{(b-a)^2}{12}\)

Standard Deviation: \(\sigma_X = \frac{b-a}{\sqrt{12}}\)

6.5.5. Bringing It All Together

Key Takeaways 📝

  1. The uniform distribution represents constant probability density across a fixed interval, making it the simplest continuous distribution.

  2. Only interval lengths matter for uniform probability calculations—location within the support is irrelevant.

  3. The PDF height must be \(\frac{1}{b-a}\) to ensure the rectangular area equals 1.

  4. The CDF increases linearly from 0 to 1 across the support.

  5. Expected value equals the midpoint \(\frac{a+b}{2}\), and variance equals \(\frac{(b-a)^2}{12}\).

Exercises

  1. Basic Properties: For \(X \sim \text{Uniform}(2, 8)\):

    1. Find \(P(3 \leq X \leq 5)\)

    2. Find \(P(X > 7)\)

    3. Find the median and verify it equals the mean

    4. Calculate the variance and standard deviation

  2. Manufacturing Application: A cutting machine produces rods with lengths uniformly distributed between 49.8 and 50.2 cm.

    1. What’s the probability a rod meets specifications [49.9, 50.1] cm?

    2. Find the 90th percentile of rod lengths

    3. If specifications are tightened to [49.95, 50.05] cm, what percentage will meet the new requirements?

  3. Conditional Probability: For \(X \sim \text{Uniform}(0, 10)\):

    1. Find \(P(X > 7 | X > 5)\)

    2. Find \(P(2 < X < 6 | X < 8)\)

    3. Explain how the length principle applies to conditional probabilities

  4. Finding parameters: If a uniform distribution has a mean of 15 and a variance of 12, find the parameters \(a\) and \(b\).