Interactive module guide

Discrete Uniform Distribution Calculator & Guide

This discrete uniform distribution calculator lets you calculate probabilities for equally likely integer outcomes such as fair dice.

Open calculator

Free · No sign-up · Calculations stay in your browser

The discrete uniform distribution puts equal probability 1/n on each of the n integers from a to b—the exact model of a fair die, a shuffled card position, or a random draw of one record from n.

It is the simplest nontrivial distribution and the reference point for fairness: departures from it are what loaded dice, biased shuffles, and skewed samplers look like.

This page provides exact masses, interval probabilities, quantiles, and moments, including the variance (n²−1)/12 that parallels the continuous uniform’s (b−a)²/12.

Is this the right module for my question?

Use it when

  • Use it for genuinely engineered symmetry: fair dice, lottery draws, random selection among n equally eligible records, or uniformly random integers produced by software.
  • Use it as the null model in fairness checks: observed frequencies from a claimed-fair mechanism are compared against exactly 1/n per outcome, which is the chi-square goodness-of-fit setting.
  • Use it to teach counting-based probability: with all outcomes equally likely, every event probability is a ratio of counts, and this page makes the bookkeeping exact for intervals and quantiles.

Choose another method when

  • Avoid assuming it by default for integer data; equal likelihood is an engineering property of a mechanism, not a neutral prior for observed counts.
  • Avoid using it when outcomes are ordered by an underlying size process—counts of events follow Poisson-like or binomial-like laws, not flat ones.
  • Avoid stretching it over a range with impossible interior values; the model assigns 1/n to every integer in [a, b], including any you forgot to exclude.

Interactive tool

The calculator loads as you approach this section so the guide remains fast on mobile connections.

Example preview

One roll of a fair die

Inputs
X ~ DiscreteUniform(1, 6); evaluate rolling at least 5.
Representative result
P(X≥5) = 2/6 ≈ 0.3333, with mean 3.5 and variance 35/12.

Illustrative only. Load the interactive tool to enter your own values and review assumptions.

Watch the explanation

3:47 min

The player loads only after you press play. You can also watch on YouTube.

Read the complete transcript

The Discrete Uniform Distribution. A fair die draws a perfectly flat row of probabilities. But equal-looking labels do not prove that the mechanism is fair. Discrete uniform uses inclusive integer bounds a and b. The number of possible values is b minus a plus one. Every supported integer gets mass one over n, and every other real number gets probability zero. Its cumulative function is a staircase. Between integers it stays flat, and at each supported integer it jumps by one over n. For an inclusive interval, count the supported integers inside it, then divide that count by n. The lower inverse-CDF quantile is a plus ceiling of p times n, minus one: the first integer whose cumulative probability reaches p.

Normalization is immediate. There are n bars, each with height one over n, so their total mass is one. When n is greater than one, every value ties for the largest mass. There is no unique mode. The distribution is symmetric. Its mean is the midpoint, a plus b over two, and its skewness is zero. Its variance is n squared minus one over twelve. Do not substitute the continuous-uniform range-squared formula. Excess kurtosis is negative six times n squared plus one, divided by five times n squared minus one. Changing the location of the integer block shifts the mean, while keeping the same n preserves the variance and shape. If a equals b, n is one and the model collapses to one point. Variance is zero; standardized shape measures are undefined. Use this model for fair devices, shuffled positions, uniform random integers, or equal allocation among consecutive choices. Do not use it merely because outcomes are integers, and do not use it for sums whose values have different numbers of combinations.

For a fair six-sided die, a is one, b is six, and n is six. Each face has probability one sixth. Rolling at least five counts faces five and six, so the probability is one third. The inclusive event from two through four contains three faces, giving probability three sixths, or one half. The mean is three point five. Every face ties for maximum probability, so there is no unique modal face. Variance is thirty-five over twelve, about two point nine one seven, and standard deviation is about one point seven zero eight. Under the site's lower quantile convention, the median is three, the ninety-fifth percentile is six, and excess kurtosis is about negative one point two six nine.

Fairness belongs to the generating mechanism. A short observed histogram can wobble even when every face truly has equal probability. With N trials, the equal-probability model expects N over n counts per category. A chi-square goodness-of-fit test can assess larger discrepancies. Validate finite integer bounds with a no greater than b, limit enormous supports, and keep quantile probabilities strictly between zero and one. Audit off-by-one errors: both bounds are included, support size is b minus a plus one, and interval endpoints must match the event. One die is uniform. The sum of two dice is not: seven has six combinations, while two and twelve have only one each. Report both bounds, n, the exact event and endpoint convention, the probability ratio, and why equal mass is defensible. Explore discrete uniform probabilities, quantiles, moments, and exact integer scenarios free at Distri Scope dot com.

How to read the result

Every probability question reduces to counting: an interval containing m support points has probability m/n, before any formula.

The variance grows quadratically with the range: a d20 die has variance (400−1)/12 ≈ 33.25 against the d6’s 35/12 ≈ 2.92—range, not fairness, drives spread.

Kurtosis is always negative (platykurtic): a flat distribution has no tails at all, the opposite pathology from the heavy-tailed families.

Inputs and parameter meaning

Two integer parameters a ≤ b; the support size is n = b − a + 1, and each support point has probability exactly 1/n.

Interval probabilities include both endpoints, matching the discrete convention used across this site.

The summary reports no mode when n > 1—every outcome ties by construction, and reporting one would be arbitrary.

Formula and available parameters

Density or probability mass

P(X=k)=1n,k=a,a+1,,b,n=ba+1P(X = k) = \frac{1}{n}, \quad k = a, a+1, \ldots, b, \quad n = b-a+1

Cumulative distribution

F(k)={0,k<aka+1n,ak<b1,kbF(k) = \begin{cases}0,&k<a\\\frac{\lfloor k \rfloor-a+1}{n},&a\le k<b\\1,&k\ge b\end{cases}

Mean

μ=a+b2\mu = \frac{a+b}{2}

Variance

σ2=n2112\sigma^2 = \frac{n^2-1}{12}
  • Lower bound (a): interactive range -20 to 20; default 1.
  • Upper bound (b): interactive range -20 to 20; default 6.

What the method is doing

All quantities are exact ratios: the CDF is (⌊k⌋ − a + 1)/n and the quantile is a + ⌈p·n⌉ − 1, the smallest integer whose cumulative probability reaches p.

Moments are closed-form: mean (a+b)/2, variance (n²−1)/12, skewness 0, and excess kurtosis −6(n²+1)/(5(n²−1)), approaching the continuous uniform’s −1.2 as n grows.

The parallel with the continuous uniform is exact in the limit: (n²−1)/12 versus (b−a)²/12, one of the cleanest discrete-to-continuous bridges.

Worked example: one roll of a fair die

A single roll of a fair six-sided die is DiscreteUniform(1, 6). Find the probability of rolling at least 5, the mean and variance, the median under this site’s quantile convention, and the exact excess kurtosis.

  1. 1At least 5: two support points (5 and 6) out of six give P(X ≥ 5) = 2/6 ≈ 0.3333—pure counting.
  2. 2Mean and variance: (1+6)/2 = 3.5 and (36−1)/12 = 35/12 ≈ 2.917, so the standard deviation is ≈ 1.708.
  3. 3Median: the smallest k with F(k) ≥ 0.5 is 3 (since F(3) = 0.5), the discrete-quantile convention this site uses everywhere.
  4. 4Excess kurtosis: −6(37)/(5×35) = −222/175 ≈ −1.269, close to the continuous uniform’s −1.2 already at n = 6.

Interpretation

A die roll leaves nothing approximate: every number above is an exact ratio. The worked values also calibrate intuition for fairness testing—any claimed-fair six-outcome mechanism should reproduce these theoretical values in the long run, and the chi-square goodness-of-fit test quantifies how far observed counts may wander before fairness becomes untenable.

Common mistakes

  • Do not confuse the die model with the sum of dice: totals of several dice are triangular-then-bell-shaped, not uniform—only the single draw is flat.
  • Do not quote a mode: all outcomes tie, and the dash on the summary panel is the correct answer.
  • Do not use the continuous uniform variance (b−a)²/12 for integer supports; the discrete correction matters at small n (35/12, not 25/12, for a die).

Limits and independent validation

The model covers consecutive integer supports only; equally likely arbitrary label sets need no distribution machinery beyond counting.

It describes an idealized mechanism; testing whether a physical die or software sampler actually achieves flatness is a goodness-of-fit question.

The support is capped at 100,000 integers here, ample for teaching and audit sampling scales.

Before using the result

  • Check that the visible bars are exactly equal-height and that any interval probability equals its support-point count divided by n.
  • Recompute the variance by hand from (n²−1)/12 and compare with the summary panel.
  • For a real mechanism, collect frequencies and run the chi-square goodness-of-fit test against expected counts of N/n per outcome.

See every option in the Probability Distribution Explorer or review the DistriScope methodology. Educational information; last reviewed 2026-08-09. Verify consequential calculations independently.