Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Markov Inequality Visualization



Markov Inequality Visualizer

P(X ≥ a) ≤ E[X] / a
P(X ≥ 15) ≤ 10 / 15 = 0.667 = 66.7%
Actual: 22.3%
xPDFE[X]=10a=15010203040

Markov Inequality: For non-negative X and a > 0: P(X ≥ a) ≤ E[X] / a

Red area shows P(X ≥ a). Bound: 66.7%, Actual: 22.3%







Visualizing Markov's Inequality

Markov's inequality states that for any non-negative random variable X and positive threshold a: P(X ≥ a) ≤ E[X] / a. This tool visualizes the bound across nine distributions, showing both the Markov bound and the actual tail probability. Adjust E[X] and threshold to see when bounds are tight versus loose.



Getting Started with the Markov Visualizer

This tool demonstrates Markov's inequality, which bounds tail probabilities using only the expected value. The visualization shows a probability distribution with the tail region P(X ≥ a) highlighted in red.

The left panel displays the PDF (for continuous) or PMF (for discrete distributions). A green dashed line marks E[X], and a red dashed line marks the threshold a. The red shaded area (or red bars) represents the actual tail probability.

The top panel shows the Markov bound formula and compares it to the actual probability. Adjust E[X] and threshold to explore when the bound is tight versus loose across different distributions.

Understanding the Markov Bound

Markov's inequality states:

P(Xa)E[X]aP(X \geq a) \leq \frac{E[X]}{a}


This bound requires only two conditions:
• X must be non-negative (X ≥ 0 always)
• a must be positive (a > 0)

The bound decreases as a increases relative to E[X]. When a = 2·E[X], the bound is 0.5 (50%). When a = 10·E[X], the bound is 0.1 (10%).

The visualization shows both the Markov bound (theoretical maximum) and the actual tail probability. For most distributions, the actual probability is much smaller than the bound, demonstrating that Markov's inequality is often conservative.

Using the Distribution Selector

Nine distributions are available, grouped into continuous and discrete:

Continuous Distributions:
• Normal (positive range displayed)
• Exponential
• Uniform

Discrete Distributions:
• Poisson
• Binomial
• Geometric
• Negative Binomial
• Hypergeometric
• Discrete Uniform

Each distribution shows different tail behavior. Exponential has a long right tail, making Markov relatively tight. Normal concentrates around the mean, making the bound very loose. Discrete distributions display as vertical bars with dots at PMF values.

Try switching distributions while keeping E[X] and threshold fixed to see how the same Markov bound applies differently to different shapes.

Normal: the Bound Against a Bell Curve

At the tool's opening settings — E[X]=10E[X] = 10, a=15a = 15 — the Markov bound is 10/15=0.66710/15 = 0.667, so 66.7%66.7\%. The normal option builds a curve with μ=10\mu = 10 and σ=μ/2=5\sigma = \mu/2 = 5, and the shaded tail beyond aa is 15.9%15.9\%.

The bound is about four times the truth here.
xPDFE[X]=10a=15010203040
Normal, E[X] = 10, a = 15

The curve is the normal restricted to x >= 0 with sigma = 5. The shaded tail is 15.9% against a bound of 66.7% - about four times the truth.

The gap is the price of assuming nothing. Markov is handed one number, E[X]=10E[X] = 10, and must produce a bound valid for *every* non-negative variable with that mean — including the worst case, which puts all its mass at 00 and at aa and hits 10/1510/15 exactly. A bell curve is nothing like that worst case, so its real tail is far smaller.

Worth flagging about this option specifically: the tool labels it "Normal (non-negative range only)". A genuine normal variable can be negative, and Markov requires X0X \geq 0, so what is drawn is the normal curve restricted to x0x \geq 0. With μ=10\mu = 10 and σ=5\sigma = 5 the omitted region carries about 2.3%2.3\% of the mass — small, but the reason for the label.

Exponential: Where Markov Is Tightest Among the Continuous Options

The exponential is the tool's opening choice. With E[X]=10E[X] = 10 it uses λ=1/10\lambda = 1/10, so the tail is P(X15)=e1.5=22.3%P(X \geq 15) = e^{-1.5} = 22.3\% against the same 66.7%66.7\% bound.

A ratio of about 3×3\times — the closest any of the three continuous options gets.
xPDFE[X]=10a=15010203040
Exponential, E[X] = 10, a = 15

The tool opens here. The tail is exp(-1.5) = 22.3%, the tightest of the three continuous options against the same 66.7% bound.

The exponential does comparatively well because it is genuinely heavy-tailed relative to a bell curve: it puts real mass far from the mean, which is the direction Markov's worst case points.

It also gives the cleanest way to see how the bound behaves as aa moves. The bound 10/a10/a decays like 1/a1/a, while the true tail ea/10e^{-a/10} decays exponentially. So the further out you look the worse the ratio gets, even though the bound itself keeps shrinking. Markov's guarantee weakens much more slowly than the reality it is bounding.

Uniform: the Largest Tail of the Nine

The uniform option spreads mass evenly over [0,2E[X]]=[0,20][0, 2E[X]] = [0, 20], giving a flat density of 0.050.05. The tail beyond a=15a = 15 is the rectangle from 15 to 20, so P(X15)=5/20=25.0%P(X \geq 15) = 5/20 = 25.0\%.

That is the largest actual tail among all nine distributions at these settings.
xPDFE[X]=10a=15010203040
Uniform on [0, 20], a = 15

A flat density of 0.05, so the shaded tail is the rectangle from 15 to 20: 5 x 0.05 = 25.0%. The one state whose tail can be checked by hand.

Even the largest of the nine is well under the 66.7%66.7\% bound, which is the honest summary of Markov: it is almost never close.

This state is the easiest to check by hand, and that makes it the best one to start from. The density is constant, so the tail is a rectangle and the arithmetic is 5×0.055 \times 0.05. Every other option on the list requires either an integral or a sum.

Poisson: a Discrete Tail Read as Stems

Choosing Poisson switches the chart from a filled curve to stems with round heads, one per integer, and the tool sums the stems at x15x \geq 15 rather than integrating. With λ=E[X]=10\lambda = E[X] = 10 that sum is 8.3%8.3\%.

The red stems are the ones being added up.
xPMFE[X]=10a=15010203040
Poisson, lambda = 10, a = 15

The chart switches to stems, and the tool sums the red ones rather than integrating: 8.3%. Poisson mass sits within a few sigma of lambda, and sigma here is only 3.2.

The bound is now about eight times the truth. Poisson mass concentrates within a few standard deviations of λ\lambda — here σ=103.2\sigma = \sqrt{10} \approx 3.2, so a=15a = 15 sits about 1.6σ1.6\sigma out — and Markov has no way to know that, because it never sees a variance.

This is the first state where the switch from continuous to discrete matters for how the number is produced. For the three continuous options the tool evaluates a closed form; for the six discrete ones it adds up the plotted stems.

Binomial: the Bound at Its Loosest but One

The binomial option fixes p=0.4p = 0.4 and derives n=round(E[X]/p)=25n = \text{round}(E[X]/p) = 25, so the mean is 25×0.4=1025 \times 0.4 = 10 as required. The tail at x15x \geq 15 is 3.4%3.4\%.

Against the 66.7%66.7\% bound that is a ratio of roughly 20×20\times.
xPMFE[X]=10a=15010203040
Binomial, n = 25, p = 0.4, a = 15

A sum of 25 trials, so it concentrates: sigma = 2.45 and the threshold is over two sigma out. The tail is 3.4%, a twentyfold gap to the bound.

A binomial is a sum of 25 independent trials, and sums concentrate. Its standard deviation is np(1p)=62.45\sqrt{np(1-p)} = \sqrt{6} \approx 2.45, so the threshold sits over two standard deviations above the mean and very little mass survives out there.

The pattern across the nine is now visible: the more concentrated a distribution is, the more Markov overstates its tail. That is not a flaw in the inequality but a statement of what it was given — one number, and no way to distinguish a spread-out variable from a concentrated one.

Geometric: Heavy Tail, Truncated Window

With p=1/E[X]=0.1p = 1/E[X] = 0.1 the geometric puts 21.4%21.4\% of its mass at x15x \geq 15 — second only to the uniform among the nine.

The stems visibly decay by a constant factor of 0.90.9 from one integer to the next.
xPMFE[X]=10a=15010203040
Geometric, p = 0.1, a = 15

Stems decaying by a constant 0.9 each step, with 21.4% at or beyond a. The plotted window holds 98.5% of the mass, so this figure slightly undercounts the true tail.

There is a detail here worth knowing before trusting the printed number. The geometric support is unbounded, but the tool plots and sums only x=1x = 1 to 4040, which carries about 98.5%98.5\% of the mass. The remaining 1.5%1.5\% lies past the right edge and is *not* counted, so the reported "Actual" is a slight undercount rather than the exact tail.

That never threatens the inequality — undercounting can only make the actual smaller than the bound — but it does mean this figure is the sum over the drawn stems, not a closed form. The same applies to the negative binomial. For the exponential, normal and uniform the tool uses exact formulas instead, so no truncation is involved.

Negative Binomial: Five Successes at a Time

The negative binomial option fixes r=5r = 5 and solves p=r/(E[X]+r)=5/15=1/3p = r/(E[X] + r) = 5/15 = 1/3 so the mean lands on 10. The tail beyond a=15a = 15 is 18.8%18.8\%.

Its shape sits between the geometric's steady decay and the binomial's tight hump.
xPMFE[X]=10a=15010203040
Negative binomial, r = 5, p = 1/3, a = 15

Shape between the geometric and the binomial, and a tail of 18.8% that sits between theirs. At r = 1 this option would be the geometric exactly.

That intermediate position is exactly what the parameter rr controls. At r=1r = 1 the negative binomial *is* the geometric; as rr grows the distribution becomes more symmetric and more concentrated, and the actual tail shrinks toward the binomial's. Fixing r=5r = 5 puts this option in the middle of that range, and its 18.8%18.8\% sits between the geometric's 21.4%21.4\% and the binomial's 3.4%3.4\%.

Like the geometric, its support is unbounded and the plotted window is finite, though here the omitted mass is under 0.01%0.01\%.

Hypergeometric: Where the Bound Is Almost Meaningless

The hypergeometric fixes a population of N=50N = 50 with K=30K = 30 successes and draws n=round(E[X]N/K)=17n = \text{round}(E[X] \cdot N/K) = 17. The tail at x15x \geq 15 is 0.3%0.3\%.

The bound is still 66.7%66.7\% — over two hundred times the truth, by far the widest gap of the nine.
xPMFE[X]=10a=15010203040
Hypergeometric, N = 50, K = 30, n = 17, a = 15

Sampling without replacement, capped at 17 draws, so only three values exceed the threshold. The tail is 0.3% - over two hundred times smaller than the bound.

Two things drive it. Sampling without replacement is self-correcting — drawing a success makes the next success less likely — so the hypergeometric is more concentrated than the binomial with the same mean. And the support is hard-capped at n=17n = 17 draws, so there are only three integers between the threshold and the largest possible outcome.

Markov cannot use either fact. It does not know the variable is bounded above, and it does not know the variance. Given only E[X]=10E[X] = 10 it must still allow for a variable that puts mass at 00 and 1515, which is what produces 2/32/3.

Note also that the rounding makes the mean 17×0.6=10.217 \times 0.6 = 10.2 rather than exactly 10, so the bound the tool prints is very slightly optimistic — a rounding artefact of deriving an integer number of draws.

Discrete Uniform: the Discrete Twin of the Flat Case

The discrete uniform puts equal probability on the integers 11 through n=2E[X]1=19n = 2E[X] - 1 = 19, each 1/191/19. The values at or above a=15a = 15 are 15,16,17,18,1915, 16, 17, 18, 19 — five of them — so the tail is 5/19=26.3%5/19 = 26.3\%.

That is the largest actual tail of all nine states.
xPMFE[X]=10a=15010203040
Discrete uniform on 1..19, a = 15

Five of the nineteen values are at or above 15, so the tail is 5/19 = 26.3% - the largest of all nine states, and still well under the 66.7% bound.

It edges out the continuous uniform's 25%25\% for a small reason worth seeing: the continuous version spreads mass over [0,20][0, 20] and the discrete version over {1,,19}\{1, \dots, 19\}, and the threshold a=15a = 15 is *included* in the discrete tail because the inequality is P(Xa)P(X \geq a). Endpoint conventions matter for discrete variables in a way they never do for continuous ones, where a single point carries no probability.

Across all nine states the actual tail runs from 0.3%0.3\% to 26.3%26.3\% against one unchanging bound of 66.7%66.7\%. Even the worst case among real distributions uses barely two fifths of what Markov permits.

Adjusting E[X] and Threshold

Two sliders control the key parameters:

E[X] Slider (green): Sets the expected value from 1 to 30. This changes the distribution's location and scale. Higher E[X] generally spreads the distribution rightward.

Threshold (a) Slider (red): Sets the threshold from 1 to 40. This determines where tail probability is measured. The red dashed line and shaded region update accordingly.

Key experiments to try:

• Set a = E[X]: The bound becomes 1 (100%), which tells us nothing
• Set a = 2·E[X]: The bound becomes 0.5 (50%)
• Set a >> E[X]: The bound becomes small, and actual probability becomes tiny
• Compare Exponential vs Normal at the same settings

When Markov Becomes Useless

The visualization displays a warning when a ≤ E[X]. In this case:

E[X]a1\frac{E[X]}{a} \geq 1


A probability bound of 100% or more is trivially true and provides no information. Every probability is ≤ 1, so saying P(X ≥ a) ≤ 1.5 tells us nothing.

The warning box turns red and explains that the bound is useless. To get meaningful information, increase a above E[X].

This limitation is fundamental to Markov's inequality. The bound only constrains tail probabilities in the region beyond the expected value. For probabilities closer to the center, you need stronger inequalities like Chebyshev.
xPDFE[X]=10a=8010203040
Exponential with a = 8, below E[X] = 10

With a under the mean the bound is 10/8 = 1.25, and the tool turns its header panel red. A bound of 125% is true but empty: every probability is at most 1 anyway.


Comparing Bound to Actual Probability

The information panel shows two values:

Bound: The Markov upper bound E[X]/a
Actual: The true tail probability P(X ≥ a)

The ratio Bound/Actual indicates how loose the inequality is. Typical observations:

Exponential distribution: Bound is relatively tight (ratio 2-5x)
Normal distribution: Bound is very loose (ratio 10-100x or more)
Uniform distribution: Bound can be exact at certain thresholds

The gap exists because Markov must hold for ANY non-negative distribution with that E[X]. The worst-case distribution (which achieves the bound) places all probability mass at exactly 0 and a, creating maximum tail probability.

Real distributions spread probability more evenly, giving smaller tails than the worst case.

Why Markov's Inequality Matters

Despite being loose, Markov's inequality is valuable because:

Minimal requirements: Only needs X ≥ 0 and E[X] known. No variance, no distribution shape.

Universal applicability: Works for any non-negative random variable, continuous or discrete.

Theoretical foundation: Building block for stronger inequalities. Chebyshev's inequality is derived from Markov applied to (X - μ)².

Quick bounds: When you only know the average, Markov gives an instant upper bound.

Applications include algorithm analysis (bounding worst-case by average-case), queueing theory (service time bounds), and proving convergence in probability (weak law of large numbers).