Tutorials › VEE Mathematical Statistics › Integer-Interval Probabilities for Discrete Uniform Variables

VEE Mathematical Statistics · Hypergeometric and Discrete Uniform Models · Tutorial 140 of 880

Integer-Interval Probabilities for Discrete Uniform Variables

Translate interval conditions into the smallest and largest allowable support integers, then count and divide by the support size.

Intermediate 12 min read

What You'll Learn

  • Find the probability of an interval by counting its allowable integers.
  • Translate inclusive and exclusive endpoints into integer bounds.
  • Handle noninteger cutoffs and intervals that extend beyond the support.
  • Add counts for disjoint intervals and check for overlap.
  • Avoid off-by-one errors at integer endpoints.

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.

Definition: If \(X\) is discrete uniform on the consecutive integers \(\{a,a+1,\ldots,b\}\), where \(a\) and \(b\) are integers and \(a\le b\), then each support value has probability \(1/n\), where \(n=b-a+1\). For any event \(E\) consisting of \(c\) support values, \(P(E)=c/n\).

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 conditionSmallest permitted integerRight conditionLargest 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.

Result: For an interval event with provisional integer bounds \(r\) and \(s\), the number of support values in the event is $$ c=\max\left(0,\ \min(b,s)-\max(a,r)+1\right). $$ Its probability under the discrete uniform model on \(\{a,\ldots,b\}\) is \(c/(b-a+1)\).

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}. $$

This justification also explains why the formula is specific to a discrete uniform distribution: for a nonuniform discrete model, the event probability is generally the sum of the probabilities of its included values, not the number of values divided by the support size.

1
Record the full support.
Write the lowest and highest possible integers, \(a\) and \(b\), and calculate \(n=b-a+1\).
2
Translate each endpoint.
Use the appropriate floor or ceiling rule for inclusive or exclusive boundaries.
3
Restrict to the support.
Replace the lower bound by the larger of it and \(a\), and the upper bound by the smaller of it and \(b\).
4
Count, divide, and check.
Count the included integers, divide by \(n\), and verify that the count is between zero and \(n\).

Worked Interval Calculations

Worked Example: A Mixed Interval with Noninteger Boundaries

A hypothetical administrative system assigns an integer code \(X\) uniformly from 40 through 64, inclusive. Find \(P(47.5<X\le 58.2)\). This is a discrete uniform model with support \(\{40,41,\ldots,64\}\) and parameters \(a=40\), \(b=64\), and \(n=64-40+1=25\). No interest or mortality assumption is used; the codes are not financial payments or life-contingency outcomes.

Method: convert both conditions to integer bounds. The strict lower condition \(47.5<X\) requires \(X\ge\lfloor47.5\rfloor+1=47+1=48\). The inclusive upper condition \(X\le58.2\) requires \(X\le\lfloor58.2\rfloor=58\).

The permitted values are therefore \(48,49,\ldots,58\). Their count is \(58-48+1=11\), so $$ P(47.5<X\le58.2)=\frac{11}{25}=0.44. $$

Check: The list from 48 through 58 contains 11 integers, and \(0.44\) lies between zero and one. A common mistake is to round 47.5 to 48 and then add one again, incorrectly starting at 49. The strict-bound rule already produces the first permissible integer, 48.

Worked Example: An Integer Boundary Excluded on One Side

A hypothetical file has an integer category \(X\), uniformly distributed over \(\{-8,-7,\ldots,17\}\). Find both \(P(-3\le X<9)\) and the probability of the complementary event. The model is discrete uniform with \(a=-8\), \(b=17\), and \(n=17-(-8)+1=26\). There is no interest rate or mortality assumption in this integer-category model.

Method: count the interval, then use its complement. The inclusive lower bound permits \(-3\). The strict upper bound \(X<9\) permits at most \(\lceil9\rceil-1=8\). Thus the interval contains \(-3,-2,\ldots,8\), for a count of $$ 8-(-3)+1=12. $$

Therefore, $$ P(-3\le X<9)=\frac{12}{26}=\frac{6}{13}=0.4615 $$ to four decimal places. The complementary event contains the other \(26-12=14\) support values, so its probability is $$ 1-\frac{12}{26}=\frac{14}{26}=\frac{7}{13}=0.5385 $$ to four decimal places.

Check: The two probabilities add to \(1\). The integer 9 is excluded, while \(-3\) is included. A common mistake is to count \(-3\) through 9, giving 13 values; that incorrectly includes the upper endpoint.

Worked Example: A Union of Intervals Clipped by the Support

A hypothetical integer index \(X\) is discrete uniform on \(\{101,102,\ldots,145\}\). Find \(P\big((112\le X<129)\text{ or }(137<X\le150)\big)\). The distribution is discrete uniform with \(a=101\), \(b=145\), and \(n=145-101+1=45\). The index is not a payment, so no interest or mortality assumption is used.

Method: count each disjoint interval after clipping. In the first interval, \(112\le X<129\) gives the integers 112 through 128. There are \(128-112+1=17\) such values. In the second interval, \(137<X\le150\) gives 138 through 150 before support clipping. The support ends at 145, so only 138 through 145 are possible; that is \(145-138+1=8\) values.

The intervals do not overlap, so their counts can be added: \(17+8=25\). Thus $$ P\big((112\le X<129)\text{ or }(137<X\le150)\big) =\frac{25}{45}=\frac{5}{9}=0.5556 $$ to four decimal places.

Check: The omitted support values are 101 through 111, a count of 11, and 129 through 137, a count of 9. The omitted count is \(11+9=20\), so the event count is \(45-20=25\), agreeing with the direct calculation. A common mistake is to count 146 through 150 even though those integers are outside the support.

Common Endpoint and Support Traps

The method applies to any interval described by real-number boundaries, provided the support and the endpoint conditions are stated. It also applies to a union of intervals after the permitted integers in each part are identified. It does not replace a probability sum when the distribution is not uniform, and it cannot assign positive probability to values outside the specified support.

Key takeaway: Resolve endpoint inclusion before counting. Convert the interval to its first and last permitted integers, clip those bounds to the support, count with “last minus first plus one,” and divide by the full support size.

Check Your Understanding

For each problem, first identify the integers satisfying the event and then use the full support size as the denominator.

  1. \(X\) is discrete uniform on \(\{0,1,\ldots,18\}\). Find \(P(3\le X\le11)\). (Answer: \(9/19\))
  2. \(X\) is discrete uniform on \(\{-12,-11,\ldots,20\}\). Find \(P(-4<X\le9.5)\). (Answer: \(13/33\))
  3. \(X\) is discrete uniform on \(\{250,251,\ldots,310\}\). Find \(P((270\le X<295)\text{ or }(302\le X\le318))\). (Answer: \(34/61\))
  4. \(X\) is discrete uniform on \(\{15,16,\ldots,54\}\). Find the probability that \(X\) is not in the interval \((26,39]\). (Answer: \(27/40\))
  5. \(X\) is discrete uniform on \(\{-20,-19,\ldots,25\}\). Find \(P(-3.2\le X<7.8)\). (Answer: \(11/46\))
Back to Tutorials
Clinical Biostats