Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Discrete Probability Distribution Visualizer


Interactive visualization of six fundamental discrete distributions

Discrete Uniform

Equal probability for finite outcomes

Explanation

A discrete uniform distribution assigns equal probability to each value in a finite range. The probability mass function is P(X=k)=1b−a+1P(X = k) = \frac{1}{b - a + 1} for a≤k≤ba \leq k \leq b. The expected value is E[X]=a+b2E[X] = \frac{a + b}{2}, and the variance is Var(X)=n2−112\text{Var}(X) = \frac{n^2 - 1}{12}, where n=b−a+1n = b - a + 1. Common examples include rolling a fair die, selecting a random card from a deck, or generating a random number from a finite range. Learn more about the discrete uniform PMF








Selecting a Distribution Type

Click the distribution tabs at the top to switch between six discrete distributions. Each tab shows the distribution name: Discrete Uniform, Binomial, Geometric, Negative Binomial, Hypergeometric, and Poisson. The selected distribution displays in blue with its parameter controls below. Start with Discrete Uniform for the simplest case, or jump directly to the distribution relevant to your problem. Each distribution has a brief description underneath its name explaining what it models. The tool remembers your last selection, making it easy to compare distributions by switching back and forth.

Adjusting Distribution Parameters

Use the sliders to change distribution parameters and watch the bar chart update instantly. Each distribution has different parameters: Binomial uses nn (number of trials) and pp (success probability), while Poisson uses only λ\lambda (rate parameter). Drag sliders smoothly or click anywhere on the slider track to jump to that value. The current parameter values display next to each slider label. For the Hypergeometric distribution, note that the number of draws and success states cannot exceed the population size. The tool automatically constrains parameters to valid ranges. Experiment with extreme parameter values to see how distributions behave at their limits.

Reading the Bar Chart

The bar chart displays probability values on the vertical axis and possible outcome values on the horizontal axis. Each bar height represents the probability of that specific outcome occurring. Taller bars indicate more likely values. The chart automatically scales to show all bars clearly, adjusting the vertical axis as you change parameters. Hover over any bar to see the exact probability value displayed in a tooltip. The tooltip shows both the outcome value kk and its probability P(X=k)P(X = k) to six decimal places. For distributions with many possible values, the chart shows only values with non-negligible probability. Compare bar heights directly to understand relative likelihoods.

Discrete Uniform: Six Equal Bars

At the opening range 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. The six sum to exactly 11.

Equal heights are the visual signature of a uniform distribution, and they are why every value is its own mode.
0.0000.0400.0800.1200.1600.200123456Value (k)Probability P(X = k)
Discrete uniform, a = 1 to b = 6

Six bars of identical height 1/6 = 0.1667 summing to exactly 1. No peak, so every value is a mode - and the mean, 3.5, is not one of the six possible outcomes.

A uniform PMF is the only one on this page with no peak. Because every bar is the same height, the distribution has no single most likely outcome — formally, all six values are modes.

The mean is a+b2=3.5\frac{a+b}{2} = 3.5, which is not one of the six possible values. That is worth pausing on: a distribution's mean need not be an outcome it can produce, and the fair die is the standard example.

Binomial: a Symmetric Peak at the Mean

With n=10n = 10 and p=0.5p = 0.5 the chart shows eleven bars, k=0k = 0 through 1010, summing to exactly 11. The tallest is at k=5k = 5 with P(X=5)=0.2461P(X = 5) = 0.2461.

The shape is symmetric because p=0.5p = 0.5 makes the binomial coefficients palindromic.
0.0000.0500.1000.1500.2000.250012345678910Value (k)Probability P(X = k)
Binomial, n = 10, p = 0.5

Eleven bars summing to 1, symmetric about the peak at k = 5 where P = 0.2461 = 252/1024. The extremes at k = 0 and k = 10 are 1/1024 each, barely off the axis.

Every bar height here is a binomial coefficient over 210=10242^{10} = 1024: the row 1,10,45,120,210,252,210,120,45,10,11, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1. The peak 252/1024=0.2461252/1024 = 0.2461 is the tallest bar the chart will show for this distribution.

Note how modest that peak is. Even the single most likely outcome happens under a quarter of the time, and the two extremes at k=0k = 0 and k=10k = 10 have probability 1/1024≈0.0011/1024 \approx 0.001 each — visible as bars barely off the axis. Ten coin flips give five heads more often than any other single count, but usually give something else.

Geometric: Decay from the First Bar

With p=0.3p = 0.3 the tallest bar is the first one, P(X=1)=0.3P(X = 1) = 0.3, and each bar after it is 0.70.7 times the one before.

The mode of a geometric distribution is always k=1k = 1, whatever pp is: the single most likely number of trials until the first success is one trial.
0.0000.0600.1200.1800.2400.3001357911131516Value (k)Probability P(X = k)
Geometric, p = 0.3

The first bar is tallest at 0.3, and each after it is 0.7 times the last. The tool drops bars under 0.001, so the plot stops at k = 16 and the bars sum to 0.9967, not 1.

The constant ratio between neighbouring bars is the memoryless property drawn out. Having already failed kk times, the chance of succeeding on the next trial is still pp — so the staircase looks the same from wherever you start.

One detail about this chart specifically. The tool's builder drops any bar with probability at or below 0.0010.001, so the plot stops at k=16k = 16 and the bars shown sum to 0.99670.9967 rather than 11. The missing 0.33%0.33\% is real probability living past the right edge, not an error: the geometric support is unbounded, and the tool has to stop somewhere. The same filter applies to the negative binomial and to no other distribution here.

Negative Binomial: the Peak Moves Off the First Bar

With r=3r = 3 and p=0.4p = 0.4 the bars start at k=3k = 3 — three successes need at least three trials — and the tallest is at k=5k = 5 with P(X=5)=0.1382P(X = 5) = 0.1382.

Setting r=1r = 1 would collapse this exactly to the geometric case, peak and all.
0.0000.0300.0600.0900.1200.1503579111315171921Value (k)Probability P(X = k)
Negative binomial, r = 3, p = 0.4

Support starts at k = 3 and the peak has moved off the first bar to k = 5, P = 0.1382. The mean, 7.5, sits well right of the mode - a right-skewed shape.

That shift of the peak away from the left edge is the whole difference between waiting for one success and waiting for several. A single success is most likely to arrive immediately; three successes are not, because the first two have to happen first.

The mean is r/p=7.5r/p = 7.5, well to the right of the mode at 55 — a right-skewed distribution, which the long thin tail on the chart shows directly. As with the geometric, the 0.0010.001 filter truncates that tail, so the plotted bars sum to 0.99760.9976.

Hypergeometric: Sampling Without Replacement

With a population of N=50N = 50 containing K=20K = 20 successes and n=10n = 10 draws, the bars run k=0k = 0 to 1010 and sum to exactly 11. The peak is at k=4k = 4 with P(X=4)=0.2801P(X = 4) = 0.2801.

That peak sits at the mean n⋅KN=10×0.4=4n \cdot \frac{K}{N} = 10 \times 0.4 = 4.
0.0000.0600.1200.1800.2400.300012345678910Value (k)Probability P(X = k)
Hypergeometric, N = 50, K = 20, n = 10

Eleven bars summing to 1, peaking at the mean k = 4 with P = 0.2801. Tighter than a binomial with the same mean, by the finite population correction (N-n)/(N-1).

Compare this with the binomial. A binomial with n=10n = 10 and p=0.4p = 0.4 has the same mean of 44, but a *wider* spread: its variance is np(1−p)=2.4np(1-p) = 2.4 against the hypergeometric's 2.4×N−nN−1=2.4×4049≈1.962.4 \times \frac{N-n}{N-1} = 2.4 \times \frac{40}{49} \approx 1.96.

That extra factor is the finite population correction, and it is always less than 1 when n>1n > 1. Sampling without replacement is self-correcting — every success drawn makes the next success slightly less likely — so outcomes cluster more tightly around the mean than independent trials would.

Poisson: Two Modes at an Integer Rate

At λ=3\lambda = 3 the bars run k=0k = 0 to 1818 and sum to 11. The chart has two equally tall bars, at k=2k = 2 and k=3k = 3, both at P=0.2240P = 0.2240.

That is not a coincidence or a rounding artefact.
0.0000.0500.1000.1500.2000.250024681012141618Value (k)Probability P(X = k)
Poisson, lambda = 3

Two equally tall bars, at k = 2 and k = 3, both 0.2240. Consecutive Poisson probabilities are in ratio lambda/k, which is exactly 1 at k = lambda, so an integer rate gives two modes.

Consecutive Poisson probabilities are related by P(k)P(k−1)=λk\frac{P(k)}{P(k-1)} = \frac{\lambda}{k}, so the ratio is exactly 11 when k=λk = \lambda. Whenever λ\lambda is a whole number the distribution has two modes, at λ−1\lambda - 1 and λ\lambda; here P(2)=9e−32P(2) = \frac{9e^{-3}}{2} and P(3)=27e−36P(3) = \frac{27e^{-3}}{6}, and both come to 0.22400.2240.

Nudge λ\lambda off an integer and one bar wins: the mode becomes ⌊λ⌋\lfloor \lambda \rfloor alone. It is the clearest thing on this page that you can check by eye and then confirm with one line of algebra.

Understanding Probability Values

All probability values fall between 0 and 1, where 0 means impossible and 1 means certain. Values close to 0 indicate unlikely outcomes, while values near 1 indicate highly likely outcomes. The sum of all bar heights always equals exactly 1, representing certainty that one of the outcomes will occur. For symmetric distributions like Binomial with p=0.5p = 0.5, the highest bars cluster around the center. For skewed distributions like Geometric, the highest bar appears on one side with a long tail extending in the other direction. Notice how probability spreads out as you increase variance parameters. When comparing distributions, similar shapes suggest similar probabilistic behavior.

Comparing Distribution Shapes

Switch between distributions to observe different probability patterns. The Discrete Uniform creates equal-height bars across all values in its range. Binomial distributions form bell-shaped patterns that become more symmetric as nn increases. Geometric distributions always show exponential decay with the highest probability at the first value. Poisson distributions shift rightward as λ\lambda increases, transitioning from highly skewed to approximately symmetric. Negative Binomial distributions extend the geometric pattern, showing where the rr-th success is likely to occur. Hypergeometric distributions resemble Binomial but account for sampling without replacement. Understanding these shape differences helps you select the appropriate distribution for your scenario.

Working with Different Scenarios

Each distribution models specific real-world scenarios. Use Binomial for fixed-trial experiments like flipping a coin 10 times or testing 50 items for defects. Choose Poisson for rare events occurring over time, such as website visits per hour or earthquakes per year. Select Geometric when counting trials until the first success, like rolling dice until you get a six. Negative Binomial extends this to count trials until the rr-th success. Use Hypergeometric when sampling without replacement from a finite population, such as drawing cards or selecting items from a batch. The parameter controls let you adjust scenarios to match your specific situation. The explanation panel provides formulas and typical applications for the selected distribution.

What is a Probability Mass Function?

The probability mass function (PMF) assigns a probability to each discrete value a random variable can take. Written as P(X=k)P(X = k), it gives the probability that random variable XX equals exactly kk. The PMF must satisfy two properties: each probability is between 0 and 1, and all probabilities sum to 1. For example, a fair six-sided die has PMF P(X=k)=1/6P(X = k) = 1/6 for k=1,2,3,4,5,6k = 1, 2, 3, 4, 5, 6. The PMF differs from the probability density function used for continuous variables. For comprehensive coverage of random variables, expectation, and variance calculations using PMFs, see our detailed probability theory pages.

Binomial Distribution Fundamentals

The Binomial distribution models the number of successes in nn independent trials, each with success probability pp. Its PMF is P(X=k)=(nk)pk(1−p)n−kP(X = k) = \binom{n}{k} p^k (1-p)^{n-k}, where (nk)\binom{n}{k} is the binomial coefficient. The expected value is E[X]=npE[X] = np and variance is Var(X)=np(1−p)\text{Var}(X) = np(1-p). As nn increases with pp fixed, the distribution becomes more bell-shaped and approximates a Normal distribution. When nn is large and pp is small such that npnp remains moderate, it approximates a Poisson distribution. For detailed derivations of Binomial properties, applications in hypothesis testing, and connections to combinatorics, see our Binomial distribution theory page.

Poisson Distribution Basics

The Poisson distribution describes the number of events occurring in a fixed interval when events happen at a constant average rate λ\lambda. Its PMF is P(X=k)=λke−λk!P(X = k) = \frac{\lambda^k e^{-\lambda}}{k!}. Both the mean and variance equal λ\lambda. This distribution applies when events occur independently and the average rate stays constant. The Poisson approximates Binomial when nn is large, pp is small, and np≈λnp \approx \lambda. Common applications include modeling rare events, arrivals in queueing systems, and defects in manufacturing. For in-depth coverage of Poisson process theory, exponential distribution connections, and statistical inference with Poisson data, see our detailed Poisson distribution page.

Geometric vs Negative Binomial

The Geometric distribution models trials until the first success, with PMF P(X=k)=(1−p)k−1pP(X = k) = (1-p)^{k-1} p. It has the memoryless property: the probability of success in future trials doesn't depend on past failures. The Negative Binomial generalizes this to count trials until the rr-th success. Its PMF is P(X=k)=(k−1r−1)pr(1−p)k−rP(X = k) = \binom{k-1}{r-1} p^r (1-p)^{k-r}. When r=1r = 1, Negative Binomial reduces to Geometric. Both distributions are right-skewed with exponential decay. For comprehensive theory on these distributions, their role in survival analysis, and applications in sequential experiments, see our detailed pages on Geometric and Negative Binomial distributions.

When to Use Each Distribution

Choose Discrete Uniform when all outcomes in a range are equally likely, such as rolling a fair die or selecting a random integer. Use Binomial for counting successes in a fixed number of independent trials with constant success probability. Select Poisson when counting rare events over time or space intervals with a constant average rate. Choose Geometric when counting trials until the first success occurs. Use Negative Binomial when counting trials until rr successes occur, generalizing the geometric case. Select Hypergeometric when sampling without replacement from a finite population, where the composition of remaining items changes after each draw. The key distinction is whether sampling is with replacement (Binomial) or without replacement (Hypergeometric).