PROBABILITY MODEL CHECKS

Checking a bounded binomial count interval

To get the probability that a binomial count lands in an inclusive range, take the cumulative probability at the upper count and subtract the cumulative probability one count below the lower count.

Why one cumulative output is not enough

The binomial calculator reports two probabilities for a chosen count k: the mass at exactly k and the cumulative probability of every count from zero through k. A question such as "between 2 and 3 successes, both included" is neither of those. It asks for a slice of the distribution that starts above zero, so a single cumulative value always carries extra probability from the low counts that the question excludes. The fix is to run the calculator twice, once at the upper boundary and once at a boundary chosen to remove everything below the lower endpoint, and then subtract. This page walks through that recipe for five fair trials and then for a less symmetric model, with attention to the one detail that goes wrong most often: which count the lower boundary should be.

The five-trial case from start to finish

Take five independent trials, each with success probability 0.5. The question asks for the probability of two or three successes. At n = 5, k = 3 and p = 0.5 the cumulative output is 0.8125, which covers counts 0, 1, 2 and 3. At k = 1 the cumulative output is 0.1875, which covers counts 0 and 1. Subtracting leaves 0.8125 minus 0.1875, or 0.625, and what remains is exactly counts 2 and 3. A cross-check uses the mass output: each of those two counts has probability 0.3125 at n = 5 and p = 0.5, and 0.3125 plus 0.3125 is 0.625. The two routes agree, which is a good habit whenever the interval is short enough to add by hand.

Why the lower boundary is one count below the endpoint

The cumulative output at k includes k itself. If you subtract the cumulative probability at 2 from the cumulative probability at 3, the count 2 disappears along with everything below it, and you are left with the mass at 3 alone, which is 0.3125. That is the answer to a different question, namely "exactly 3". To keep the lower endpoint, the subtraction must stop at the count just under it. For integer counts, "at least 2" and "greater than 1" describe the same event, so the lower boundary is 1. This works only because binomial counts are whole numbers. A continuous variable has no neighboring value to step down to, which is why interval questions about continuous models do not need this adjustment.

Translating wording into boundaries

Phrases about intervals are often ambiguous, so write the inequality before touching the calculator. "From 2 to 3" and "between 2 and 3 inclusive" mean 2 ≤ X ≤ 3, with boundaries 3 and 1. "More than 1 and fewer than 4" means 1 < X < 4, which for whole numbers is the same event as 2 ≤ X ≤ 3, so it also uses 3 and 1. "At least 2 but fewer than 4" is again 2 ≤ X ≤ 3. The general rule for whole-number counts is that an inclusive interval from a to b uses the cumulative at b minus the cumulative at a − 1, and every strict inequality can be converted to an inclusive one by moving the endpoint by one. Writing the converted inequality next to the result also tells later readers exactly which counts were included.

A ten-trial example with p = 0.3

Suppose ten independent trials each succeed with probability 0.3, and you want 2 to 4 successes inclusive. At n = 10, k = 4, p = 0.3 the cumulative probability is about 0.84973. At k = 1 it is about 0.14931. Subtracting gives about 0.70042, the probability of exactly 2, 3 or 4 successes. The individual masses support this: about 0.23347 at 2, 0.26683 at 3 and 0.20012 at 4 add to the same total. Because the distribution is not symmetric here, the lower tail is much lighter than the upper tail, and nothing about the symmetric five-trial example would have predicted that. The same two-run recipe applies unchanged; only the numbers differ. Keep full precision from the calculator until the final subtraction, then round once.

Checking the result for sensible size

Two quick checks catch most slips. First, the answer must lie between 0 and 1, and it must be no larger than the cumulative probability at the upper boundary. If subtraction gives a negative number, the two values were entered in the wrong order. Second, compare the answer with the distribution shape. In the ten-trial example the expected count is 3, so the range 2 to 4 sits around the center and should hold a large share of the probability. A result of 0.70 fits that picture, while 0.07 would suggest the boundaries were mistyped. For short ranges, adding the individual masses is an independent confirmation, and it costs one calculator run per included count.

Mistakes that change the answer

The most frequent error is subtracting the cumulative probability at the lower endpoint instead of one below it, which drops the lower count from the interval. A second error is using the mass output where the cumulative output is needed, or the reverse. A third is reading "between" as exclusive when the source meant inclusive, so keep the original wording with the result. Entering a lower boundary of −1 for an interval that starts at 0 is also easy to do; the cumulative probability below zero is 0, so the answer then equals the cumulative at the upper boundary and no subtraction is needed. Finally, check that n is the total number of trials and k is a count, not a proportion.

Open ends and one-sided ranges

Some ranges have only one real boundary. "At most 3" needs a single run at k = 3, because nothing needs removing below zero. "At least 2" is the complement of "at most 1", so it needs one run at k = 1 and a subtraction from 1. At n = 5 and p = 0.5 that gives 1 − 0.1875 = 0.8125, which equals the cumulative probability at 3 only by the symmetry of that particular model, so do not expect the same coincidence at other values of p. Two-sided intervals are just the difference of two such one-sided pieces, which is why a clear habit with the one-sided cases carries over directly.

What the interval calculation assumes

Everything above rests on the binomial model: a fixed number of trials, two outcomes on each, a constant success probability and independence between trials. The numbers in these examples are supplied for illustration, and the arithmetic says nothing about whether a real process meets those conditions. If trials influence each other or the success probability drifts, the binomial mass and cumulative outputs no longer describe the situation, however carefully the boundaries are chosen. The subtraction step also adds no uncertainty analysis. It returns a model probability, not a confidence statement about data, so it should be reported as the probability under the stated n and p.

Reproduce the checks

Upper cumulative boundary

Open the Binomial Probability Calculator and enter:

Number of trials
5
Successes / event count
3
Success probability
0.5

Expected output:

Cdf

0.8125

Pmf

0.3125

The upper endpoint remains included.

Below the lower endpoint

Open the Binomial Probability Calculator and enter:

Number of trials
5
Successes / event count
1
Success probability
0.5

Expected output:

Cdf

0.1875

Stop one count below two.

Closed interval probability

Open the Basic calculator and enter:

First number
0.8125
Operation
subtract
Second number
0.1875

Expected output:

Result

0.625

The subtraction retains counts two and three.

References and implementation scope

The examples describe the behavior of the linked Computandum tools. A successful local check does not establish that another application accepts the same format or applies the same limits.

Sources

Related tasks