S2 2.1, S2 2.2 - Probability density functions

S2 2.1, S2 2.2 - Probability density functions

For a continuous measurement, probability belongs to an interval rather than to an individual value. Learn how density represents probability as area, check whether a proposed density is valid, and calculate probabilities across polynomial and piecewise densities.

Continuous values and zero point probabilities

Can a density have height two when a probability can never exceed one? Yes: density is a height, while probability is an area.

A continuous random variable models measurements that can take any value in an interval, such as an unrounded length. A measuring device may display only a finite number of decimal places; that rounded display and the underlying continuous model are different things. “Exactly 1.2” on a display usually describes a small interval of true measurements.

Imagine a rectangular density of height 22 on 0≤x≤0.50\le x\le0.5, and zero elsewhere. The total area is 2(0.5)=12(0.5)=1. The interval from 0.10.1 to 0.30.3 has probability 2(0.2)=0.42(0.2)=0.4. A single point has width zero, hence area zero.

[DIAGRAM: asset_name: Density height and probability area; asset_slug: s2-density-height-area; caption: A density may exceed one because probabilities are areas rather than heights.; description: A rectangular density of height 2 between 0 and 0.5, with the interval from 0.1 to 0.3 shaded and labelled area 0.4. A separate pointer at x equal to 0.4 is labelled single point has zero width.]
A density may exceed one because probabilities are areas rather than heights.

Probability density function

A probability density function, or p.d.f., ff, is nonnegative and has total area one. Probabilities are areas under its graph. For a variable with a density,

P(X=c)=0\mathrm{P}(X=c)=0

for any single value cc.

Zero probability at each point does not mean an interval has zero probability. An interval contains continuously many points; its area is found by integration rather than adding finitely many point masses. Consequently, including or excluding a finite number of endpoints does not change a continuous probability:

P(a<X<b)=P(a≤X≤b).\mathrm{P}(a<X<b)=\mathrm{P}(a\le X\le b).

This differs from a binomial count, where including an endpoint can add a positive probability.

Key idea

The value f(c)f(c) is a density height. It is not P(X=c)\mathrm{P}(X=c).

Use the area interpretation, including its point boundary.

Normalisation and nonnegative density

A proposed density must pass two tests: it stays nonnegative and its entire area is one.

The support is the set of possible values described by the model. State where a formula applies, and give density zero outside that support. A formula such as f(x)=kxf(x)=kx without its interval does not define the whole distribution.

Density conditions

For a valid density,

f(x)≥0,∫−∞∞f(x) dx=1.f(x)\ge0,\qquad \int_{-\infty}^{\infty}f(x)\,\mathrm{d}x=1.

When the density is zero outside [a,b][a,b], the integral reduces to ∫abf(x) dx=1\int_a^b f(x)\,\mathrm{d}x=1. Use this total-area condition to find an unknown normalising constant.

Total area one alone is insufficient. For example, g(x)=x−1/2g(x)=x-1/2 on [0,2][0,2] integrates to one, but is negative for 0≤x<1/20\le x<1/2. It cannot be a density.

Worked example 1: an increasing density

The density is f(x)=kxf(x)=kx for 0≤x≤20\le x\le2, and zero otherwise. Find kk.

Plan. Set the area on the support equal to one, then check its sign.

∫02kx dx=k[x22]02=2k=1.\int_0^2 kx\,\mathrm{d}x =k\left[\frac{x^2}{2}\right]_0^2 =2k=1.

Answer. k=1/2k=1/2, so f(x)=x/2f(x)=x/2 on [0,2][0,2], zero otherwise.

Check. The graph is a triangle with base two and height one: its area is one. It is nonnegative throughout the support.

Reflect the shape across the midpoint of the support. Only the direction of slope changes.

Worked example 2: a decreasing density

The density is f(x)=k(2−x)f(x)=k(2-x) for 0≤x≤20\le x\le2, and zero otherwise. Find kk.

Plan. Integrate the new formula over the same support.

∫02k(2−x) dx=k[2x−x22]02=k(4−2)=1.\int_0^2 k(2-x)\,\mathrm{d}x =k\left[2x-\frac{x^2}{2}\right]_0^2 =k(4-2)=1.

Answer. k=1/2k=1/2.

Check. Reflection preserves area, so the same constant is expected. Also 2−x≥02-x\ge0 on [0,2][0,2].

The integration variable changes; an unknown fixed constant such as kk does not.

Integrating for interval probabilities

Integrate a density only over the values included in the event; for a conditional probability, restrict both the numerator and the denominator appropriately.

Probability as area

For a continuous variable with density ff,

P(a<X≤b)=∫abf(x) dx.\mathrm{P}(a<X\le b)=\int_a^b f(x)\,\mathrm{d}x.

The density is zero outside its support. This area formula is expected recall in S2.

If the event extends past the support, the extra area is zero. For f(x)=x/2f(x)=x/2 on [0,2][0,2], an upper limit of three does not justify continuing the expression x/2x/2 past two.

Worked example 3: an ordinary interval

For density f(x)=x/2f(x)=x/2 on [0,2][0,2], zero otherwise, find P(0.5<X<1.5)\mathrm{P}(0.5<X<1.5).

Plan. Integrate between the two stated boundaries.

P(0.5<X<1.5)=[x24]0.51.5=2.25−0.254=12.\mathrm{P}(0.5<X<1.5) =\left[\frac{x^2}{4}\right]_{0.5}^{1.5} =\frac{2.25-0.25}{4}=\frac12.

Answer. 1/21/2.

Check. This region under the density is a trapezium with parallel heights 0.250.25 and 0.750.75, and width one. Its area is 12(0.25+0.75)(1)=0.5\frac12(0.25+0.75)(1)=0.5.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account