Why Remainder Counts Matter
A discrete uniform model assigns the same probability to every integer in a finite support. When an event asks whether the outcome is even, odd, divisible by an integer, or has a specified remainder, the calculation is therefore a counting problem: count the support values that satisfy the condition, then divide by the total number of support values.
The endpoints matter. A consecutive support can contain equal numbers of even and odd integers, but that is not guaranteed: if the support contains an odd number of integers, one parity occurs once more than the other. The same care is needed for other remainders, especially when the lower endpoint is negative or does not itself satisfy the stated condition.
Counting Parity and Remainders
Evenness is the remainder-zero condition modulo \(2\), and oddness is the remainder-one condition modulo \(2\). More generally, values with a fixed remainder modulo \(m\) appear every \(m\) integers. Once the first qualifying value in the support is identified, the rest form an arithmetic sequence with common difference \(m\).
A convenient formula counts the values in a remainder class without listing them. For integer endpoints \(a\le b\), positive integer \(m\), and any integer \(r\), the number of integers \(x\) in the interval from \(a\) through \(b\) satisfying \(x\equiv r\pmod m\) is:
Here \(\lfloor z\rfloor\) is the greatest integer less than or equal to \(z\). The floor operation is important for negative endpoints: it always rounds downward, not toward zero. For a discrete uniform \(X\), the corresponding probability is \(N_r/(b-a+1)\).
Why the Counting Formula Works
Every integer congruent to \(r\) modulo \(m\) can be written uniquely as \(r+km\) for an integer \(k\). The condition that this value be at most an integer \(t\) is \(r+km\le t\), or \(k\le(t-r)/m\). Since \(k\) is an integer, the number of permitted steps up to \(t\) is counted using a floor.
To count only values from \(a\) through \(b\), count the qualifying values up to \(b\), then subtract those up to \(a-1\). This gives:
Each qualifying value has probability \(1/(b-a+1)\) under the discrete uniform model, so multiplying the count by that common probability gives the event probability. This argument works for negative as well as positive endpoints because the floor inequality remains valid for every real number.
Worked Examples
Worked Example: Parity and a Remainder on One Support
A hypothetical machine assigns a setting \(X\) uniformly at random from the integers \(17\) through \(42\), inclusive. Find (a) the probability that \(X\) is odd and (b) the probability that \(X\equiv2\pmod5\). This is a discrete uniform model with \(a=17\), \(b=42\), and \(n=42-17+1=26\). No interest rate or mortality assumption applies to this setting-selection model.
Method for (a): count odd values. The odd support values are \(17,19,21,\ldots,41\). There are \((41-17)/2+1=13\) such values. Therefore:
Method for (b): count the specified residue class. Starting at \(17\), the values congruent to \(2\) modulo \(5\) are \(17,22,27,32,37,42\). The count is \(6\). The formula confirms it:
Check. There are \(26\) total support points, with \(13\) odd values, and the six listed remainder values all lie between \(17\) and \(42\). A common mistake is to treat “remainder \(2\)” as “the integer 2”; the event includes every support value separated by \(5\), not just one value.
Worked Example: Negative Endpoints and Equivalent Remainders
A hypothetical random index \(X\) is discrete uniform on the integers from \(-8\) through \(19\), inclusive. Find the probability that \(X\equiv-2\pmod6\), and the probability that \(X\equiv1\pmod4\). The model parameters are \(a=-8\), \(b=19\), and \(n=19-(-8)+1=28\). There is no interest or mortality assumption in this integer-index model.
Method for the first event: use the floor count. The remainder \(-2\) modulo \(6\) is equivalent to remainder \(4\), since \(-2=4-6\). Applying the formula directly with \(r=-2\):
The qualifying values are \(-8,-2,4,10,16\), five values. Thus \(P(X\equiv-2\pmod6)=5/28=0.1786\).
Method for the second event: list the arithmetic progression. The integers congruent to \(1\) modulo \(4\) in the support are \(-7,-3,1,5,9,13,17\), giving a count of \(7\). Hence:
Check. Each listed sequence advances by its modulus, and neither sequence omits a value within the endpoints. A common mistake is to calculate \(\lfloor-7/6\rfloor\) as \(-1\) by rounding toward zero. The floor is \(-2\), which is essential to getting the correct count of five.
Worked Example: A Conditional Remainder and Parity Event
A hypothetical code value \(X\) is selected uniformly from the integers \(104\) through \(173\), inclusive. Find (a) \(P(X\equiv2\pmod9)\), (b) the probability that \(X\) is even and \(X\equiv2\pmod9\), and (c) the conditional probability that \(X\) is even given \(X\equiv2\pmod9\). The distribution is discrete uniform with \(a=104\), \(b=173\), and \(n=173-104+1=70\). No interest rate or mortality assumption applies.
Step 1: count the values in the specified remainder class. The first value at least \(104\) congruent to \(2\) modulo \(9\) is \(110\). The qualifying sequence is \(110,119,128,137,146,155,164,173\), so there are \(8\) values. Thus \(P(X\equiv2\pmod9)=8/70=4/35=0.1143\).
Step 2: count the even values in that sequence. The sequence advances by \(9\), an odd number, so its parity alternates. The even qualifying values are \(110,128,146,164\), giving \(4\) values. Therefore:
Step 3: divide the intersection probability by the conditioning probability. Since the conditioning event contains \(8\) equally likely support values and \(4\) of them are even:
Check. The conditional probability is the proportion of even values among the eight values satisfying the remainder condition. A common mistake is to report the intersection probability \(4/70\) as the conditional probability; conditioning changes the denominator from all \(70\) support points to the \(8\) points in the conditioning event.
Interpreting Parity and Remainder Probabilities
If the support size \(n\) is even, a consecutive-integer support has exactly \(n/2\) even values and \(n/2\) odd values. This follows because each adjacent pair contains one even and one odd integer. Thus parity probabilities are both \(1/2\) in that case. If \(n\) is odd, one parity occurs \((n+1)/2\) times and the other \((n-1)/2\) times. Which parity occurs more often depends on the endpoints.
For a modulus \(m\), residue classes need not have equal counts unless the support length is a multiple of \(m\). Write \(n=qm+s\), where \(q\) and \(s\) are integers, \(q\ge0\), and \(0\le s<m\). The support consists of \(q\) full blocks of \(m\) consecutive integers, plus \(s\) additional integers. Each full block contributes one value to every remainder class; the remaining \(s\) values give one extra count to \(s\) classes. Consequently, the counts across residue classes differ by at most one.
This block argument is a useful reasonableness check, not a replacement for counting at the actual endpoints. For example, a support of \(26\) values modulo \(5\) must give counts of either \(5\) or \(6\) per remainder class. The starting endpoint determines which classes receive the extra values.
Common Exam Traps
For a discrete uniform model, the numerator must count qualifying integers that are actually in the support, and the denominator must count all support integers. Keep the endpoint convention explicit: “from \(a\) through \(b\), inclusive” has \(b-a+1\) values.
- Assuming parity is always balanced. On the support \(12,\ldots,30\), there are \(30-12+1=19\) values. The even values \(12,14,\ldots,30\) number \((30-12)/2+1=10\), so \(P(X\text{ is even})=10/19\), not \(1/2\). The other \(9\) values are odd.
- Omitting an endpoint. Counting \(a,\ldots,b\) as \(b-a\) values produces an incorrect denominator and may also lose a qualifying endpoint from the numerator.
- Confusing a remainder with a single value. The event \(X\equiv r\pmod m\) includes every support integer of the form \(r+km\), not only \(r\).
- Handling negative floors incorrectly. The floor of a negative number rounds downward. For instance, \(\lfloor-7/6\rfloor=-2\), not \(-1\).
- Using the wrong denominator for a conditional probability. For \(P(A\mid B)\), count outcomes in \(A\cap B\) over outcomes in \(B\), rather than over the entire support.
The efficient approach is to state the support and its size, identify the relevant remainder condition, count the qualifying support values, and divide by the correct denominator. When the count is small, listing the arithmetic progression is transparent; when endpoints or negative values make listing error-prone, the floor formula gives a direct check.
Check Your Understanding
For each problem, count qualifying support values before converting the count into a probability.
- A setting \(X\) is discrete uniform on the integers \(31\) through \(50\), inclusive. Find \(P(X\text{ is even})\). (Answer: \(10/20=0.5000\))
- An index \(X\) is discrete uniform on the integers \(-12\) through \(15\), inclusive. Find \(P(X\equiv3\pmod5)\). (Answer: \(6/28=3/14=0.2143\))
- A code \(X\) is discrete uniform on the integers \(48\) through \(86\), inclusive. Find both \(P(X\text{ is odd})\) and \(P(X\equiv0\pmod4)\). (Answer: \(20/39=0.5128\) and \(10/39=0.2564\))
- A label \(X\) is discrete uniform on the integers \(205\) through \(260\), inclusive. Given \(X\equiv5\pmod8\), find the probability that \(X>250\). (Answer: \(1/7=0.1429\))
- A random integer \(X\) is discrete uniform on the integers \(-20\) through \(34\), inclusive. Find the probability that \(X\) is odd or \(X\equiv0\pmod6\). (Answer: \(36/55=0.6545\))