Why the Mean Is the Midpoint
For a discrete uniform variable on consecutive integers, every allowed integer is equally likely. Its mean is therefore an average of the support values, not an average weighted toward any particular part of the range. Symmetry makes this mean especially simple: values the same distance below and above the center balance one another.
The result is useful whenever a model assigns equal probability to each integer in a finite interval. The endpoints must be included as stated, and the support must contain every integer between them. If some values are more likely, or some integers are missing, the midpoint formula does not automatically apply.
The count \(b-a+1\) is important: both endpoints are included. For example, the integers from 6 through 17 number \(17-6+1=12\), not 11. The endpoint average happens to be easy to compute without first finding the count, but counting correctly is essential when deriving the formula or checking a probability mass function.
Deriving the Mean by Symmetry
Write the support values in increasing order and add them. Then write the same sum in decreasing order. Each position in the first list and the corresponding position in the reversed list add to \(a+b\).
Since each of the \(n=b-a+1\) support values has probability \(1/n\), the definition of expectation gives \(E[X]=S/n\). Substituting the sum just derived cancels the number of support values:
This is also the arithmetic-series formula: the sum of \(n\) consecutive terms is \(n\) times the average of the first and last terms. Dividing that sum by \(n\) to obtain the mean leaves the average of the endpoints.
The symmetry argument does not require a single support value to equal the mean. If there are an even number of values, the support has two central integers and their average can be halfway between them. Even with an odd number of values, the formula is still valid: the central support value is the midpoint.
Applying the Result
Worked Example: A Uniformly Selected Inspection Day
Hypothetical scenario. A quality-control plan selects one inspection day uniformly from days 6 through 17 of a 30-day cycle, with every integer day in that range equally likely. Find the expected inspection day and verify the result using the sum of the support values.
Method and model. Let \(X\) be the selected day. The model is discrete uniform on \(6,7,\ldots,17\). The endpoints are included, so the number of possible days is $$ n=17-6+1=12. $$ Each day has probability \(1/12\).
Use the midpoint formula. $$ E[X]=\frac{6+17}{2}=\frac{23}{2}=11.5. $$
Check by pairing. The six endpoint pairs are \(6+17=23\), \(7+16=23\), \(8+15=23\), \(9+14=23\), \(10+13=23\), and \(11+12=23\). Their sum is \(6(23)=138\), so $$ E[X]=\frac{138}{12}=11.5. $$
The value 11.5 is the mean day number; it need not itself be an available inspection day. The result lies between the endpoints, as expected. The common mistake to avoid is counting only \(17-6=11\) possible days, which omits one of the inclusive endpoints.
Worked Example: Mean and an Upper-Range Probability
Hypothetical scenario. A dispatch system assigns an integer batch code uniformly from 23 through 38. Find the mean code and the probability that the assigned code is at least 34.
Method and model. Let \(X\) denote the assigned code. Each integer from 23 to 38, inclusive, has probability \(1/n\), where $$ n=38-23+1=16. $$ Thus the mean is $$ E[X]=\frac{23+38}{2}=\frac{61}{2}=30.5. $$
Count the event values. The event \(X\ge 34\) consists of \(34,35,36,37,38\), which is five values. Each has probability \(1/16\), so $$ P(X\ge 34)=\frac{5}{16}=0.3125. $$
Check. There are 16 possible codes in all, and the five event codes are part of that support. The probability is therefore between 0 and 1. The mean 30.5 is also between 23 and 38.
The common mistake in deriving the mean from the sum is to divide by \(38-23=15\), rather than by the number of support values. Pairing gives eight pairs, each summing to 61, so the total is \(8(61)=488\). The correct average is \(488/16=30.5\), not \(488/15\).
Conditional Supports
A condition can restrict a discrete uniform variable to a smaller set. To find the conditional mean, first identify the values that remain possible after the condition is imposed. If those values form a consecutive integer interval and retain equal conditional probabilities, the same midpoint formula applies to the restricted endpoints.
For instance, if a variable is uniform on \(1,2,\ldots,20\), then, given \(X>13\), the possible values are \(14,15,\ldots,20\). Each of those seven values had the same probability before conditioning, so each has the same conditional probability afterward. The conditional support—not the original support—determines the conditional mean.
Worked Example: Mean After a Threshold Condition
Hypothetical scenario. A random-number generator selects an integer uniformly from 1 through 20. Given that the generated value is greater than 13, find the conditional mean.
Method and model. Before conditioning, each of the 20 integers has probability \(1/20\). The condition \(X>13\) leaves the values \(14,15,16,17,18,19,20\), so $$ P(X>13)=\frac{7}{20}. $$ For each remaining value \(x\), the conditional probability is $$ P(X=x\mid X>13)=\frac{P(X=x)}{P(X>13)} =\frac{1/20}{7/20}=\frac{1}{7}. $$ Thus the conditional distribution is discrete uniform on the consecutive integers 14 through 20.
Apply the midpoint formula. $$ E[X\mid X>13]=\frac{14+20}{2}=17. $$
Check by summation. The support values sum to \(14+15+16+17+18+19+20=119\); dividing by the seven equally likely values gives \(119/7=17\). The answer is within the conditional support. The common mistake is to use the original endpoints and report \((1+20)/2=10.5\). That is the unconditional mean, not the mean given \(X>13\).
Conditions and Exam Traps
The midpoint result is short, but applying it correctly depends on reading the model precisely. Before substituting endpoints, verify the following:
- Consecutive support: every integer from the lower endpoint to the upper endpoint is possible.
- Equal probabilities: the probability of each possible integer is the same.
- Inclusive endpoints: a statement such as “from \(a\) through \(b\)” includes both \(a\) and \(b\).
- Correct conditioning: if the question is conditional, use the support remaining after the condition.
Do not confuse the mean with a value that must occur. A mean of 30.5 is meaningful when the possible outcomes are integers 23 through 38: it describes the balance point of the probability distribution, even though 30.5 is not one of those outcomes. Also do not transfer the formula to a support with gaps or unequal probabilities. In those cases, the mean must be found from the actual probability-weighted sum \(E[X]=\sum_x xP(X=x)\).
These checks keep a simple formula from concealing a modeling error. In exam calculations, state the endpoints and count the available integers before using the result; for a conditional question, state the restricted support explicitly. The derivation then provides a quick independent check: the mean should be centered between the correct endpoints.
Check Your Understanding
For each problem, identify the relevant support before calculating. All scenarios are hypothetical.
- A scheduling program selects an integer day uniformly from 8 through 19, inclusive. How many possible days are there, and what is the expected day number? (Answer: 12 possible days; mean \(13.5\).)
- A uniformly selected integer is chosen from \(-4\) through 7, inclusive. Find the number of possible values and the mean. (Answer: 12 values; mean \(1.5\).)
- A sensor code is selected uniformly from 31 through 50. Use the arithmetic-series sum to find the total of all support values and the mean. (Answer: sum \(810\); mean \(40.5\).)
- An integer \(X\) is selected uniformly from 0 through 14. Find \(E[X\mid X\le 5]\), including the conditional support and its number of values. (Answer: conditional support \(0,1,2,3,4,5\), 6 values; conditional mean \(2.5\).)
- A uniformly selected integer \(X\) ranges from 12 through 27. Find the unconditional mean and then the mean given \(X\ge 22\). (Answer: unconditional mean \(19.5\); conditional support \(22\) through \(27\), conditional mean \(24.5\).)