Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Discrete Uniform Distribution Explorer


Modify Parameters and See Results

Equal probability for finite outcomes

Parameters

Minimum Value (a)
1

The smallest possible value in the distribution

Maximum Value (b)
6

The largest possible value in the distribution

Number of Values (n)
6

Total count of distinct values (n = b - a + 1)

Statistics

Expected Value
3.5000
Variance
2.9167
Std Deviation
1.7078
Mode
All values

Probability Calculator

Key Properties

Real-World Applications

  • Rolling a fair die (outcomes 1-6 with equal probability)
  • Drawing a random card from a deck (each card equally likely)
  • Selecting a random number from a finite set
  • Lottery number generation where each number is equally likely
  • Random assignment of participants to groups in experiments







Setting the Distribution Range

Adjust a (minimum value) using the top slider to set the lowest value in your distribution. The range spans from 0 to 30, accommodating most practical scenarios like die rolls, card draws, or random selections.

Set b (maximum value) with the bottom slider to define the upper bound. The calculator automatically ensures b > a, maintaining a valid range with at least 2 possible outcomes.

The number of possible values n = b - a + 1 displays in the parameters section. For a standard die with a = 1 and b = 6, you have n = 6 equally likely outcomes.

Understanding the Flat PMF

The PMF visualization shows perfectly flat bars - every value has identical probability 1/n. This uniform height is the defining characteristic of discrete uniform distributions and represents maximum uncertainty.

With n values in the range, each has probability 1/n. For a = 1, b = 6, each outcome {1,2,3,4,5,6} has probability 1/6 ≈ 0.1667, exactly like a fair die.

The flat PMF indicates maximum entropy - no outcome is favored over others. This makes the discrete uniform the "fairest" possible distribution for a given finite set of outcomes.

Reading the Linear CDF

The CDF displays as a perfect step function with equal-height steps. Each step adds probability 1/n, creating a linear staircase from 0 to 1 across the support.

At any value k, the CDF shows P(X ≤ k) = (k - a + 1)/n. The linearity makes probability calculations intuitive - the probability of any interval is proportional to its length.

For ranges, P(c ≤ X ≤ d) = (d - c + 1)/n. With a = 1, b = 10, the probability of landing in [3, 7] is 5/10 = 0.5, simply counting the 5 values in that range.

The Explorer at Its Opening Range

At a=1a = 1 to b=6b = 6 — a fair die — the chart shows six bars of identical height 1/6=0.16671/6 = 0.1667, summing to exactly 11. The red line marks E[X]=a+b2=3.5E[X] = \frac{a+b}{2} = 3.5.

The CDF tab turns those equal steps into a straight staircase, each riser the same 1/61/6.
0.0000.0400.0800.1200.1600.200123456Value (k)Probability P(X = k)E[X]=3.500.0000.2000.4000.6000.8001.00123456Value (k)Cumulative Probability P(X ≤ k)E[X]=3.50
Discrete uniform, a = 1 to b = 6: PMF above, CDF below

Six identical bars of 1/6. The only one of the nine with no peak - every value is a mode - and its mean of 3.5 is not a possible outcome.

This is the only distribution among the nine with no peak: every value is a mode. It is also the only one whose mean is guaranteed not to be an outcome when the range has an even number of values — 3.53.5 is not a face of a die.

The variance is n2112=3512=2.917\frac{n^2 - 1}{12} = \frac{35}{12} = 2.917, so σ1.71\sigma \approx 1.71. That formula depends only on how many values there are, not on where they sit, which is why shifting the range leaves the spread untouched while moving the mean.

Equal bars also make the CDF the easiest of the nine to read backwards. Since every riser is 1/61/6, the CDF at kk is just k/6k/6 for a die, and any quantile can be read off by eye.

Computing Point Probabilities

Enter any value k in the Point Probability calculator. If k is in the range [a, b], you get 1/n. If k is outside this range, probability is 0 - the value simply cannot occur.

This constant probability applies to every outcome in the support. There's no concept of "more likely" or "less likely" outcomes - complete uniformity across all possibilities.

The calculation is trivial compared to other distributions: just check if a ≤ k ≤ b, and if so, return 1/(b-a+1). This simplicity makes discrete uniform the baseline for comparison with other distributions.

Using Cumulative Calculators

P(X ≤ k) calculator gives (k - a + 1)/n for values in the support, counting all outcomes from a to k inclusive. For k < a, probability is 0. For k ≥ b, probability is 1.

P(X ≥ k) computes (b - k + 1)/n, counting outcomes from k to b. This equals 1 - P(X ≤ k-1), using the complement rule.

The strict inequalities P(X < k) and P(X > k) differ by one outcome: P(X < k) = P(X ≤ k-1) and P(X > k) = P(X ≥ k+1). This distinction matters for discrete distributions.

Range Probability Calculations

The range calculator computes P(c ≤ X ≤ d) using the formula (d - c + 1)/n, simply counting integers in [c, d] and dividing by total outcomes.

Four boundary options:
[c, d] - Include both endpoints, count d - c + 1 values
(c, d) - Exclude both, count d - c - 1 values
[c, d) - Include c, exclude d, count d - c values
(c, d] - Exclude c, include d, count d - c values

Example: Rolling a die (a = 1, b = 6), what's P(2 ≤ X ≤ 5)? Count {2,3,4,5} = 4 values, so probability is 4/6 = 2/3.

What is the Discrete Uniform Distribution?

The discrete uniform distribution assigns equal probability to every value in a finite set. It models complete randomness across a defined range with no bias toward any particular outcome.

The distribution is defined by two parameters: the minimum value a and maximum value b. With n = b - a + 1 possible values, each has probability exactly 1/n.

Applications include fair die rolls, random card selection, lottery number generation, random assignment in experiments, and baseline probability models. For theoretical foundations, see discrete uniform distribution theory page.

Maximum Entropy Principle

Among all discrete distributions on n values, the uniform distribution has maximum entropy - it contains the least information and represents maximum uncertainty about which outcome will occur.

This principle explains why uniform distribution is the default assumption when you have no reason to favor any outcome. It's the "most random" distribution possible for a given finite set.

The entropy equals log(n), maximized among distributions on n points. When you know nothing beyond the support, maximum entropy reasoning leads to the uniform distribution.

Distribution Statistics

The mean equals (a + b)/2, the midpoint of the range. For a standard die (a = 1, b = 6), mean = 3.5, the exact center between minimum and maximum.

The variance equals (n² - 1)/12 where n = b - a + 1. Larger ranges have proportionally larger variance. For a die, variance = 35/12 ≈ 2.92.

The standard deviation √[(n² - 1)/12] measures typical deviation from the mean. Perfect symmetry around the midpoint is a key feature - the distribution is balanced on both sides.