From a Piecewise Density to Probabilities
A density may change its formula at one or more breakpoints. To use it, first make sure its total area is one; then accumulate area from the left end of the support to build the cumulative distribution function. An interval probability that crosses a breakpoint is found by adding the relevant areas from each piece, or by subtracting the two appropriate CDF values.
The main challenge is keeping the regions straight. The normalizing constant is determined by the area under every piece, while a CDF formula at a particular value uses only the pieces to the left of that value. Once each piece is integrated over the correct limits, the calculation is systematic.
A breakpoint is a value at which the density’s formula changes. It does not, by itself, create a point probability. For a variable described entirely by a density, \(P(X=a)=0\) for any individual value \(a\). Thus, including or excluding an endpoint does not change an interval probability in these problems.
A Reliable Calculation Process
For a piecewise density that contains an unknown constant \(c\), normalization and CDF construction are related but distinct steps. Normalization determines \(c\) using the entire support. The CDF then uses that value and accumulates the density only up to the argument of the CDF.
Write down the intervals on which the density is nonzero and identify where its formula changes. Outside the support, the density is zero.
Set the sum of the integrals of all density pieces equal to one, and solve for any unknown constant.
For each support region, add the probability accumulated before that region to the integral from the region’s left endpoint to \(x\).
Use \(P(a<X\leq b)=F_X(b)-F_X(a)\). If calculating by areas instead, split the interval at every breakpoint it crosses.
The CDF should be nondecreasing, agree from both sides at each breakpoint, equal zero below the support, and equal one at and above its upper endpoint.
Why the CDF Uses Accumulated Area
The CDF definition asks for the probability that \(X\) is no greater than \(x\). For a variable with density \(f_X\), that event includes every value from the lower end of the support up to \(x\). Its probability is therefore the area under the density over that range. If \(x\) lies in a particular piece, the CDF includes all earlier pieces in full and integrates only part of the current piece.
For \(a<b\), the event \(a<X\leq b\) consists of the values counted by \(F_X(b)\) but not those counted by \(F_X(a)\). Hence
This subtraction works whether or not the interval crosses breakpoints. The CDF values must, however, be evaluated using the correct piece of the CDF at each endpoint.
Worked Example: A Density With Two Sloping Pieces
A hypothetical sensor produces a continuous reading \(X\), measured in units, with density
Find \(c\), construct the CDF, and calculate \(P(1<X\leq3)\). The model is a density supported on \([0,4]\), with one formula on each side of the breakpoint \(2\).
Method: normalize by summing the two areas. The unscaled area on \([0,2]\) is
On \([2,4]\), the unscaled area is
The full density must have area one, so \(c(2+2)=1\). Therefore \(c=1/4\).
Construct the CDF. Below zero, no probability has accumulated, so \(F_X(x)=0\). For \(0\leq x<2\), integrate the first piece from zero to \(x\):
For \(2\leq x\leq4\), the entire first piece has probability \(2/4=1/2\). Add the area from 2 to \(x\) under the second piece:
Above 4, the whole distribution has accumulated, so \(F_X(x)=1\). Combining the regions gives
Calculate the requested probability. Since \(1\) is in the first CDF piece and \(3\) is in the second,
so \(P(1<X\leq3)=7/8-1/8=3/4\). As a check, the CDF from the first piece gives \(F_X(2)=4/8=1/2\); the second gives \(F_X(2)=2-4/8-1=1/2\). Also, \(F_X(4)=4-16/8-1=1\).
Common mistake avoided: using \(c=1/8\) would make the total area \(4(1/8)=1/2\), not one. The correct constant is \(1/4\); consequently, \(F_X(3)=7/8\) and the interval probability is \(3/4\), not twice either of those values.
Worked Example: An Interval Crossing a Breakpoint
A hypothetical processing time \(X\), in minutes, has density
Find the normalizing constant, the CDF, and \(P(0.5<X\leq2.5)\). The density changes at \(x=1\), and the requested interval crosses that breakpoint.
Method: integrate each piece over its full range to normalize. The unscaled areas are
Thus \(c(3/2+2)=c(7/2)=1\), giving \(c=2/7\).
For \(x<0\), \(F_X(x)=0\). For \(0\leq x<1\),
At the breakpoint, \(F_X(1)=(2/7)(3/2)=3/7\). For \(1\leq x\leq3\), retain that accumulated probability and add the integral of the second piece:
For \(x>3\), \(F_X(x)=1\). To calculate the interval probability, evaluate the CDF at each endpoint:
and
Therefore \(P(0.5<X\leq2.5)=27/28-5/28=22/28=11/14\). The result is less than one, as required. The CDF is continuous at \(1\), and at \(3\) the second-piece formula gives \(3/7+(2/7)(2)=1\).
Common mistake avoided: integrating only one density formula across the whole interval from \(0.5\) to \(2.5\) ignores the breakpoint. Subtracting the CDF values avoids that error because each endpoint is evaluated with its own correct CDF expression.
Worked Example: Building a CDF Across Three Regions
A hypothetical laboratory measurement \(X\), in scaled units, has density
Find \(c\), give the CDF on its support, and calculate \(P(-0.5<X\leq1.5)\). This model has breakpoints at 0 and 1.
Method: add all three unscaled areas. The first and last pieces are triangles with base 1 and height 1, and their integrals confirm their areas:
The total unscaled area is \(1/2+1+1/2=2\), so \(2c=1\) and \(c=1/2\).
For \(-1\leq x<0\), integrate from the lower support endpoint:
At zero, the accumulated probability is \(1/4\). For \(0\leq x<1\), add the integral of the constant density:
At one, the accumulated probability is \(3/4\). For \(1\leq x\leq2\), add the area from 1 to \(x\):
The complete CDF is zero below \(-1\), uses these three expressions on their respective intervals, and is one above 2. For the requested probability,
Thus \(P(-0.5<X\leq1.5)=15/16-1/16=7/8\). The CDF pieces agree at both breakpoints: at zero they give \(1/4\), and at one they give \(3/4\). At the upper endpoint, the final expression gives \(2-4/4=1\).
Common mistake avoided: the middle density piece has height \(c\) over an interval of length one, so its unscaled area is one, not zero. Omitting that region would give the wrong normalizing constant and make the resulting CDF fail to reach one.
Checks and Common Exam Traps
After obtaining a piecewise CDF, check it as a single function rather than treating each expression independently. At every breakpoint, the probability accumulated from the left must equal the probability accumulated from the right. The CDF must also start at zero below the support and reach one at its upper endpoint. These checks often reveal a missing area or an incorrect integral limit.
- Normalizing with only one piece. The total integral includes every region of the support. A constant that normalizes one piece alone generally does not normalize the full density.
- Forgetting previous regions in the CDF. Within a later piece, add all probability accumulated before that piece. The CDF is cumulative, not just the integral of the current formula.
- Using the wrong limits. For a CDF value within one region, integrate only to \(x\) in that region, but include all earlier pieces in full.
- Applying one formula across a breakpoint. Split an integral at each change of density formula, or use \(F_X(b)-F_X(a)\) with the appropriate CDF pieces.
- Reporting an impossible probability. An interval probability must be between zero and one. If the CDF decreases or the difference is negative, check the region and endpoint calculations.
Check Your Understanding
For each problem, determine the requested constant, CDF value, or interval probability. Each density is zero outside the stated support.
- A density is \(f_X(x)=cx\) for \(0\leq x\leq2\). Find \(c\) and \(P(0.5<X\leq1.5)\). (Answer: \(c=1/2\), probability \(=1/2\).)
- A density is \(c\) for \(0\leq x<1\) and \(c(2-x)\) for \(1\leq x\leq2\). Find \(c\) and \(P(0.5<X\leq1.5)\). (Answer: \(c=2/3\), probability \(=7/12\).)
- A density is \(c(x+2)\) for \(-2\leq x<-1\), \(c\) for \(-1\leq x<1\), and \(c(2-x)\) for \(1\leq x\leq2\). Find \(c\) and \(P(-1.5<X\leq1.5)\). (Answer: \(c=1/3\), probability \(=11/12\).)
- A density is \(cx\) for \(0\leq x<1\) and \(c(2-x)\) for \(1\leq x\leq2\). Find \(c\), \(F_X(1)\), and \(P(0.25<X\leq1.75)\). (Answer: \(c=1\), \(F_X(1)=1/2\), probability \(=15/16\).)
- A density is \(c\) for \(0\leq x<1\), \(2c\) for \(1\leq x<2\), and \(c\) for \(2\leq x\leq3\). Find \(c\), \(F_X(2.5)\), and \(P(0.5<X\leq2.5)\). (Answer: \(c=1/4\), \(F_X(2.5)=7/8\), probability \(=3/4\).)