Continuous Uniform Probability Distribution Calculator

Compute mean, standard deviation, and probability — or solve the inverse problem

Overview

This page provides two calculators for the continuous uniform distribution \( X \sim \mathrm{Uniform}(a, b) \):

  1. Standard calculator — given \( a \), \( b \), and a target value \( x_1 \), computes the mean, standard deviation, and cumulative probability \( P(X < x_1) \).
  2. Inverse calculator — given \( a \), \( b \), and a target probability \( p \), finds the value \( x_1 \) such that \( P(X < x_1) = p \).

Requirement: the lower bound must satisfy \( a < b \). If \( a = b \) the distribution is degenerate; if \( a > b \) the PDF would be negative.

Formulas and Definitions

The continuous uniform distribution models a random variable that is equally likely to take any value in the interval \( [a, b] \). Its probability density function is:

\[ f(x) = \begin{cases} \dfrac{1}{b-a} & a \le x \le b \\[1em] 0 & x < a \text{ or } x > b \end{cases} \]
Uniform density curve: constant height 1/(b − a) on the interval [a, b] and zero outside
Figure 1 — The uniform density is a rectangle of height \(1/(b-a)\).

Core Formulas

Formulas for the continuous uniform distribution
Quantity Formula
Cumulative probability \( P(X < x_1) = \displaystyle\int_a^{x_1} \frac{1}{b-a}\,dx = \frac{x_1 - a}{b - a} \;\; (a \le x_1 \le b) \)
Mean \( \mu \) \( \mu = \dfrac{a + b}{2} \)
Variance \( \sigma^2 \) \( \sigma^2 = \dfrac{(b - a)^2}{12} \)
Standard deviation \( \sigma \) \( \sigma = \dfrac{b - a}{\sqrt{12}} \)

Edge cases for \(P(X < x_1)\). If \(x_1 < a\), the probability is 0. If \(x_1 > b\), it is 1. For a continuous distribution, \(P(X < x_1) = P(X \le x_1)\) — the strict/non-strict distinction doesn't matter.


1. Standard Probability Calculator

Given \( a \), \( b \), and \( x_1 \), compute the mean, standard deviation, and \( P(X < x_1) \).

Results


2. Inverse Probability Calculator

Given \( a \), \( b \), and a target probability \( p \in [0, 1] \), find \( x_1 \) such that \( P(X < x_1) = p \). This computes the \( p \)-th quantile of the distribution.

Inverse Result


Worked Example — Manual Verification

Forward: \(a = 1\), \(b = 5\), \(x_1 = 2\)

View solution

Mean:

\[ \mu = \frac{1 + 5}{2} = 3 \]

Standard deviation:

\[ \sigma = \frac{5 - 1}{\sqrt{12}} = \frac{4}{\sqrt{12}} \approx 1.1547 \]

Probability:

\[ P(X < 2) = \frac{2 - 1}{5 - 1} = \frac{1}{4} = 0.25 \]

Answer: \( \mu = 3 \), \( \sigma \approx 1.1547 \), \( P(X < 2) = 0.25 \).

Inverse: \(a = 4\), \(b = 10\), \(p = 0.25\)

View solution

Solve \( \dfrac{x_1 - 4}{10 - 4} = 0.25 \):

\[ x_1 - 4 = 1.5 \;\Rightarrow\; x_1 = 5.5 \]

Check: \( P(X < 5.5) = \dfrac{5.5 - 4}{6} = \dfrac{1.5}{6} = 0.25 \; \checkmark \)


Practice Problems

Practice 1 — Forward

Let \( X \sim \mathrm{Uniform}(2, 8) \). Compute the mean, standard deviation, and \( P(X < 5) \).

Answer

\( \mu = (2+8)/2 = 5 \).

\( \sigma = (8-2)/\sqrt{12} = 6/\sqrt{12} \approx 1.7321 \).

\( P(X < 5) = (5-2)/(8-2) = 3/6 = 0.5 \).

Practice 2 — Inverse

For the same \( X \sim \mathrm{Uniform}(2, 8) \), find the value \( x_1 \) such that \( P(X < x_1) = 0.75 \).

Answer

Solve \( (x_1 - 2)/6 = 0.75 \):

\[ x_1 - 2 = 4.5 \;\Rightarrow\; x_1 = 6.5 \]

Practice 3 — Probability over an interval

For \( X \sim \mathrm{Uniform}(0, 10) \), find \( P(2 \le X \le 7) \).

Answer

Use \( P(2 \le X \le 7) = P(X < 7) - P(X < 2) \):

\[ = \frac{7}{10} - \frac{2}{10} = \frac{5}{10} = 0.5 \]

Or directly: \( \text{width} / (b - a) = (7 - 2)/(10 - 0) = 5/10 = 0.5 \).

Frequently Asked Questions

What is the PDF of a continuous uniform distribution?

For \(X \sim \mathrm{Uniform}(a, b)\), \(f(x) = 1/(b-a)\) for \(a \le x \le b\), and 0 elsewhere. The constant height reflects equal likelihood across the interval.

What are the mean and variance?

\( \mu = (a+b)/2 \) (the midpoint). \( \sigma^2 = (b-a)^2/12 \), so \( \sigma = (b-a)/\sqrt{12} \).

How do I compute \(P(X < x_1)\)?

\( P(X < x_1) = \dfrac{x_1 - a}{b-a} \) for \( a \le x_1 \le b \). If \(x_1 < a\), it's 0; if \(x_1 > b\), it's 1.

What is the inverse problem?

Given \( p \in [0,1] \), find \( x_1 \) such that \( P(X < x_1) = p \). The solution is \( x_1 = a + p(b-a) \) — the \(p\)-th quantile of the uniform distribution.

More Statistical Calculators & Resources

Last updated: October 20, 2026