### 20.4.1 Distributions and inverse distributions

Let p(x) be a probability density function, so p(x) ≥ 0 for all x, and for a discrete density function,

∑
x∈ ℤ

p(x)=1,

while for a continuous density function,

∫

+∞
−∞

p(x)d x=1.

The corresponding cumulative distribution function

P(x)=Prob(X≤x)

is the probability that a randomly (according to the probability being considered) chosen value is less than or equal to x. This can be used to find the probability that a randomly chosen value is between two numbers:

Prob(x<X≤y)=P(y)−P(x).

Given a value h between 0 and 1, the inverse distribution function for a distribution takes h to the value of x for which Prob(X ≤ x)=h.