Why Integer Endpoints Need Care
For a discrete uniform variable, every integer in its support has the same probability. An interval probability is therefore a counting problem: identify which support integers satisfy the event, count them, and divide by the number of integers in the entire support. The main source of error is usually not the division. It is deciding whether an endpoint integer belongs in the event.
Words such as “at least,” “less than,” and “between” specify different endpoint rules. Those rules still matter when an interval boundary is not an integer, and the variable’s support may cut off part of the interval. A systematic procedure prevents these details from turning into off-by-one errors.
The support endpoints \(a\) and \(b\) are included. The number of support values is \(b-a+1\), not \(b-a\): for example, the integers from 6 through 10 are \(6,7,8,9,10\), which makes five values. The probability rule assumes the discrete uniform model applies to every integer in the stated support; it does not apply if some support values have different probabilities.
Turning Interval Conditions into Integer Bounds
Suppose an event places \(X\) between real-number boundaries \(L\) and \(U\). First determine the smallest and largest integers permitted by the endpoint conditions. Then restrict those integers to the support. The following rules work whether or not the boundaries are integers.
| Left condition | Smallest permitted integer | Right condition | Largest permitted integer |
|---|---|---|---|
| \(L\le X\) | \(\lceil L\rceil\) | \(X\le U\) | \(\lfloor U\rfloor\) |
| \(L<X\) | \(\lfloor L\rfloor+1\) | \(X<U\) | \(\lceil U\rceil-1\) |
Here, \(\lceil z\rceil\) is the smallest integer greater than or equal to \(z\), and \(\lfloor z\rfloor\) is the greatest integer less than or equal to \(z\). Once the endpoint rules give a provisional lower bound \(r\) and upper bound \(s\), clip them to the support: the first counted value is \(\max(a,r)\), and the last is \(\min(b,s)\). If the first exceeds the last, the interval contains no support values.
Why the Counting Formula Works
After applying the endpoint rules and clipping to the support, the event consists of consecutive integers from \(r^*=\max(a,r)\) through \(s^*=\min(b,s)\). When \(r^*\le s^*\), their count is \(s^*-r^*+1\): subtracting gives the number of unit steps from the first value to the last, and adding one includes the first value. When \(r^*>s^*\), there are no such integers, so the count is zero. Each counted value has probability \(1/(b-a+1)\), and the events corresponding to different values are disjoint. Adding their equal probabilities gives $$ P(E)=\sum_{x\in E}\frac{1}{b-a+1}=\frac{c}{b-a+1}. $$