Probability density function

An earlier section explained that the distributions of continuous random variables are defined by a type of histogram called a probability density function (pdf). The probability of a value between any two constants is the area under the pdf above this range of values.

A probability density function , \(f(x)\), is usually a smooth function of \(x\) and has the following properties:

Example

The diagram below shows the probability density function, \(f(x)\), describing the distribution of a random variable, \(X\).

Drag the vertical red lines to display the probabilities of \(X\) being within different ranges of values — the probabilities are areas under the pdf.

Probabilities by integration

The probability density functions of many continuous random variables can be described by simple mathematical functions. Areas under curves can be found as integrals, so the probability that a random variable, \(X\) has a value between two constants \(a\) and \(b\) is

\[ P(a \lt X \lt b) \;\; = \; \; \int_a^b {f(x)}\; dx \]

Properties of a probability density function

A function \(f(x)\) can be the probability density function of a continuous random variable if and only if

\[ f(x) \;\; \ge \; \; 0 \quad\quad \text{for all } x \text{, and} \\ \int_{-\infty}^{\infty} {f(x)}\; dx \;\; = \; \; 1 \]
\[ \int_{-\infty}^{\infty} {f(x)}\; dx \;\; = \; \; P(-\infty \lt X \lt \infty) \;\; = \; \; 1\]