Tutorials › Statistical Theory I - Probability and Distribution Theory › Interval Probabilities and Quantiles for Uniform Laws

Uniform, Beta, and Gamma Laws · Tutorial 149 of 994

Interval Probabilities and Quantiles for Uniform Laws

Use interval lengths to find uniform probabilities and invert the CDF to obtain quantiles across the full probability range.

Beginner 9 min read

What You'll Learn

  • Calculate interval probabilities by intersecting the event with the uniform support.
  • Handle intervals that extend beyond the support and events consisting of a single point.
  • Derive the quantile function by inverting the uniform CDF.
  • Find medians, interior quantiles, and endpoint quantiles.
  • Check quantile calculations by substituting them into the CDF.

Interval Probabilities as Lengths

For a uniform law on a finite interval, probability is determined by how much of the support an event covers. An interval that covers one quarter of the support has probability one quarter; an interval extending beyond the support counts only where it overlaps that support. This length-based view makes interval probabilities direct to calculate and provides the key to deriving quantiles.

Let \(X\sim\operatorname{Uniform}(a,b)\), where \(a<b\). Its density is \(1/(b-a)\) on the support \([a,b]\) and zero outside, and its CDF rises linearly from zero at \(a\) to one at \(b\). The choice to include or exclude either support endpoint does not change probabilities, since a single point has probability zero.

Definition: The length of an interval \(J\) is denoted by \(\lambda(J)\). For any interval \(J\) on the real line, the uniform probability is $$ P(X\in J)=\frac{\lambda(J\cap[a,b])}{b-a}. $$ In words, intersect the event interval with the support, measure the resulting length, and divide by the total support length. If the intersection is empty or is a single point, its length and probability are zero.

For an interval with endpoints \(u\le v\), the overlap length can also be written as \(\max\{0,\min(v,b)-\max(u,a)\}\). This formula handles intervals inside the support, intervals that extend past one or both support endpoints, and intervals lying entirely outside the support. Endpoint brackets do not affect the result for a continuous uniform law.

Deriving the Interval Probability Rule

Theorem: If \(X\sim\operatorname{Uniform}(a,b)\), with \(a<b\), and \(J\) is any interval, then $$ P(X\in J)=\frac{\lambda(J\cap[a,b])}{b-a}. $$

Proof. The density is \(f(x)=1/(b-a)\) for \(x\in[a,b]\) and zero elsewhere. Integrating the density over the event gives $$ P(X\in J)=\int_J f(x)\,dx =\int_{J\cap[a,b]}\frac{1}{b-a}\,dx =\frac{\lambda(J\cap[a,b])}{b-a}. $$ The last equality holds because the integrand is constant and the interval of integration has length \(\lambda(J\cap[a,b])\). If the intersection is empty or a single point, the integral is zero, as is its length. This establishes the formula for open, closed, and half-open intervals alike. \(\square\)

This result is also consistent with the CDF calculation. In the interior of the support, the CDF is \(F(x)=(x-a)/(b-a)\). For \(a\le u<v\le b\), subtracting CDF values gives $$ P(u<X\le v)=F(v)-F(u)=\frac{v-u}{b-a}. $$ If the event extends past a support endpoint, the CDF is constant beyond that endpoint, so the probability stops increasing there. The overlap formula packages both situations into one rule.

Worked Example: An Interval Inside the Support

Suppose \(X\sim\operatorname{Uniform}(2,10)\). Find \(P(4<X\le 7)\), and then find \(P(2\le X<5)\).

The support has length \(10-2=8\). The interval \((4,7]\) lies inside the support and has length \(7-4=3\), so $$ P(4<X\le 7)=\frac{3}{8}=0.375. $$ The interval \([2,5)\) also lies inside the support and has length \(5-2=3\). Therefore $$ P(2\le X<5)=\frac{3}{8}=0.375. $$ The different endpoint brackets do not change either answer: each individual endpoint has probability zero.

Worked Example: An Interval That Extends Beyond the Support

Let \(X\sim\operatorname{Uniform}(-3,5)\). Find \(P(1<X\le 8)\) and \(P(6<X<9)\).

The support is \([-3,5]\), of length \(5-(-3)=8\). In the first event, \((1,8]\) overlaps the support only on \((1,5]\), whose length is \(5-1=4\). Hence $$ P(1<X\le 8)=\frac{4}{8}=\frac{1}{2}. $$ The second event lies entirely to the right of the support, so its intersection with \([-3,5]\) is empty. Thus $$ P(6<X<9)=\frac{0}{8}=0. $$ A common error would be to divide the full event length \(8-1=7\) by the support length. The event can have probability only where it overlaps the support; the portion from 5 to 8 contributes nothing.

The Quantile Function

A quantile reverses the question answered by the CDF. Instead of asking for the probability below a chosen value \(x\), a quantile asks for the value at which a specified probability \(p\) has accumulated. For a uniform law, the CDF is strictly increasing across the support, so each probability level has one corresponding support value.

Definition: For \(X\sim\operatorname{Uniform}(a,b)\), define its quantile function on \(0\le p\le1\) by $$ Q(p)=\inf\{x\in[a,b]:F(x)\ge p\}. $$ Thus \(Q(p)\) is the smallest point in the support at which the CDF reaches or exceeds \(p\). For this continuous uniform law, the endpoint values are \(Q(0)=a\) and \(Q(1)=b\).

For \(0<p<1\), the CDF at the quantile is exactly \(p\), not merely greater than or equal to it. To find the value, solve the interior CDF equation \(F(x)=p\). The result, including the endpoint values, is the linear function below.

Theorem: If \(X\sim\operatorname{Uniform}(a,b)\), where \(a<b\), then for every \(p\in[0,1]\), $$ Q(p)=a+p(b-a). $$ Moreover, \(F(Q(p))=p\), so \(P(X\le Q(p))=p\).

Proof. First take \(0<p<1\). Since \(F(x)=0\) for \(x\le a\), \(F(x)=1\) for \(x\ge b\), and \(F(x)=(x-a)/(b-a)\) for \(a\le x\le b\), the equation \(F(x)=p\) in the support becomes $$ \frac{x-a}{b-a}=p. $$ Because \(b-a>0\), multiplying both sides by \(b-a\) and adding \(a\) gives \(x=a+p(b-a)\). This value is in \((a,b)\) when \(p\in(0,1)\). The CDF is strictly increasing on \([a,b]\), so no smaller support value has CDF at least \(p\); the displayed \(x\) is the infimum in the definition. Substitution verifies $$ F\bigl(a+p(b-a)\bigr) =\frac{a+p(b-a)-a}{b-a} =p. $$ At \(p=0\), every support point has CDF at least zero and the smallest support point is \(a\); the formula gives \(Q(0)=a\), with \(F(a)=0\). At \(p=1\), only \(b\) has CDF one within the support, so \(Q(1)=b\), also as given by the formula, and \(F(b)=1\). Therefore the formula and the CDF identity hold across the full range \(p\in[0,1]\). \(\square\)

The median is the quantile at probability one half, \(Q(1/2)\). Substituting into the formula gives $$ Q(1/2)=a+\frac{1}{2}(b-a)=\frac{a+b}{2}. $$ More generally, an interior probability level \(p\) gives the fraction \(p\) of the way from the lower endpoint to the upper endpoint. For example, \(Q(0.9)\) lies 90% of the support length above \(a\).

Worked Example: Interior Quantiles and the Median

Let \(X\sim\operatorname{Uniform}(-3,9)\). Find the 10th percentile, the 75th percentile, and the median, then verify the first two CDF probabilities.

Here \(b-a=9-(-3)=12\), so \(Q(p)=-3+12p\). For the 10th percentile, $$ Q(0.10)=-3+12(0.10)=-3+1.2=-1.8. $$ The CDF at that value is $$ F(-1.8)=\frac{-1.8-(-3)}{12}=\frac{1.2}{12}=0.10. $$ For the 75th percentile, $$ Q(0.75)=-3+12(0.75)=-3+9=6, \qquad F(6)=\frac{6-(-3)}{12}=\frac{9}{12}=0.75. $$ The median is $$ Q(0.5)=-3+12(0.5)=3. $$ Thus half the probability lies at or below 3 and half lies at or above 3.

Worked Example: Endpoint Quantiles

Suppose \(X\sim\operatorname{Uniform}(5,13)\). Find \(Q(0)\), \(Q(1)\), and the probability of the interval \((6,13]\).

The support length is \(13-5=8\). The endpoint quantiles are $$ Q(0)=5+0(8)=5, \qquad Q(1)=5+1(8)=13. $$ The endpoint CDF checks are \(F(5)=0\) and \(F(13)=1\). For the interval probability, \((6,13]\) overlaps the support in a segment of length \(13-6=7\). Therefore $$ P(6<X\le13)=\frac{7}{8}=0.875. $$ The event excludes the lower support portion from 5 to 6, which has length 1 and probability \(1/8\); consequently the remaining probability is \(1-1/8=7/8\), in agreement with the overlap calculation.

Why These Calculations Matter

Interval probabilities and quantiles are two sides of the same linear CDF. The interval rule converts a segment of the support into a probability by dividing lengths. The quantile rule converts a probability level into a location by multiplying the support length and adding the lower endpoint. These operations are useful in probability calculations, simulation, and interpreting percentile cutoffs.

A frequent pitfall is to confuse a quantile's probability level with the quantile value. For \(X\sim\operatorname{Uniform}(5,13)\), the 75th percentile is not \(0.75\); it is the support value \(5+0.75(8)=11\). A related error is to use the full length of an event interval even when part of it lies outside the support. In either calculation, keep the two scales distinct: probabilities range from zero to one, while quantile values lie between \(a\) and \(b\).

Key takeaway: For a uniform law on \([a,b]\), probability is overlap length divided by \(b-a\), and the quantile at level \(p\) is \(a+p(b-a)\). The median is the midpoint, while the endpoint quantiles are the support endpoints.

Check Your Understanding

Use lengths and the quantile formula to answer each question.

  1. If \(X\sim\operatorname{Uniform}(0,12)\), what is \(P(3<X\le9)\)?
  2. If \(X\sim\operatorname{Uniform}(2,8)\), find \(P(X\in[-1,5))\), accounting for the support.
  3. For \(X\sim\operatorname{Uniform}(-4,4)\), find \(Q(0.25)\) and verify the CDF value.
  4. What are the median and the endpoint quantiles for \(X\sim\operatorname{Uniform}(6,14)\)?
  5. Explain why an interval lying entirely outside the support has probability zero even if the interval itself has positive length.