Tutorials › Statistical Theory I - Probability and Distribution Theory › Interval Probabilities from CDF Differences

Random Variables and Distribution Functions · Tutorial 35 of 994

Interval Probabilities from CDF Differences

Learn to calculate bounded-interval probabilities from CDF differences and understand the event decomposition that justifies the formula.

Beginner 8 min read

What You'll Learn

  • Derive the probability formula for an interval of the form a < X ≤ b
  • Explain why subtracting F(a) removes outcomes at or below the lower bound
  • Calculate interval probabilities from discrete, uniform, and mixed-distribution CDFs
  • Check that a computed interval probability is nonnegative and no greater than one
  • Divide a bounded interval into adjacent pieces and verify the probabilities add

Why CDF Differences Give Interval Probabilities

A cumulative distribution function records the probability that a random variable is at or below a specified value. Comparing its values at two points therefore gives a way to find the probability that the variable falls between them. This calculation is useful even when a distribution has no density or when its probabilities are not described by a simple formula.

The subtraction has a precise event interpretation: the outcomes counted by the CDF at the lower bound are removed from those counted at the upper bound. The remaining outcomes are exactly those in the bounded interval.

Definition: For a real-valued random variable \(X\), its cumulative distribution function (CDF) is \(F(x)=P(X\le x)\) for every real number \(x\). For real numbers \(a\le b\), the bounded interval event considered here is \(\{a<X\le b\}\).

The CDF-Difference Formula

Suppose \(a\le b\). Every outcome for which \(X\le a\) also satisfies \(X\le b\), so the event \(\{X\le a\}\) is contained in \(\{X\le b\}\). The outcomes counted by the second event but not the first are precisely those for which \(a<X\le b\).

Theorem: For any real-valued random variable \(X\) with CDF \(F\), and any real numbers \(a\le b\),
$$ P(a<X\le b)=F(b)-F(a). $$

Here the identity follows from probability additivity; it does not require \(X\) to have a density, and it does not require the CDF to be continuous at either bound.

1
Start with the event at the upper bound.
\(\{X\le b\}\) has probability \(F(b)\).
2
Remove the event at the lower bound.
\(\{X\le a\}\) is contained in \(\{X\le b\}\) and has probability \(F(a)\).
3
Identify what remains.
The set difference is \(\{X\le b\}\setminus\{X\le a\}=\{a<X\le b\}\).

This decomposition also explains the roles of the two CDF values. \(F(b)\) counts outcomes at or below \(b\). Subtracting \(F(a)\) removes outcomes at or below \(a\), leaving those strictly above \(a\) and at or below \(b\). The formula works for a distribution with point masses as well as for a continuous distribution.

Proof: Since \(a\le b\), the events \(A=\{X\le a\}\) and \(B=\{a<X\le b\}\) are disjoint, and their union is \(\{X\le b\}\). Additivity for disjoint events gives \(P(X\le b)=P(X\le a)+P(a<X\le b)\). By the definition of the CDF, \(P(X\le b)=F(b)\) and \(P(X\le a)=F(a)\). Rearranging proves the formula. If \(a=b\), the interval event is empty and both sides are zero. \(\square\)

Worked Applications

To calculate an interval probability, identify the two bounds, evaluate the CDF at each bound, and subtract the lower-bound value from the upper-bound value. When possible, check the result against the outcomes or model that define the distribution.

Worked Example: A Discrete Distribution

Suppose \(X\) takes the values \(-2,1,3,5\) with probabilities \(0.10,0.25,0.40,0.25\), respectively. Find \(P(0<X\le3)\).

The event \(\{X\le 3\}\) includes the values \(-2,1,3\), so

$$ F(3)=0.10+0.25+0.40=0.75. $$

The event \(\{X\le0\}\) includes only the value \(-2\), so \(F(0)=0.10\). Therefore,

$$ P(0<X\le3)=F(3)-F(0)=0.75-0.10=0.65. $$

Check directly: the values of \(X\) satisfying \(0<X\le3\) are 1 and 3. Their probabilities add to \(0.25+0.40=0.65\), as required.

Worked Example: A Uniform Distribution

Let \(X\) have a uniform distribution on the interval from 0 to 8. Its CDF is \(F(x)=0\) for \(x<0\), \(F(x)=x/8\) for \(0\le x\le8\), and \(F(x)=1\) for \(x>8\). Find \(P(2<X\le6)\).

Both bounds lie between 0 and 8, so the middle expression for the CDF applies:

$$ F(6)=\frac{6}{8}=0.75,\qquad F(2)=\frac{2}{8}=0.25. $$

Subtracting gives

$$ P(2<X\le6)=F(6)-F(2)=0.75-0.25=0.50. $$

As a check, the interval has length \(6-2=4\) out of the full range length \(8\), and \(4/8=0.50\). The CDF calculation gives the same answer.

Worked Example: A Distribution With Both an Atom and a Continuous Component

Suppose a random variable has probability \(0.20\) at 0 and, with probability \(0.80\), follows a uniform distribution on \([0,4]\). Its CDF is

$$ F(x)= \begin{cases} 0, & x<0,\\ 0.20+0.80\left(\dfrac{x}{4}\right), & 0\le x\le4,\\ 1, & x>4. \end{cases} $$

Find \(P(1<X\le3)\). Both bounds are in the middle range of the CDF, so

$$ F(3)=0.20+0.80\left(\frac{3}{4}\right)=0.20+0.60=0.80, $$

and

$$ F(1)=0.20+0.80\left(\frac{1}{4}\right)=0.20+0.20=0.40. $$

Thus

$$ P(1<X\le3)=0.80-0.40=0.40. $$

The same result follows from the mixture description: the atom at 0 is outside the interval, while the uniform component contributes \(0.80\) times the fraction \((3-1)/4=1/2\). This is \(0.80(1/2)=0.40\). The agreement illustrates that CDF subtraction applies without separating a distribution into types.

Adjacent Intervals and a Check on Calculations

The formula also ensures that probabilities across adjacent pieces combine correctly. If an interval is split at an intermediate point \(c\), where \(a<c<b\), then the two pieces \(\{a<X\le c\}\) and \(\{c<X\le b\}\) are disjoint and together make up \(\{a<X\le b\}\).

Result: If \(a<c<b\), then
$$ P(a<X\le b)=P(a<X\le c)+P(c<X\le b). $$

Indeed, applying the CDF-difference formula to each piece gives

$$ \begin{aligned} P(a<X\le c)+P(c<X\le b) &=[F(c)-F(a)]+[F(b)-F(c)]\\ &=F(b)-F(a)\\ &=P(a<X\le b). \end{aligned} $$

The middle CDF value cancels. More generally, for any finite partition \(a=t_0<t_1<\cdots<t_k=b\), the probabilities of the adjacent pieces add to the probability of the whole interval:

$$ \sum_{i=1}^{k}P(t_{i-1}<X\le t_i) =\sum_{i=1}^{k}[F(t_i)-F(t_{i-1})] =F(b)-F(a) =P(a<X\le b). $$

The cancellation in this sum is called telescoping: every intermediate term \(F(t_i)\) appears once with a plus sign and once with a minus sign. This provides a useful check when an interval probability is calculated in pieces.

Common Mistake and Practical Checks

A common error is to subtract in the wrong order, writing \(F(a)-F(b)\). Since a CDF is nondecreasing and \(a\le b\), \(F(a)\le F(b)\). The reversed subtraction is therefore nonpositive, which cannot be the probability of an event unless the difference happens to be zero. Use upper-bound CDF value minus lower-bound CDF value.

Another mistake is to treat a CDF value as if it were the probability of the interval ending at that point. By definition, \(F(b)\) includes all outcomes at or below \(b\), not just outcomes in the interval of interest. The lower-bound term is needed to remove the outcomes that are too small.

Before accepting a result, check that \(F(b)\) and \(F(a)\) were evaluated from the appropriate parts of the CDF, that the subtraction is in the correct order, and that the answer is between 0 and 1. Monotonicity gives \(F(b)-F(a)\ge0\), and the fact that this difference is a probability gives \(F(b)-F(a)\le1\). If the interval is divided into pieces, their probabilities should sum to the same total.

Key takeaway: For any CDF \(F\) and real numbers \(a\le b\), the probability of the bounded interval event \(\{a<X\le b\}\) is \(F(b)-F(a)\). The formula is a direct consequence of nested events and applies to discrete, continuous, and mixed distributions.

Check Your Understanding

Use the CDF-difference formula and the event interpretation to answer these questions.

  1. If \(F(5)=0.82\) and \(F(2)=0.37\), what is \(P(2<X\le5)\)?
  2. A random variable takes values 0, 2, and 6 with probabilities 0.20, 0.50, and 0.30. Calculate \(P(1<X\le6)\) using CDF values, then check by identifying the possible values in the event.
  3. Why is \(F(b)-F(a)\), rather than \(F(a)-F(b)\), the appropriate subtraction when \(a<b\)?
  4. If \(a<c<b\), explain why the probabilities of \(\{a<X\le c\}\) and \(\{c<X\le b\}\) add to \(P(a<X\le b)\).
  5. What basic probability check can you apply to a computed value of \(F(b)-F(a)\), and which property of a CDF supports it?