Tutorials › Introduction to Statistics › The Continuous Uniform Distribution

Poisson and Other Count Models · Tutorial 440 of 996

The Continuous Uniform Distribution

Learn how a constant density represents a continuous uniform model and how to calculate the probability that a value falls within a specified interval.

Intermediate 9 min read

What You'll Learn

  • Define a continuous uniform distribution on a finite interval using its probability density.
  • Check that the density is nonnegative and has total area one.
  • Calculate interval probabilities as proportions of the support’s length.
  • Handle events that extend partly or entirely outside the support.
  • Distinguish a density value, with units, from a probability.
  • Explain why the probability of any one exact value is zero.

Why Use a Continuous Uniform Model?

Some measurements can reasonably be treated as equally likely to fall anywhere within a specified range. For example, if a point is selected at random along a straight track, its location may be modeled as uniform over the track’s length. This is an idealized model: the measurement can take any value in the range, and equal-length sections of the track have equal probabilities.

The model’s simplicity makes it useful, but it must be plausible for the situation. A variable does not follow a uniform distribution merely because its minimum and maximum values are known. The defining feature is a constant probability density across the interval, not simply a bounded range.

Definition and Density

A continuous random variable can be described by a probability density function. Probabilities are represented by areas under that function: the area over an interval gives the probability that the variable falls in the interval. The height of the function at a point is a density, not the probability of that exact value.

Definition: A random variable \(X\) has a continuous uniform distribution on the finite interval \([a,b]\), where \(a<b\), if its probability density function is constant at \(1/(b-a)\) throughout that interval and zero outside it: $$ f(x)= \begin{cases} \dfrac{1}{b-a}, & a\leq x\leq b,\\ 0, & \text{otherwise}. \end{cases} $$ The notation \(X\sim\operatorname{Uniform}(a,b)\) may be used for this model. The interval \([a,b]\) is its support: values outside it have probability zero.

The interval length \(b-a\) determines the density height. A wider interval has a lower constant density, while a narrower interval has a higher one. If \(X\) is measured in minutes, for instance, the density has units of inverse minutes. A probability, by contrast, has no units.

The use of closed endpoints in the definition is convenient. For a continuous variable, including or excluding a single endpoint does not change an interval probability: any one exact value has probability zero. Thus \(P(a\leq X\leq b)\), \(P(a<X<b)\), and other versions differing only at endpoints are equal.

Why the Density Has This Height

A density must have total area one, because \(X\) must take some value in its support. For a uniform model, the area under the density is a rectangle with width \(b-a\) and height \(f(x)\). Requiring that area to equal one determines the height.

$$ \text{Total area}=(b-a)f(x)=1 $$ $$ f(x)=\frac{1}{b-a} $$

This also explains the probability calculation. For any interval \([c,d]\) contained within the support, the area above it is a rectangle of width \(d-c\) and height \(1/(b-a)\). Therefore its probability is the fraction of the support’s length covered by the interval.

Theorem: If \(X\sim\operatorname{Uniform}(a,b)\) and \(a\leq c\leq d\leq b\), then $$ P(c\leq X\leq d)=\frac{d-c}{b-a}. $$ More generally, for any interval event, first find its overlap with the support \([a,b]\). Its probability is the overlap length divided by \(b-a\); if there is no overlap, the probability is zero.

This result follows directly by integrating the density over the event interval. On the part inside the support, the density is constant, so the integral is the rectangle’s height times its width. Values outside the support contribute zero area.

$$ P(c\leq X\leq d) =\int_c^d f(x)\,dx =\int_c^d \frac{1}{b-a}\,dx =\frac{d-c}{b-a} $$

The last expression applies when \([c,d]\) is within \([a,b]\). For an event that crosses a support boundary, use only the portion that lies inside the support.

Calculating Probabilities From Interval Lengths

To calculate a probability under a continuous uniform model, identify the support and the event, find the length of the event’s overlap with the support, then divide by the support length. Check that the result is between zero and one, and interpret it as a probability in the context of the modeled variable.

Worked Example: A Uniformly Selected Time Within a Window

Hypothetical model. Suppose a delivery is equally likely to arrive at any time during a 12-minute window. Let \(X\) be the number of minutes after the window begins when it arrives, and assume \(X\sim\operatorname{Uniform}(0,12)\). What is the probability that it arrives between 3 and 8 minutes after the window begins?

Check the model and event. The support is \([0,12]\) minutes, and the event interval \([3,8]\) lies inside it. The uniform assumption means every interval of a given duration within the 12-minute window has the same probability.

The support length is \(12-0=12\) minutes, and the event length is \(8-3=5\) minutes. Thus

$$ P(3\leq X\leq 8) =\frac{8-3}{12-0} =\frac{5}{12} \approx 0.4167 $$

Under this model, the probability of arrival in that five-minute interval is about \(0.4167\), or \(41.67\%\). The answer is a probability, so it has no units.

Worked Example: An Interval Partly Outside the Support

Hypothetical model. Suppose \(X\), a measurement in centimeters, is modeled as uniform on \([2,10]\). Find the probability that \(X\) is between 8 and 12 centimeters.

Check the model and event. The model assigns zero probability to values outside \([2,10]\). The event interval \([8,12]\) overlaps the support only from 8 to 10, a length of \(10-8=2\) centimeters. The support length is \(10-2=8\) centimeters.

$$ P(8\leq X\leq 12) =\frac{\text{overlap length}}{\text{support length}} =\frac{10-8}{10-2} =\frac{2}{8} =0.25 $$

The probability is \(0.25\), or \(25\%\). The part from 10 to 12 contributes nothing because it lies outside the model’s support. Dividing the full event length, \(12-8=4\), by 8 would incorrectly count values the model says cannot occur.

Worked Example: Density Is Not Probability

Hypothetical model. Let \(X\) be a measurement in seconds that is modeled as uniform on \([0,0.4]\). Find the density and the probability that \(X\) lies between 0.1 and 0.3 seconds.

Check the model. The support is a finite interval of length \(0.4-0=0.4\) seconds, and the assumed density is constant throughout this interval. Its height is

$$ f(x)=\frac{1}{0.4-0}=2.5\ \text{per second} $$

The density value \(2.5\) is not a probability: it is a height with units of inverse seconds. It can exceed one because probability is area, not height. For the requested interval, the length is \(0.3-0.1=0.2\) seconds, so

$$ P(0.1\leq X\leq 0.3) =(0.2\ \text{seconds})(2.5\ \text{per second}) =0.5 $$

The probability is \(0.5\), with units canceling in the area calculation. Equivalently, the event covers \(0.2/0.4=0.5\) of the support’s length.

Exact Values and Equal-Length Intervals

The uniform density gives a positive height at each point in the support, but that height must not be read as the probability of observing the point. For any single value \(x_0\), the event has width zero, so its area under the density is zero:

$$ P(X=x_0)=\int_{x_0}^{x_0} f(x)\,dx=0 $$

This does not mean that the variable cannot take a value near \(x_0\). It means that an exact point has no width and therefore no area. In practice, measurements are often rounded or recorded to a fixed precision; the probability of a reported rounded value concerns an interval of underlying values, not a single exact value.

The model also assigns equal probabilities to any two intervals of equal length contained in the support. For example, under a uniform model on \([0,12]\), a two-minute interval near the start and a two-minute interval near the end each have probability \(2/12\). It does not assign equal probability to every interval regardless of length: a four-minute interval has twice the probability of a two-minute interval when both lie within the support.

Common Mistakes and a Practical Check

  • Treating the density as a probability. A density such as \(2.5\) per second is not the probability at a point. Multiply density by interval width to obtain an interval probability.
  • Using the whole event length when it extends outside the support. Count only the overlap with the support; values outside it have density zero.
  • Forgetting units. Density has inverse units, such as per minute, while probability is unitless. Their product gives a unitless area.
  • Assuming a variable is uniform just because it has bounds. Uniformity is a modeling assumption that the density is constant across the interval. The bounds alone do not establish it.
  • Giving a positive probability to an exact value. Under a continuous model, any single value has probability zero; probabilities come from intervals with positive width.

A reliable final check is to verify that the chosen overlap length is between zero and the support length. Dividing these lengths must produce a probability from zero to one. If the event covers the entire support, its probability is one; if it has no overlap with the support, its probability is zero.

Key takeaway: A continuous uniform model has constant density \(1/(b-a)\) over \([a,b]\). Probabilities are areas, so the probability of an interval is its overlap length with the support divided by the support length—not the density at a point.

Check Your Understanding

Use the density and interval-length ideas to answer these questions.

  1. If \(X\sim\operatorname{Uniform}(4,14)\), what is \(P(6\leq X\leq 9)\)? Show the event and support lengths.
  2. If \(X\sim\operatorname{Uniform}(0,5)\), what is the probability that \(X\) lies between 4 and 7? Explain why the part above 5 does not contribute.
  3. A uniform model on an interval of length 2 has density \(0.5\) per unit. Explain why \(0.5\) is not the probability of any one exact value.
  4. Why do two intervals of equal length within the support have equal probabilities under a continuous uniform model?
  5. A quantity is known to lie between 0 and 20. Is that fact alone enough to conclude that it is uniform? Explain.