Skip to content

PMF (Probability Mass Function)

Formula

\[ p_X(x)=P(X=x) \]
\[ \sum_x p_X(x)=1 \]

Plot

type: bars
xs: 0 | 1 | 2 | 3
ys: 0.1 | 0.4 | 0.3 | 0.2
xmin: -0.5
xmax: 3.5
ymin: 0
ymax: 0.45
height: 280
title: Example PMF (discrete probabilities)

Parameters

  • \(X\): discrete random variable
  • \(p_X(x)\): probability that \(X\) equals value \(x\)

What it means

The PMF gives the probability of each exact outcome for a discrete random variable.

What it's used for

  • Computing event probabilities by summing over outcomes.
  • Defining expectations for discrete variables.

Key properties

  • \(0 \le p_X(x) \le 1\) for all \(x\).
  • Probabilities over all possible values sum to 1.

Common gotchas

  • PMFs apply to discrete variables, not continuous ones.
  • Zero probability at a value does not necessarily mean impossible in limiting models.

Example

For a fair die, \(p_X(4)=1/6\) and \(P(X\in\{1,2\})=p_X(1)+p_X(2)=1/3\).

How to Compute (Pseudocode)

Input: distribution specification and query value(s)
Output: PMF values (or probabilities from it)

for each query value/interval:
  evaluate the distribution rule for the card's representation
  (PMF: point probability, PDF: density, CDF: cumulative probability)
return the computed value(s)

Complexity

  • Time: Depends on the distribution family and number of queries (often \(O(q)\) for \(q\) query points once parameters are known)
  • Space: \(O(q)\) for returned values (or \(O(1)\) for a single query)
  • Assumptions: Parameter-estimation cost is excluded; exact formulas and numerical methods vary by distribution family

See also