---
tag: 04YG690N5V
kind: definition
name: Probability density function
msc: ["60E05"]
defines: 0ZY9DX8FBF
uses: [0C21RZG5V2, 0MXMS3AE13]
sources:
  - url: https://en.wikipedia.org/wiki/Probability_density_function
    locator: Formal definition
---

## Definition

Let $X$ be a real random variable on a probability space $(\Omega, \mathcal{F}, P)$.
A probability density function of $X$ is a Borel measurable function $f \colon \mathbb{R} \to [0, \infty)$ such that $P(X \in B) = \int_B f(x) \, dx$ for each Borel set $B \subseteq \mathbb{R}$.
So $X$ has a probability density function if and only if $X$ is a [[random variable with a density|0C21RZG5V2]].

## Remarks

Each density satisfies $\int_{-\infty}^{\infty} f(x) \, dx = 1$. Two densities of $X$ are equal except on a set of Lebesgue measure zero.
$P(a \le X \le b) = \int_a^b f(x) \, dx$ for $a \le b$.
If the [[cumulative distribution function|0MXMS3AE13]] $F_X$ is differentiable at $x$ and $f$ is continuous at $x$, then $F_X'(x) = f(x)$.
A density can be larger than $1$. The uniform distribution on $[0, 1/2]$ has the density $2$ on this interval.

## Explanations

### L1 human

The density $f(x)$ is not a probability. It is a probability per unit of length near $x$.
For a small $h$, the probability that $X$ lies between $x$ and $x + h$ is about $f(x) \, h$.
