A fair die is modeled by giving each face from to the same probability, and a raffle that draws one ticket uniformly from tickets numbered to gives each number the same chance. In both models the probability of an event comes from counting values. The average result and the typical distance from it still take some work. This lesson defines equal mass on a finite set of values, derives the mean and variance for consecutive integers from to , and shows which parts of those formulas fail when the values are unevenly spaced.
Key terms
Discrete uniform distribution
Definition Let be a finite nonempty set of distinct real numbers. A random variable has the discrete uniform distribution on if its PMF is
Then is the support of , and for every set of real numbers
where is the number of support values that lie in . The support has to be finite. No distribution on the positive integers gives every positive integer the same probability, because a common mass makes the total infinite and the mass makes the total .
In plain words Every listed value gets the same share of probability, and anything not listed gets none. The equal shares belong to the values of , not to physical objects. A die with faces , , , , and has six equally likely faces, but the number it shows equals with probability , so that number is not uniform on .
Example A selection device picks one of the labels , , , and , each with probability , and is the label. The event contains the three values , and , so . The event contains only and , so . Equal masses turn every event into a counting problem, but the wording of the event still decides which values are counted.
Number of support values
Definition For integers , the set of consecutive integers contains
values, since both endpoints are included. A discrete uniform variable on this set gives each value the mass , and an event that contains exactly of the support values has probability .
In plain words Count the values, not the gaps between them. Going from to takes steps of size , and there is one more value than there are steps, for the same reason that a fence with four gaps needs five posts.
Example The labels from to give values, with gaps between neighbors. The integers from to give values, so each has mass . Using instead would give each of the seven values the mass , and the masses would add to .
Mean by symmetry
Definition For a discrete uniform variable on a finite set with values, the mean is the plain average of the support values,
If is symmetric about a number , meaning that exactly when , then . The reason is that and have the same distribution, so . A set of consecutive integers from to is symmetric about its midpoint, so
In plain words When the support is symmetric, pair the smallest value with the largest, the second smallest with the second largest, and so on. Each pair balances at the same midpoint, and with equal masses no pair pulls harder than another. When is odd, the unpaired middle value is the midpoint itself. The mean need not be a possible value of .
Example For the labels to , the pair and and the pair and both balance at , and the middle value is . So , in agreement with and with the direct average . Now let be uniform on . This is still a discrete uniform distribution, with each mass , but its support is not symmetric. Its mean is , while the midpoint of the endpoints is .
Sum-of-squares identity
Definition For every positive integer ,
One proof adds the identities for . The left sides telescope to . The right sides add to , using the sum of the first positive integers. Solving the resulting equation for the sum of squares gives the formula.
In plain words This is an algebra fact about finite sums, not a probability assumption. Probability enters when the squares are averaged with equal weights. For uniform on the identity gives the second moment
Example For the squares , , , and add to , and the formula gives . A variable uniform on therefore has . With , its variance is .
Variance of consecutive integers
Definition Let be integers, let , and let be uniform on . Then
and . To derive this, first take uniform on , with and from the sum-of-squares identity. Then the variance of is
Over the common denominator the numerator is . The variable has the same distribution as , and adding a constant leaves the variance unchanged. The formula assumes consecutive integers with equal masses. For it gives , as it should for a variable with one possible value.
In plain words The spread depends only on how many consecutive values there are, not on where the block of values sits on the number line. Sliding the block moves the mean and leaves the variance alone.
Example For the labels to , and the formula gives . The direct check uses the squared deviations from the mean , which are , , , and . Their average is , so squared label units and label units. Equal probabilities do not mean zero spread.
Evenly spaced support
Definition A finite set is evenly spaced with gap if it has the form . If is uniform on such a set, then is uniform on , because the map is one-to-one, and . Hence
The mean is the midpoint of the smallest and largest values, and . For a support that is not evenly spaced, the mean and variance are computed directly from the support values.
In plain words Equal spacing makes the variable a rescaled copy of consecutive integers, so the formulas carry over with the gap as the unit of length. The variance scales by and the standard deviation by . Equal masses survive any one-to-one relabeling, but a function that merges values need not keep them equal. If is uniform on , then equals with probability , so it is not uniform on .
Example The set has , and , so and . Directly, the squared deviations , , and average to . The set has gaps , and , so the shortcut formulas do not apply. From its mean the deviations are , , and , and
The consecutive-integer formula with would give , far too small.
Check yourself
- Let be an integer chosen uniformly from through , both endpoints included. How many support values are there, what is the mass of each, and what is ?
Show the answer
The support is , , , , , and , so and each value has mass . The event contains the three values , and , so its probability is .
- For the same , find and , once with the consecutive-integer formulas and once directly.
Show the answer
The formula gives . Directly, the seven values add to , so their average is , as the symmetry of the support about also shows. The variance formula gives . Directly, the squared deviations from are , , , , , and . They add to , and .
- With the same , let . A student says that is uniform on and concludes that . Find the correct PMF of and the correct .
Show the answer
The value comes only from , while each of , and comes from two values of . So and , which is not uniform. Then
This agrees with the previous answer, as it must. Because , the shortcut gives .