St · Statistics & Probability

How to Find a Confidence Interval for a Uniform Distribution

Updated 13 October 2026

At a glance

  1. 1. Specify the model

    Assume independent observations follow a Uniform(0, θ) distribution, with θ as the unknown upper endpoint.

  2. 2. Find the sample maximum

    Let M be the largest of the n observations; its distribution provides a pivot for θ.

  3. 3. Choose the coverage tails

    Use the pivot’s quantiles to set an exact confidence level, such as 95%.

  4. 4. Solve for θ

    Rearrange the pivot inequalities to obtain confidence limits, then substitute the observed maximum.

A confidence interval for a uniform distribution depends on which parameter is unknown. The common textbook model is independent observations from Uniform⁡(0,θ)\operatorname{Uniform}(0,\theta), where the lower endpoint is known to be 0 and the upper endpoint θ\theta is unknown. In that case, the sample maximum gives an exact interval.

Below, nn is the sample size, MM is the largest observed value, and the confidence level is 1−α1-\alpha. If you instead mean a uniform distribution with both endpoints unknown, or an interval for its mean, see the alternatives near the end.

The sample maximum as a pivot

Let X1,…,XnX_1,\ldots,X_n be independent and uniformly distributed between 0 and θ\theta, and define

M=max⁡(X1,…,Xn).M=\max(X_1,\ldots,X_n).

For 0≤m≤θ0\le m\le\theta, all nn observations are at most mm only when each falls in an interval of probability m/θm/\theta. Independence therefore gives

Pr⁡(M≤m)=(mθ)n.\Pr(M\le m)=\left(\frac{m}{\theta}\right)^n.

Equivalently, the ratio M/θM/\theta has a distribution that does not depend on the unknown parameter:

Pr⁡(Mθ≤t)=tn,0≤t≤1.\Pr\left(\frac{M}{\theta}\le t\right)=t^n,\qquad 0\le t\le1.

This ratio is called a pivot. Its known distribution lets you choose probability bounds and solve them for θ\theta.

Exact two-sided confidence interval

For an equal-tailed interval with confidence level 1−α1-\alpha, put probability α/2\alpha/2 below the pivot and probability α/2\alpha/2 above it. The pivot quantiles are (α/2)1/n(\alpha/2)^{1/n} and (1−α/2)1/n(1-\alpha/2)^{1/n}, so

Pr⁡((α/2)1/n≤Mθ≤(1−α/2)1/n)=1−α.\Pr\left((\alpha/2)^{1/n}\le\frac{M}{\theta}\le(1-\alpha/2)^{1/n}\right)=1-\alpha.

Rearranging gives the exact interval

[M(1−α/2)1/n,  M(α/2)1/n].\boxed{\left[\frac{M}{(1-\alpha/2)^{1/n}},\;\frac{M}{(\alpha/2)^{1/n}}\right]}.

For a 95% interval, set α=0.05\alpha=0.05:

[M0.9751/n,  M0.0251/n].\boxed{\left[\frac{M}{0.975^{1/n}},\;\frac{M}{0.025^{1/n}}\right]}.

“Exact” means that, under the stated model, the interval contains the true θ\theta with probability exactly 0.95 over repeated samples. It does not mean there is a 95% probability that a fixed parameter lies in this particular interval.

A 95% example

Suppose n=10n=10 observations are taken and their maximum is M=8M=8. The equal-tailed interval is

[80.9751/10,  80.0251/10]≈[8.02,  11.57].\left[\frac{8}{0.975^{1/10}},\;\frac{8}{0.025^{1/10}}\right] \approx [8.02,\;11.57].

Thus, the exact equal-tailed 95% confidence interval for the upper endpoint is approximately [8.02,11.57][8.02,11.57]. The observed maximum cannot exceed θ\theta, and the interval’s lower bound is slightly above 8 because this construction allocates some error probability to each tail.

One-sided 95% upper bound

Sometimes the practical goal is only to put an upper limit on θ\theta. Since M≤θM\le\theta always, use

Pr⁡(M≤θ≤Mα1/n)=1−α.\Pr\left(M\le\theta\le\frac{M}{\alpha^{1/n}}\right)=1-\alpha.

For the example, this gives

[8,80.051/10]≈[8,10.79].\left[8,\frac{8}{0.05^{1/10}}\right]\approx[8,10.79].

This is a one-sided 95% confidence interval, not the equal-tailed two-sided interval. The choice is about the question you need the interval to answer; neither formula should be presented without identifying which type of interval it is.

If the uniform distribution has other unknowns

If the model is Uniform⁡(a,b)\operatorname{Uniform}(a,b) with both endpoints unknown, the formula above does not apply directly. There is no single confidence interval for “the distribution” until you specify the target, such as aa, bb, the width b−ab-a, or the mean (a+b)/2(a+b)/2. For example, when n≥2n\ge2, the sample range R=M−mR=M-m, where mm is the sample minimum, can be used to form an interval for the width. Its normalized distribution has cumulative distribution function

Pr⁡(Rb−a≤r)=nrn−1−(n−1)rn,0≤r≤1.\Pr\left(\frac{R}{b-a}\le r\right)=nr^{n-1}-(n-1)r^n,\qquad 0\le r\le1.

For an interval for the mean of Uniform⁡(0,θ)\operatorname{Uniform}(0,\theta), use the interval for θ\theta and divide both endpoints by 2, since the mean is θ/2\theta/2. If the support endpoints of a uniform distribution are known, its mean is already known as their midpoint; confidence intervals for means in other models are different problems.

Common mistakes

  • Using the sample mean as if it were the maximum. The exact pivot above comes from the sample maximum; replacing it with the sample mean does not give these limits.
  • Forgetting the sample size. The exponent 1/n1/n is essential. A larger sample maximum generally gives more information about θ\theta.
  • Confusing one-sided and two-sided intervals. The interval [M,M/α1/n][M,M/\alpha^{1/n}] has confidence level 1−α1-\alpha but is not equal-tailed.
  • Assuming both endpoints are unknown. The displayed formulas require a known lower endpoint of 0. If both endpoints are unknown, first specify which parameter you want to estimate.

References

  1. George Casella and Roger L. Berger, Statistical Inference
  2. Robert V. Hogg, Joseph W. McKean, and Allen T. Craig, Introduction to Mathematical Statistics

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.