Let X be a continuous random variable on the interval S=(a,b). A non-negative, integrable function f(x) is called the probability density function (p.d.f.) of X if it satisfies three conditions: (1) f(x)≥0 for every x∈S; (2) the total area under y=f(x) over S is 1, i.e. ∫Sf(x)dx=1; (3) for any interval A inside S, P[X∈A]=∫Af(x)dx.
Worked examples.
Example 1. Let X have p.d.f. f(x)=3x2 for 0<x<1. Note carefully that f(x) is not P[X=x]: for instance f(0.9)=3(0.9)2=2.43>1, which could never be a probability. In the continuous case f(x) is only the height of the density curve at x; it is the area under the curve that gives probability.
Checking the two p.d.f. conditions: f(x)=3x2≥0 on [0,1], and ∫013x2dx=[x3]01=1, so f is a valid p.d.f. For 0≤c<d≤1, P[c<X<d]=∫cd3x2dx=d3−c3. Taking c=1/2,d=1: P[1/2<X<1]=13−(1/2)3=1−1/8=7/8. And P[X=1/2]=∫1/21/2f(x)dx=0 — geometrically, the 'rectangle' over a single point has zero width and hence zero area. This is a general fact: for a continuous random variable, P[X=x]=0 for every x in the support.
Example 2. Let X have p.d.f. f(x)=x3/4 on 0<x<c. Find c so that f is a valid p.d.f.
Since ∫0c4x3dx=[16x4]0c=16c4 must equal 1, c4=16, and since c>0, c=2.
Example 6. Verify whether the following are p.d.f.s of a continuous r.v. X: (i) f(x)=e−x for 0<x<∞, =0 otherwise; (ii) f(x)=x/2 for −2<x<2, =0 otherwise.
(i) e−x>0 for every x>0, and ∫0∞e−xdx=[−e−x]0∞=−(0−1)=1; both conditions hold, so f is a valid p.d.f. (ii) f(x)=x/2 is negative for −2<x<0 (e.g. f(−1)=−1/2<0), violating f(x)≥0; so f is not a valid p.d.f.
Example 7. Find k so that f(x)=kx2(1−x) for 0<x<1 (and 0 otherwise) is a p.d.f.
∫01kx2(1−x)dx=k∫01(x2−x3)dx=k[3x3−4x4]01=k(31−41)=12k. Setting this equal to 1 gives k=12.
Example 8. For each p.d.f., find (a) P(X<1) and (b) P(∣X∣<1): (i) f(x)=x2/18 for −3<x<3; (ii) f(x)=(x+2)/18 for −2<x<4.
(i)(a) P(X<1)=∫−3118x2dx=541[x3]−31=541(1−(−27))=5428=2714. …