Probability Mass Function
A probability mass function gives the probability that a discrete random variable equals each of its possible values.
Definition
For a discrete random variable X, the probability mass function (PMF) is p(x) = P(X = x). It is defined for every value X can take and is zero elsewhere. Two conditions make it valid: p(x) ≥ 0 for all x, and Σ p(x) = 1 over the support.
From PMF to probabilities of events
Any event's probability is a sum of masses: P(X ∈ A) = Σ_{x∈A} p(x). The cumulative distribution function is the running sum, F(x) = Σ_{t ≤ x} p(t), which jumps by p(x) at each support point.
Example: a loaded die
pmf = {1:0.10, 2:0.10, 3:0.15, 4:0.15, 5:0.20, 6:0.30}
assert abs(sum(pmf.values()) - 1) < 1e-9
EX = sum(x*p for x,p in pmf.items())
print(EX) # 4.05 expected value
Expectation and variance from a PMF
The mean is E[X] = Σ x p(x) and the variance is Σ (x − E[X])² p(x). These weighted sums are the discrete counterparts of the integrals used for continuous densities. Every summary statistic of a discrete variable is a weighted sum against its PMF.
Where PMFs appear
Counting problems produce PMFs directly: the number of neutrons registered by a detector in a fixed window follows a Poisson PMF; the number of successes in fixed trials follows a binomial PMF. Fitting a PMF to observed counts is a standard first step in analyzing discrete simulation output, and it makes rare-event tails explicit.