Back to all articles
StatisticsApr 4, 2026· 5 min read

Cumulative Distribution Function and Inverse CDF

What CDF and inverse CDF mean, and how they turn a uniform random number into a sample from any distribution.

Statistics

Cumulative Distribution Function and Inverse CDF

What CDF and inverse CDF mean, and how they turn a uniform random number into a sample from any distribution.

A cumulative distribution function maps a value to the probability that a random variable is less than or equal to it. The inverse CDF reverses that mapping.

Sampling from a uniform number

Generate a uniform number between zero and one, then feed it into the inverse CDF. The output follows the target distribution. This is the basis of inverse transform sampling.

  • Works directly when the inverse CDF has a closed form.
  • Needs approximation when the inverse is expensive.
  • Pairs well with rejection methods for discrete distributions.