Tutorials › Statistical Theory I - Probability and Distribution Theory › Boundary Checks for Piecewise CDFs

Random Variables and Distribution Functions · Tutorial 45 of 994

Boundary Checks for Piecewise CDFs

Use branch-by-branch checks and precise breakpoint conditions to decide whether a piecewise function is a valid CDF.

Beginner 9 min read

What You'll Learn

  • Identify the boundary conditions a piecewise candidate must satisfy to be a CDF.
  • Compare each breakpoint’s left-hand limit with the value assigned at the breakpoint.
  • Distinguish a permissible upward jump from a failure of right-continuity.
  • Check branch behavior separately from monotonicity across branch boundaries.
  • Use endpoint limits to verify that the candidate starts at zero and ends at one.

Why Breakpoints Need Special Attention

A formula can behave properly on each of its pieces and still fail to define a CDF. The problem may occur exactly where one formula gives way to another: the value assigned at the breakpoint might be too small, or it might disagree with the values immediately to its right. The behavior at the two ends of the real line matters as well.

A CDF is nondecreasing, right-continuous, and has limits zero and one at negative and positive infinity. These conditions are straightforward to check for a single smooth formula. For a piecewise function, they must be checked both within each piece and at every boundary between pieces.

Definition: Let \(F:\mathbb{R}\to\mathbb{R}\). It is a CDF if it is nondecreasing, right-continuous, and satisfies $$ \lim_{x\to-\infty}F(x)=0 \qquad\text{and}\qquad \lim_{x\to+\infty}F(x)=1. $$ At a breakpoint \(b\), write \(F(b-)=\lim_{x\uparrow b}F(x)\) for the left-hand limit, when it exists. Right-continuity requires \(\lim_{x\downarrow b}F(x)=F(b)\); it does not require \(F(b-)=F(b)\).

That last distinction is essential. A CDF may jump upward at \(b\), so \(F(b-)\) can be smaller than \(F(b)\). But the value at \(b\) must agree with the limit from the right. The left-hand limit checks whether the function can rise monotonically into the breakpoint; the right-hand limit checks right-continuity there.

The Boundary Test at One Breakpoint

Suppose a function has one formula to the left of \(b\) and another formula beginning at \(b\). Assume each formula is nondecreasing on its own region, and that the left-hand limit \(F(b-)\) exists. The boundary condition for monotonicity is

Boundary condition: The values on the left and right pieces fit together monotonically at \(b\) exactly when $$ F(b-)\leq F(b). $$

The comparison uses the actual value \(F(b)\), which belongs to the piece that includes \(b\). Comparing the two formulas at \(b\) without respecting their specified domains can give the wrong answer.

Result: Let \(h\) be nondecreasing for \(x<b\), let \(g\) be nondecreasing for \(x\geq b\), and define \(F(x)=h(x)\) for \(x<b\) and \(F(x)=g(x)\) for \(x\geq b\). If \(L=\lim_{x\uparrow b}h(x)\) exists and is finite, then \(F\) is nondecreasing across the boundary if and only if \(L\leq g(b)\).

Proof. If \(L\leq g(b)\), then for every \(x<b\), nondecreasingness of \(h\) gives \(h(x)\leq L\). For every \(y\geq b\), nondecreasingness of \(g\) gives \(g(b)\leq g(y)\). Therefore $$ F(x)=h(x)\leq L\leq g(b)\leq g(y)=F(y). $$ Together with nondecreasingness within each piece, this proves that \(F\) is nondecreasing everywhere. Conversely, if \(F\) is nondecreasing, then \(h(x)=F(x)\leq F(b)=g(b)\) for every \(x<b\). Taking the left-hand limit gives \(L\leq g(b)\). Thus the condition is necessary as well as sufficient. \(\square\)

A strict inequality \(F(b-)<F(b)\) describes an upward jump, which is allowed. Equality means the pieces meet without a jump. The forbidden case is \(F(b-)>F(b)\), since values just before the breakpoint would exceed the value at the breakpoint.

A Checklist for a Piecewise Candidate

For a function defined by several formulas, place the breakpoints in increasing order and check each part systematically. Treat the point at a breakpoint as belonging to whichever branch the definition specifies; in particular, a branch written for \(b\leq x<c\) assigns the value at \(b\).

1
Check each branch.
Verify that the formula is nondecreasing on its stated interval. Check right-continuity within the interval, including its included left endpoint if there is one.
2
Check each splice.
Compute the limit from the left at every breakpoint \(b\), then compare it with the assigned value \(F(b)\). Monotonicity requires \(F(b-)\leq F(b)\).
3
Check right-continuity at the splice.
Take the limit from the right using the branch that applies at and after \(b\). It must equal \(F(b)\).
4
Check both tails.
Evaluate the limits as \(x\to-\infty\) and \(x\to+\infty\). They must be zero and one, respectively.

The conditions can be summarized as a necessary-and-sufficient test. Suppose there are finitely many breakpoints \(b_1<\cdots<b_m\), and each branch is defined on its stated interval, with each breakpoint included in the branch to its right. If every branch is nondecreasing and right-continuous on its domain, then the piecewise function is a CDF exactly when, at every breakpoint \(b_i\), \(F(b_i-)\leq F(b_i)\), and the two endpoint limits are zero and one.

To see sufficiency, take any \(x<y\). If both points lie in one branch, nondecreasingness of that branch gives \(F(x)\leq F(y)\). If they lie in different branches, pass through the finitely many breakpoints between them. On each branch values do not decrease, and at each boundary the inequality \(F(b_i-)\leq F(b_i)\) prevents a downward step. Thus \(F(x)\leq F(y)\) in all cases. Right-continuity holds inside each branch and at each breakpoint because the branch containing the breakpoint is right-continuous there and assigns its value at that point. The endpoint limits supply the remaining CDF conditions.

For necessity, a CDF restricted to any branch remains nondecreasing and right-continuous. At a breakpoint, nondecreasingness implies \(F(x)\leq F(b_i)\) for \(x<b_i\); taking the left-hand limit yields \(F(b_i-)\leq F(b_i)\). The required endpoint limits are part of the definition of a CDF. This proves the test in both directions. \(\square\)

Worked Boundary Checks

Worked Example: A Valid CDF With Two Upward Jumps

Consider $$ F(x)= \begin{cases} 0, & x<0,\\ \frac{1}{3}+\frac{x}{12}, & 0\leq x<2,\\ 1-\frac{1}{4}e^{-(x-2)}, & x\geq 2. \end{cases} $$ Check every branch, breakpoint, and endpoint.

On \(x<0\), the function is constant at zero. On \(0\leq x<2\), its slope is \(1/12>0\), so it increases. On \(x\geq2\), the derivative is \(\frac14e^{-(x-2)}>0\), so this branch also increases.

At \(x=0\), the left-hand limit is \(0\), while \(F(0)=1/3\). Thus \(F(0-)\leq F(0)\), and the jump is upward. The right-hand limit at zero is \(1/3\), equal to \(F(0)\), so right-continuity holds there.

At \(x=2\), the left-hand limit is $$ F(2-)=\frac{1}{3}+\frac{2}{12}=\frac{1}{2}. $$ The value from the branch that includes \(2\) is \(F(2)=1-\frac14=\frac34\). Hence there is another allowed upward jump, and the right-hand limit equals \(F(2)\).

Finally, the function is zero for all \(x<0\), so its limit at negative infinity is zero. As \(x\to+\infty\), \(e^{-(x-2)}\to0\), so \(F(x)\to1\). All checks pass, and \(F\) is a CDF.

Worked Example: Monotonicity and Endpoint Limits Do Not Fix Right-Continuity

Consider $$ F(x)= \begin{cases} 0, & x<0,\\ \frac{1}{2}, & x=0,\\ \frac{3}{4}, & 0<x<1,\\ 1-\frac{1}{4}e^{-(x-1)}, & x\geq1. \end{cases} $$ The function is nondecreasing: it rises from \(0\) to \(1/2\), then to \(3/4\), and the last branch increases from \(3/4\) toward \(1\). Its endpoint limits are zero and one.

But at zero, $$ \lim_{x\downarrow0}F(x)=\frac{3}{4}\neq\frac{1}{2}=F(0). $$ The function is not right-continuous at zero, so it is not a CDF. Notice that the left-hand limit at zero is \(0\); the inequality \(F(0-)\leq F(0)\) checks monotonicity at that boundary but does not repair the separate right-continuity failure.

Worked Example: Two Increasing Branches Can Still Decrease at Their Boundary

Define $$ F(x)= \begin{cases} 0, & x<0,\\ \frac{1}{5}+\frac{x}{2}, & 0\leq x<1,\\ \frac{3}{5}+\frac{2}{5}\left(1-e^{-(x-1)}\right), & x\geq1. \end{cases} $$ The middle branch increases with slope \(1/2\). The last branch has derivative \(\frac{2}{5}e^{-(x-1)}>0\), and its limit at positive infinity is one. The negative tail has limit zero.

At the breakpoint \(x=1\), the left-hand limit is $$ F(1-)=\frac{1}{5}+\frac{1}{2}=\frac{7}{10}. $$ The assigned value is $$ F(1)=\frac{3}{5}+\frac{2}{5}(1-1)=\frac{3}{5}. $$ Since \(7/10>3/5\), the function drops at \(1\). Although each formula increases on its own interval and the endpoint limits are correct, the boundary condition fails; this function is not a CDF.

Worked Example: A Smooth Join Can Still Have the Wrong Endpoint Limits

Let $$ F(x)= \begin{cases} \frac{1}{4}, & x<0,\\ \frac{1}{4}+\frac{1}{2}(1-e^{-x}), & x\geq0. \end{cases} $$ The left branch is constant, and the derivative of the right branch is \(\frac12e^{-x}>0\). At zero, the left-hand limit and the value are both \(1/4\); the right-hand limit is also \(1/4\). Thus the join is monotone and right-continuous.

However, $$ \lim_{x\to-\infty}F(x)=\frac{1}{4}, \qquad \lim_{x\to+\infty}F(x)=\frac{3}{4}. $$ Neither endpoint limit has the required value. The function is therefore not a CDF, even though it has no problematic breakpoint.

Common Mistake: Treating Every Jump as a Failure

A common but incorrect argument is: “The formulas give different values on either side of a breakpoint, so the function is discontinuous and cannot be a CDF.” This confuses ordinary continuity with right-continuity. A CDF may have an upward jump, and the jump is compatible with monotonicity when \(F(b-)\leq F(b)\). What is required is that the value at \(b\) match the limit from the right, not the limit from the left.

The opposite mistake is to check only that the formulas increase separately. Separate monotonicity cannot prevent a downward step from one branch to the next. For each breakpoint, compute the left-hand limit and compare it with the actual value assigned there; then check the right-hand limit separately. Finally, verify both tails. A candidate passes only if all these checks succeed.

Key takeaway: At every breakpoint, use \(F(b-)\leq F(b)\) to check monotonicity and \(\lim_{x\downarrow b}F(x)=F(b)\) to check right-continuity. These are distinct tests; neither replaces the checks within each branch or at infinity.

Check Your Understanding

For each question, identify which boundary or endpoint condition is relevant before deciding whether the candidate can be a CDF.

  1. At a breakpoint \(b\), suppose \(F(b-)=0.42\) and \(F(b)=0.42\). What does this establish about monotonicity across the boundary, and what additional boundary check is still needed?
  2. Suppose \(F(b-)=0.61\) and \(F(b)=0.70\), and the right-hand limit equals \(0.70\). Is the jump at \(b\) allowed? Explain.
  3. Can two nondecreasing branches joined at \(b\) make a globally nondecreasing function if \(F(b-)>F(b)\)? Why or why not?
  4. A piecewise function is nondecreasing and right-continuous everywhere, but its limit at positive infinity is \(0.9\). Is it a CDF?
  5. Why does checking \(F(b-)\leq F(b)\) not by itself guarantee right-continuity at \(b\)?