Probability Mass
Probability mass is the probability a discrete random variable assigns to a single value. The function that lists it for every value is the probability mass function: \(p(x) = P(X = x)\), non-negative everywhere and summing to 1.
Unlike a density, a mass is a probability. You can read it off directly, and it is bounded by 1.
What you can do with a mass that you cannot do with a density
import numpy as np
from scipy.stats import poisson, binom
lam = 2.0
ks = np.arange(0, 12)
pmf = poisson.pmf(ks, lam)
print(f"{'k':>5}{'P(X = k)':>12}{'cumulative':>13}")
for k in (0, 1, 2, 3, 5, 8, 11):
print(f"{k:>5}{poisson.pmf(k, lam):>12.6f}{poisson.cdf(k, lam):>13.6f}")
print(f" the twelve values from 0 through 11 hold {pmf.sum():.8f} of the total; the rest is in the tail")
"""Unlike a density, a mass can be read directly: P(X = 2) really is 0.270671."""
print(f" P(X = 2) = {poisson.pmf(2, lam):.6f}")
print(f" P(X <= 2) - P(X <= 1) = {poisson.cdf(2, lam) - poisson.cdf(1, lam):.6f}")
print(f" P(X < 2) and P(X <= 2) differ by exactly that mass: "
f"{poisson.cdf(2, lam) - poisson.cdf(1, lam):.6f}")
for n, p in ((1, 0.5), (10, 0.5), (100, 0.5), (1000, 0.5), (100_000, 0.5)):
peak = binom.pmf(np.arange(n + 1), n, p).max()
print(f" Binomial({n:>7}, {p}) largest single mass {peak:.6f}")
# k P(X = k) cumulative
# 0 0.135335 0.135335
# 1 0.270671 0.406006
# 2 0.270671 0.676676
# 3 0.180447 0.857123
# 5 0.036089 0.983436
# 8 0.000859 0.999763
# 11 0.000007 0.999999
# the twelve values from 0 through 11 hold 0.99999864 of the total; the rest is in the tail
# P(X = 2) = 0.270671
# P(X <= 2) - P(X <= 1) = 0.270671
# P(X < 2) and P(X <= 2) differ by exactly that mass: 0.270671
# Binomial( 1, 0.5) largest single mass 0.500000
# Binomial( 10, 0.5) largest single mass 0.246094
# Binomial( 100, 0.5) largest single mass 0.079589
# Binomial( 1000, 0.5) largest single mass 0.025225
# Binomial( 100000, 0.5) largest single mass 0.002523
For a Poisson with mean 2, \(P(X = 2) = 0.270671\) is a statement about a single outcome, and it is true as written. The cumulative column shows the same numbers accumulating, and the twelve values from 0 through 11 hold 0.99999864 of the total; the table displays seven selected values from that range.
The second block is the distinction in its operational form. \(P(X \le 2) - P(X \le 1) = 0.270671\), exactly the mass at 2. So for a discrete variable, \(P(X < 2)\) and \(P(X \le 2)\) differ, by exactly that mass. For a continuous variable the same difference is 0 and the two agree. Off-by-one errors on interval endpoints are harmless in one world and wrong by 27 percentage points in the other.
This is the practical content of the mass-versus-density distinction, and it is where it actually bites: in inventory counts, in event counts, in anything where the variable is integer-valued and someone reaches for a normal approximation with a strict inequality.
How mass becomes density
The last block traces the boundary between the two. A Binomial(1, 0.5) puts 0.5 on its largest outcome. At \(n = 1{,}000\) the largest single mass is 0.025225, and at \(n = 100{,}000\) it is 0.002523 — as the number of possible outcomes grows, the total probability spreads across more of them and every individual mass shrinks.
The raw Binomial(n, 0.5) does not converge to a continuous distribution as n grows: its center moves to n/2. Standardizing gives \(Z_n=(X-n/2)/\sqrt{n/4}\), whose distribution converges to a standard normal. The lattice spacing of Z shrinks, and probability mass divided by that spacing approximates density. Vanishing individual masses alone do not establish this limit.
The same pattern explains why the normal approximation to a binomial needs a continuity correction. Approximating a staircase with a smooth curve throws away the step at each integer, and adding or subtracting half a unit at the endpoints is a way of putting it back.
Reading it correctly
Two habits keep the distinction useful. First, check what the variable can be: counts, categories and outcomes of a finite process have masses, and measurements on a continuum have densities. Mixed cases exist — a purchase amount that is exactly zero for most visitors and continuous above it has an atom at zero and a density elsewhere, and treating it as purely continuous loses the only value most of the data takes.
Second, remember that a mass function is one of three equivalent descriptions of a distribution. The cumulative distribution function holds the same information as a staircase whose step heights are the masses, and it is the representation that survives the transition to the continuous case.
References
- SciPy documentation,
scipy.stats.poisson. docs.scipy.org - SciPy documentation,
scipy.stats.binom. docs.scipy.org
Discover more from Insightful Data Lab
Subscribe to get the latest posts sent to your email.
