4.1 - Piecewise probability densities
A probability density can change formula, jump, or even rise above one. In this lesson you will decide whether a piecewise function is a valid density, calculate probabilities across its pieces, and find expectations and variances of functions of a continuous random variable.
A valid density
Can a probability density be taller than one without giving an impossible probability? Yes: a density gives probability through area, rather than through its height at one point.
You already know from continuous distributions that an interval probability is an integral. For example, a rectangle of width and height has area . Its height exceeds one, but it can describe a distribution concentrated in a short interval.
Probability density function
A probability density function, or PDF, for a continuous random variable is a nonnegative function with total area one:
Then . The support identifies where the distribution can take values; give the intervals and state that the density is zero elsewhere.
A piecewise definition tells you which expression to use on each interval. Check nonnegativity on every piece, then add their areas. The formulae need not join at the same height: a density may have a jump.
Worked example 1: normalising two pieces
Question. Find so that the following is a PDF:
Plan. Integrate each nonzero piece, make their sum one, then check the sign.
Both on the first interval and the constant on the second interval are nonnegative when .
Answer. , giving a valid density on .
Check. Geometry gives a triangle of area and a rectangle of area . Their total is one.
The next density retains a rising first piece but replaces the finite second piece by a decreasing tail. An infinite support does not require an infinite area.
Worked example 2: an unbounded support
Question. Find so that
is a PDF.
Plan. Use an improper integral for the tail and check nonnegativity.
Both nonzero expressions are nonnegative for this value of .
Answer. , with support .
Check. Substituting gives the tail area as . The first piece is a triangle of area , confirming total one by a different calculation. The maximum density is ; a height above one causes no problem.
Total signed integral one is insufficient if some of the curve lies below the axis. For example, the function on , on , and zero elsewhere has integral one, but is negative for . It cannot be a PDF.
Watch out
Do not check only . A negative piece would assign a negative probability to some interval. Check both nonnegativity and total area.
Apply both conditions to a new pair of pieces.
Intervals across pieces
A probability interval may cross a point where the density changes formula, so split the integral at every such point inside the interval.
Return to the density from Worked example 1:
The shaded area in the diagram crosses . Its two parts need different integrands.
[DIAGRAM: asset_name: An interval crossing two density pieces; asset_slug: cam9231-piecewise-area; caption: Split the shaded probability at x equals 1, where the density changes formula; description: Exact PDF f(x) equals two fifths x on zero to one and two fifths on one to three, with zero elsewhere. Pale blue shading from one half to one has area three twentieths; pale lavender shading from one to two has area two fifths. Dashed guides mark one half, one and two, and the total shaded probability is eleven twentieths.]

For any single value , the integral from to itself is zero. Thus , and including or excluding individual endpoints does not change an interval probability. Changing a density's value at an isolated endpoint also leaves all its probabilities unchanged.
Worked example 3: staying inside one piece
Question. For this density, find .
Plan. Both limits lie below one, so use only the rising piece.
Answer. .
Check. The region is a trapezium of width , with parallel sides and . Its area is .
Now change the interval so that its upper end lies in the constant piece. The probability is the sum of two areas, not one formula evaluated across the whole interval.
Continue this lesson.
You’re previewing NovaLearn without an account. Create a free account to read the rest.
Create free account