Normalise a density and compute probabilities and moments by integration. Integrate on the correct branch and keep a cumulative distribution continuous.
Notes and key methods
A density f is nonnegative and integrates to one over its support. Probabilities are areas: \(P(a<X<b)=\int_a^b f(x)\,dx\). A density may be larger than 1; a probability cannot.
Use \(E(X)=\int xf(x)\,dx\), \(E(X^2)=\int x^2f(x)\,dx\) and \(\operatorname{Var}(X)=E(X^2)-E(X)^2\). A median m solves \(\int_{-\infty}^m f(x)\,dx=1/2\).
Normalise a piecewise density by adding its separate integrals. The cumulative distribution \(F(x)=P(X\le x)\) must include all area to the left, including completed earlier pieces.
For an absolutely continuous variable, F is continuous, nondecreasing, zero below the support and one above it. At a point where f changes formula, match the two CDF expressions rather than resetting the accumulated probability.
Check the conditions
State the full support and put f(x)=0 outside it.
The density must be nonnegative throughout its support.
Integrate separately across every density breakpoint.
A continuous density model has no positive point masses at breakpoints.
Three worked examples
Example 1 · Continuous densities and moments
X has density \(f(x)=kx^{2}\) for \(0\le x\le 3\) and zero elsewhere.
Use the labelled scales alongside the numerical method.
Find k.
Find E(X).
Find Var(X).
Find the median of X.
Show the reasoning
(a)
\(k\frac{3^{3}}{3}=1\implies k=\frac{1}{9}\)
Answer: \(\frac{1}{9}\).
(b)
\(\int_0^L xf(x)\,dx=\frac{9}{4}\)
Answer: \(\frac{9}{4}\).
(c)
\(E(X^2)-E(X)^2=\frac{27}{80}\)
Answer: \(\frac{27}{80}\).
(d)
\((m/3)^{3}=1/2\implies m=32^{-1/3}\)
Answer: \(2.3811015779523\).
Example 2 · Piecewise densities and cumulative functions
The density is \(f(x)=kx\ (0\le x\le 4),\quad f(x)=k(8-x)\ (4<x\le 8)\), and zero elsewhere.
Use the labelled scales alongside the numerical method.
Find k.
Find E(X).
Find Var(X).
Find P(X≤1).
Show the reasoning
(a)
\(k(4^2/2+4^2/2)=1\implies k=\frac{1}{16}\)
Answer: \(\frac{1}{16}\).
(b)
\(E(X)=4\) by symmetry about the centre of the support.
Answer: \(4\).
(c)
\(\int(x-E(X))^2f(x)\,dx=\frac{8}{3}\)
Answer: \(\frac{8}{3}\).
(d)
\(\int_0^1x/16\,dx=\frac{1}{32}\)
Answer: \(\frac{1}{32}\).
Example 3 · Continuous densities and moments
X has density \(f(x)=kx^{1}\) for \(0\le x\le 5\) and zero elsewhere.
Use the labelled scales alongside the numerical method.
Find k.
Find E(X).
Find Var(X).
Find the median of X.
Show the reasoning
(a)
\(k\frac{5^{2}}{2}=1\implies k=\frac{2}{25}\)
Answer: \(\frac{2}{25}\).
(b)
\(\int_0^L xf(x)\,dx=\frac{10}{3}\)
Answer: \(\frac{10}{3}\).
(c)
\(E(X^2)-E(X)^2=\frac{25}{18}\)
Answer: \(\frac{25}{18}\).
(d)
\((m/5)^{2}=1/2\implies m=52^{-1/2}\)
Answer: \(3.53553390593274\).
Common mistakes
Do not read the height f(a) as P(X=a).
A median solves an area equation, not f(m)=1/2.
Do not omit the accumulated area from an earlier branch.
A derivative of F gives the density only on the appropriate support.