Skip to content
LoveToCalc

Definition — what does that mean?

Uniform distribution, the density

A constant height over [a, b], zero outside, and an area of 1.

In Swedish: Likformig fördelning, täthetsfunktionen

Uniform distribution, the density

The relation

f(x)=1b−a,a≤x≤b0,otherwise

The density of the uniform distribution on [a, b]: the constant 1/(b − a) between a and b, and 0 outside, so the whole area is 1.

f(x)=0.1

f(x) equals 1 divided by (10 minus 0) if 4 is at least 0 and 4 is at most 10, 0 otherwise, 4 is at least 0, 4 is at most 10, so the first row, equals 1 divided by (10 minus 0), equals 1 divided by 10, equals 0.1

Working4 steps

Practice questions

You are given

  • b=30
  • a=10
  • x=12

The formula

f(x) = 1/(b − a) if a ≤ x ≤ b, and 0 otherwise

Holds for a quantity equally likely to fall anywhere between a and b, with b > a. The first row needs two conditions at once, x ≥ a and x ≤ b, which a book writes as the one chain a ≤ x ≤ b.

Why the height is 1/(b − a)

The total probability is 1, and under a constant density it is the area of a rectangle of width b − a. Height times width is 1, so the height is 1/(b − a). A wider interval gives a lower density.

Worked examples

a = 0, b = 10, x = 4. 0 ≤ 4 ≤ 10, so the first row: f(4) = 1/(10 − 0) = 0.1.

a = 2, b = 6, x = 3. f(3) = 1/(6 − 2) = 0.25.

a = 0, b = 5, x = 7. 7 > 5, so the first row does not apply and the last row gives 0.

a = −5, b = 5, x = 0. f(0) = 1/(5 − (−5)) = 0.1. The width is 10, not 5.

From density to probability

The probability that X lands in an interval [c, d] inside [a, b] is the area of the rectangle over it, (d − c) · 1/(b − a). That is the probability for the uniform distribution.

Common mistakes

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearrangedWith the numbersComes to
f(x)1b−a,a≤x≤b0,otherwise110−0,0≤4≤100,otherwise0.1

Last reviewed October 12, 2026 ·How pages are reviewed

Statistics and probabilityAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.