Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Discrete Uniform Distribution Explorer

How to use
  1. Drag a and b under Parameters, each from 0 to 30; b always stays above a. Bars, statistics and every calculator result update at once. Learn more about the distribution range
  2. Statistics shows Expected Value, Variance, Std Deviation and Mode for the current parameters; Show Formulas prints the rule under each card. Learn more about the statistics panel
  3. PMF, the first tab above the chart, draws one bar per value k with height P(X=k)P(X = k); the red line marks E[X]E[X]. Learn more about the flat PMF
  4. CDF replots the same values as the running total P(X≤k)P(X \le k), climbing from 0 to 1. Learn more about the linear CDF
  5. Table lists every k with P(X=k)P(X = k) and P(X≤k)P(X \le k) to six decimals. Learn more about the Table tab
  6. In the Probability Calculator, tap P(X = k), P(X < k), P(X ≤ k), P(X > k) or P(X ≥ k) and type k; the box below shows the probability to six decimals. Learn more about point probabilities
  7. Tap a range tab, P(a ≤ X ≤ b), P(a < X < b), P(a ≤ X < b) or P(a < X ≤ b), and type a and b; the four differ in which endpoints count. Learn more about range probabilities
  8. Key Properties in the right column: tap a row's ▼ to open its explanation, one at a time; Real-World Applications below lists typical uses. Learn more about key properties and applications


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

DemoParameters and statistics
Step 0 of 4
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.

Reading the Statistics Panel

The Statistics panel sits in the left column, under Parameters. Its four cards show Expected Value, Variance and Std Deviation to four decimals, and Mode as the words All values. Every card recomputes on each slider move, so the panel always describes the bars in the middle column; the red E[X]E[X] line on the chart sits at the Expected Value number.

Show Formulas prints the rule under each card: E[X]=(a+b)/2E[X] = (a + b)/2, Var(X)=(n2−1)/12\text{Var}(X) = (n^2 - 1)/12, σ=Var(X)\sigma = \sqrt{\text{Var}(X)}, and under Mode the line Every value has equal probability. The button then reads Hide Formulas. The numbers are the same either way; the formulas only show where they come from.

At the opening values, a=1a = 1, b=6b = 6, the cards read 3.5000, 2.9167, 1.7078 and All values. Mode reads All values: every value from aa to bb has the same probability. Move aa to 5 with b=10b = 10 and Variance returns to 2.9167, because n=6n = 6 again; only the Expected Value moves, to 7.5000.

The Parameters cards above the panel repeat each value with its symbol and a one-line meaning: Minimum Value (a), Maximum Value (b) and Number of Values (n). For where the formulas come from, see Distribution Statistics.

Understanding the Flat PMF

DemoPMF, CDF and Table tabs
Step 0 of 4
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.

Using the Table Tab

Table is the third tab above the chart, after PMF and CDF. It replaces the chart with three columns, k, P(X = k) and P(X ≤ k), one row per value on the chart's axis, every value to six decimals. The rows follow the sliders: move one and the whole table recomputes.

Use it where the chart is too small to read. At the opening values, a=1a = 1, b=6b = 6, the table runs from k=1k = 1 to k=6k = 6. Every P(X=k)P(X = k) is 0.166667, and P(X≤k)P(X \le k) climbs by that amount each row: 0.166667, 0.333333, … 1.000000.

The P(X ≤ k) column is the CDF as numbers, and each P(X = k) entry is one bar of the PMF chart. Subtract two neighbouring P(X ≤ k) rows to recover a P(X = k) entry. For a value the table does not list, or a range of values, use the Probability Calculator below the chart.

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 n2−112=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

DemoPoint and cumulative probabilities
Step 0 of 4
Enter any value k in the P(X = k) row of the 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

DemoRange probabilities
Step 0 of 4
The P(a ≤ X ≤ b) row of the Probability 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.

Key Properties and Real-World Applications

The right column holds two lists. Key Properties has 5 rows, each ending in ▼: Support: X ∈ {1, 2, ..., 6}, Equal Probability (1/n), Maximum Entropy Distribution, Symmetric Around Mean, Memoryless (Independence). Row titles here are those at the opening values. Tap a row to open its explanation; tap another and the first closes, so one explanation is open at a time; tap the open row to close it.

The support row lists aa to bb, and Equal Probability (1/n) and Symmetric Around Mean quote the current values. Open a row, move a slider, and the numbers in the open explanation follow.

Real-World Applications, below, lists 5 situations the discrete uniform distribution models, starting with Rolling a fair die (outcomes 1-6 with equal probability) and Drawing a random card from a deck. This list is fixed text and does not change with the sliders.

The rows are short summaries. The full treatment is in What is the Discrete Uniform Distribution?.

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.