Tutorials › Statistical Theory I - Probability and Distribution Theory › Checking Whether a Function Can Be a CDF

Random Variables and Distribution Functions · Tutorial 44 of 994

Checking Whether a Function Can Be a CDF

Use the defining properties of a CDF to assess candidate functions and distinguish necessary conditions from redundant checks.

Beginner 9 min read

What You'll Learn

  • State the defining requirements for a cumulative distribution function.
  • Check a candidate’s range, monotonicity, right-continuity, and limits at infinity.
  • Explain why the range condition follows from the other CDF requirements.
  • Identify precisely which CDF condition fails in common counterexamples.
  • Understand why the CDF requirements are sufficient as well as necessary.

Introduction

A formula may take values between zero and one and still fail to describe probabilities. It might decrease somewhere, jump in the wrong way at a point, or approach the wrong values at the ends of the real line. Checking these possibilities systematically is how we decide whether a proposed function could be the cumulative distribution function of a real-valued random variable.

The four checks are range, monotonicity, right-continuity, and boundary limits. They are not all logically independent: the range requirement follows from the other three. Still, checking it directly is useful because a range violation immediately rules out a CDF.

The CDF Requirements

Definition: The cumulative distribution function (CDF) of a real-valued random variable \(X\) is \(F(x)=P(X\le x)\), for every real number \(x\). A real-valued function \(F\) is a CDF if and only if it is nondecreasing, right-continuous, and satisfies \(\lim_{x\to-\infty}F(x)=0\) and \(\lim_{x\to\infty}F(x)=1\). These conditions also imply that \(F(x)\in[0,1]\) for every \(x\).

Here, nondecreasing means that \(F(a)\le F(b)\) whenever \(a\le b\). Right-continuous means that for every real \(x\), \(\lim_{h\downarrow0}F(x+h)=F(x)\). The boundary limits describe what happens far to the left and far to the right; they are limits of the function, not values that must be attained at finite inputs.

A CDF takes values in \([0,1]\) because every probability does. Its monotonicity follows because if \(a\le b\), then the event \(\{X\le a\}\) is contained in \(\{X\le b\}\). The right-continuity and boundary limits follow from continuity properties of probability. The next result makes those necessities precise, and also shows that the requirements characterize CDFs.

Theorem: A function \(F:\mathbb{R}\to\mathbb{R}\) is the CDF of some real-valued random variable if and only if it is nondecreasing and right-continuous, with limits \(0\) at \(-\infty\) and \(1\) at \(+\infty\).

Why the Requirements Are Necessary and Sufficient

First suppose \(F(x)=P(X\le x)\). If \(a\le b\), event inclusion gives \(F(a)\le F(b)\). To establish right-continuity at \(x\), take any sequence \(x_n\downarrow x\). The events \(\{X\le x_n\}\) decrease to \(\{X\le x\}\). Continuity of probability for decreasing events therefore gives \(F(x_n)\to F(x)\). This sequential limit establishes right-continuity.

For the boundary limits, take the integer sequences \(n\) and \(-n\). The events \(\{X\le -n\}\) decrease to the empty set because \(X\) is real-valued, while \(\{X\le n\}\) increase to the whole sample space. Continuity of probability for decreasing events (the first sequence) and increasing events (the second) gives the two limits. Thus every CDF has the stated properties.

For sufficiency, suppose \(F\) has those properties. Let \(U\) be uniform on \((0,1)\), and, for \(0<u<1\), define

$$ Q(u)=\inf\{y\in\mathbb{R}:F(y)\ge u\}. $$

The boundary limits ensure that the set in this definition is nonempty and bounded below, so \(Q(u)\) is finite. For any real \(x\), we claim that \(Q(u)\le x\) exactly when \(u\le F(x)\). If \(u\le F(x)\), then \(x\) belongs to the set defining the infimum, so \(Q(u)\le x\). Conversely, write \(q=Q(u)\). By the definition of an infimum, for each positive integer \(n\) there is a point \(y_n\) in the set with \(q\le y_n<q+1/n\). Thus \(y_n\to q\) from the right, and right-continuity gives \(F(q)=\lim_{n\to\infty}F(y_n)\ge u\). If \(q\le x\), monotonicity then gives \(F(x)\ge F(q)\ge u\).

Consequently, the events \(\{Q(U)\le x\}\) and \(\{U\le F(x)\}\) are equal. In particular, \(Q\) is measurable, since these sublevel events are measurable. Because \(F(x)\in[0,1]\), uniformity of \(U\) gives

$$ P(Q(U)\le x)=P(U\le F(x))=F(x). $$

So \(F\) is the CDF of the real-valued random variable \(Q(U)\), proving sufficiency. \(\square\)

A Practical Screening Order

For a proposed formula, check the requirements in a deliberate order. Record each failure rather than stopping at the first one: one candidate can fail more than one condition. A useful sequence is:

1
Check the range.
Look for any input at which the function is below zero or above one. Either value is impossible for a probability.
2
Check monotonicity.
Compare values at ordered inputs, or use a derivative when the function is differentiable. A decrease rules out a CDF.
3
Check right-continuity.
At points where the formula or its behavior changes, compare the function value with its limit from the right.
4
Check both boundary limits.
The limit as \(x\to-\infty\) must be zero, and the limit as \(x\to\infty\) must be one.

The direct range check is quick, but there is a useful logical distinction: range is not an additional requirement once monotonicity and the two boundary limits have been verified.

Result: If \(F\) is nondecreasing and has limits \(0\) at \(-\infty\) and \(1\) at \(+\infty\), then \(0\le F(x)\le1\) for every real \(x\). Indeed, for \(t<x<s\), monotonicity gives \(F(t)\le F(x)\le F(s)\). Letting \(t\to-\infty\) and \(s\to+\infty\) gives the bounds. Therefore, a range violation means that at least one of monotonicity or the boundary limits must also fail. \(\square\)

Worked Checks

Worked Example: A Valid CDF Candidate

Consider \(F(x)=1/(1+e^{-x})\) for every real \(x\). Check all the CDF requirements.

Range. Since \(e^{-x}>0\), the denominator \(1+e^{-x}\) is greater than one. Hence \(0<F(x)<1\) for every finite \(x\).

Monotonicity. The function is differentiable, and

$$ F'(x)=\frac{e^{-x}}{(1+e^{-x})^2}>0. $$

Thus it is increasing, and in particular nondecreasing.

Right-continuity. The formula is continuous for every real \(x\), so it is right-continuous.

Boundary limits. As \(x\to-\infty\), \(e^{-x}\to\infty\), so \(F(x)\to0\). As \(x\to\infty\), \(e^{-x}\to0\), so \(F(x)\to1\). All the requirements hold; by the characterization theorem, this function is a CDF.

Worked Example: Correct Range, Incorrect Boundary Limits

Consider the constant function \(G(x)=1/2\). It is tempting to accept it because its values are probabilities and it never decreases. Check the remaining requirements.

Range and monotonicity. The value \(1/2\) lies in \([0,1]\), and \(G\) is nondecreasing because \(G(a)=G(b)\) for all \(a,b\).

Right-continuity. A constant function is continuous, so this requirement holds.

Boundary limits. Both limits equal \(1/2\), not the required values:

$$ \lim_{x\to-\infty}G(x)=\frac12\ne0, \qquad \lim_{x\to\infty}G(x)=\frac12\ne1. $$

Therefore \(G\) is not a CDF. The exact failures are both boundary conditions; range, monotonicity, and right-continuity pass.

Worked Example: A Monotone Function That Is Not Right-Continuous

Define \(H\) by \(H(x)=0\) for \(x<0\), \(H(0)=1/2\), and \(H(x)=1\) for \(x>0\). Check the conditions separately.

Range. Every value is in \([0,1]\). Monotonicity. Values are zero to the left of zero, \(1/2\) at zero, and one to the right, so the function never decreases. Boundary limits. Its limits are zero at \(-\infty\) and one at \(+\infty\).

At zero, however, the limit from the right is one, whereas \(H(0)=1/2\):

$$ \lim_{h\downarrow0}H(0+h)=1\ne\frac12=H(0). $$

Thus \(H\) fails right-continuity and is not a CDF, despite passing the other three checks.

Worked Example: A Decrease Disqualifies a Candidate

Define \(K(x)=0\) for \(x<0\), \(K(x)=0.7\) for \(0\le x<1\), \(K(x)=0.4\) for \(1\le x<2\), and \(K(x)=1\) for \(x\ge2\).

Range. All four possible values lie between zero and one. Boundary limits. The function is zero sufficiently far to the left and one sufficiently far to the right, so the limits are correct.

Right-continuity. At each change point the function takes the value it has immediately to the right: \(K(0)=0.7\), \(K(1)=0.4\), and \(K(2)=1\). Away from those points it is constant on a neighborhood. Thus it is right-continuous everywhere.

Monotonicity. This condition fails: \(0.9<1\), but \(K(0.9)=0.7>0.4=K(1)\). The decrease from \(0.7\) to \(0.4\) rules out a CDF.

Common Pitfall and Why the Checks Matter

A common mistake is to conclude that a function is a CDF merely because its values lie between zero and one. That condition is necessary, but it is not enough: the constant function \(G(x)=1/2\) has an acceptable range yet has the wrong boundary limits. The reverse mistake is to treat range as fully independent. Once nondecreasing behavior and both correct boundary limits are established, the range follows automatically. In practice, check the range for a quick rejection, but use all the defining conditions to justify acceptance.

These checks matter because a CDF is not just a bounded curve: its values must consistently encode probabilities of events of the form \(\{X\le x\}\). Monotonicity expresses event inclusion, right-continuity captures the behavior at a threshold, and the boundary limits ensure that the total probability is one and that no probability is left beyond the real line. When a candidate fails, naming the precise failed condition is more informative than saying only that its graph “looks wrong.”

Check Your Understanding

For each candidate, decide whether it can be a CDF and identify every condition that fails.

  1. A function takes values in \([0,1]\), is nondecreasing and right-continuous, but has limit \(0.8\) as \(x\to\infty\). Is it a CDF?
  2. Why does a function satisfying monotonicity and both boundary limits necessarily take values in \([0,1]\)?
  3. For \(H\) in the third worked example, which condition fails, and what is the right-hand limit at zero?
  4. Can a function have the correct range and boundary limits but fail the CDF requirements? Give a reason based on the fourth worked example.
  5. State the three conditions in the CDF characterization theorem, distinguishing the two boundary limits.