St · Statistics & Probability

How to Find the Median and Modes of a Discrete Uniform Distribution

Published By the 9to5Science editorial team

At a glance

  1. 1. List the support

    Write the possible values in increasing order and count how many there are.

  2. 2. Find the middle

    For an odd count, take the central value; for an even count, identify the two central values.

  3. 3. State the median convention

    With an even count, every value between the central pair is a median; the usual single-number answer is their midpoint.

  4. 4. Identify the modes

    All support values are modes because each has the same probability.

A discrete uniform distribution assigns the same probability to every value in a finite support. To find its modes, compare the probabilities; they are all tied. To find its median, put the support values in order and locate the middle value or pair. The even-sized case has a convention worth spelling out: it has an interval of medians, although many calculations report the midpoint of that interval as the median.

Define the support

Suppose the possible values are consecutive integers from aa through bb, inclusive. The number of values is

n=b−a+1,n=b-a+1,

and each value has probability 1/n1/n. For example, a fair six-sided die has support {1,2,3,4,5,6}\{1,2,3,4,5,6\}, with probability 1/61/6 for each outcome.

The same median and mode rules work for any finite support, not just consecutive integers. In that case, list the distinct support values in increasing order as x1<x2<⋯<xnx_1<x_2<\cdots<x_n.

Find the median

A number mm is a median of a distribution when at least half the probability is at or below it and at least half is at or above it:

P(X≤m)≥12andP(X≥m)≥12.P(X\le m)\ge \frac12 \quad\text{and}\quad P(X\ge m)\ge \frac12.

For a discrete uniform distribution with ordered support x1,…,xnx_1,\ldots,x_n, the median depends on whether nn is odd or even.

  • Odd nn: The median is the single central support value, x(n+1)/2x_{(n+1)/2}.
  • Even nn: The two central values are xn/2x_{n/2} and xn/2+1x_{n/2+1}. Every real number in the interval between them is a median under the definition above.

When a problem asks for one numerical answer in the even case, the usual convention is to report the midpoint of the two central values:

xn/2+xn/2+12.\frac{x_{n/2}+x_{n/2+1}}{2}.

For consecutive integer support {a,a+1,…,b}\{a,a+1,\ldots,b\}, this conventional median is (a+b)/2(a+b)/2. If there are an odd number of values, that midpoint is itself the central support value. If there are an even number, it lies halfway between the two central values.

Find the modes

A mode is a support value with the highest probability. In a discrete uniform distribution, every support value has probability 1/n1/n, so every value in the support is a mode. There is not one uniquely most likely value; all outcomes are equally likely.

For support {a,a+1,…,b}\{a,a+1,\ldots,b\}, the set of modes is the entire set {a,a+1,…,b}\{a,a+1,\ldots,b\}. This differs from some distributions that have a single mode or a small number of tied modes.

Worked example: values from 3 through 10

Let XX be uniform on {3,4,5,6,7,8,9,10}\{3,4,5,6,7,8,9,10\}. There are eight equally likely values, so each has probability 1/81/8. The ordered support is already listed, and the two central values are the fourth and fifth:

x4=6,x5=7.x_4=6,\qquad x_5=7.

There are four values at or below 6 and four at or above 7. Thus P(X≤6)=1/2P(X\le 6)=1/2 and P(X≥7)=1/2P(X\ge 7)=1/2. Any number from 6 through 7 meets both median conditions. The full set of medians is [6,7][6,7], while the usual single-number answer is

6+72=6.5.\frac{6+7}{2}=6.5.

Each of 3, 4, 5, 6, 7, 8, 9, and 10 has probability 1/81/8, so all eight values are modes. For a familiar example, a fair six-sided die has medians throughout [3,4][3,4] (with conventional median 3.53.5) and modes 1 through 6.

Why the even case has an interval of medians

With an even number of equally likely support values, exactly half lie on each side of the gap between the central pair. For any mm strictly between the central values, half the outcomes are at or below mm and half are at or above it. At either endpoint, one of these probabilities is 1/21/2 and the other is greater than 1/21/2, because the endpoint itself is included. Thus every value in the closed interval between the central pair meets both median conditions. That is why the median need not be one of the possible outcomes. The midpoint is a convenient standard summary, not the only number satisfying the median definition.

Common mistakes

  • Reporting only one mode: If all probabilities are equal, all support values are modes.
  • Assuming the median must be an outcome: For even-sized support, the conventional median can lie between possible outcomes, as with a die’s median of 3.5.
  • Confusing the median set with the conventional answer: Under the balance definition, an even-sized support has every value between the central pair as a median. If asked for the standard numerical median, give their midpoint; if asked for all medians, give the interval.
  • Counting endpoints incorrectly: For integer support from aa through bb, both endpoints are included, so the number of values is b−a+1b-a+1, not b−ab-a.

References

  1. A First Course in Probability, 10th ed., Sheldon M. Ross

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.