Probability mass function
A probability mass function assigns nonnegative probabilities to the possible values of a discrete random variable, with those probabilities summing to one.
Statistics Every Programmer Needs
A probability mass function assigns an actual probability to each possible value of a discrete random variable, with all probabilities nonnegative and summing to one.
- How it is used
- Quantifies the probability of specific discrete outcomes for modeling rolls, success counts, and event counts.
- How deep it goes
- Defines notation and probability requirements, then works through counted outcomes and distribution-specific calculations rather than deriving a universal formula.
- Examples
- Uses fair dice, two-dice totals, and Python calculations for binomial and Poisson probabilities.
- What you can do after
- Apply it via SciPy to calculate a specific binomial or Poisson probability after selecting the appropriate distribution.
Read how Statistics Every Programmer Needs explains probability mass function →
Grokking Statistics
A function that assigns a probability to each possible value of a discrete random variable.
- How it is used
- Uses exact discrete probabilities to evaluate individual outcomes and ranges in a binomial model.
- How deep it goes
- Explains parameters, SciPy usage, plotting, and range summation while deliberately avoiding combinations and permutations.
- Examples
- Demonstrates 10 trials with p=0.9, exactly 7 successes, all outcomes from 0 to 10, and 8-or-fewer cumulative probability.
- What you can do after
- Apply it via SciPy to calculate and plot exact probabilities for binomial outcomes.
Read how Grokking Statistics explains probability mass function →
AI-Powered Search
A probability mass function assigns probabilities to the possible values of a discrete random variable.
- How it is used
- Uses token-level probabilities to identify answer boundaries in extractive question answering.
- How deep it goes
- Defines PMFs, contrasts discrete and continuous values, and applies two PMFs without deriving their mathematical training.
- Examples
- Uses a minimalist-shoes question, tokenized context, and separate start and end probability outputs.
- What you can do after
- Apply it via an extractive question-answering model to select an answer span from token-level start and end probabilities.
Read how AI-Powered Search explains probability mass function →
Grokking Bayes
A function that assigns the exact probability mass to each outcome of a discrete random variable.
- How it is used
- Defines how exact probabilities are assigned and combined for finitely many discrete hypotheses.
- How deep it goes
- Explains exact mass, normalization, and the PMF-PDF distinction, but stops short of computational implementation.
- Examples
- Uses finitely many hypotheses and a uniform continuous distribution between 0 and 1 to contrast mass with density.
- What you can do after
- Evaluate discrete uncertainty by identifying exact outcome probabilities and summing probability masses to obtain totals.
Read how Grokking Bayes explains probability mass function →
Also covered in
What to know first
- random variableA random variable is a function that assigns numerical values to outcomes of a random process and is characterized by a probability distribution.
Related concepts
- poisson.pmfimplemented by · poisson.pmf is a SciPy statistical function that returns probability mass function values for the Poisson distribution.
- probability densitycontrasts with · A probability density is a nonnegative function describing the distribution of a continuous random variable, with probabilities over intervals or regions given by integrating the function.
- random variableused by · A random variable is a function that assigns numerical values to outcomes of a random process and is characterized by a probability distribution.
- binom.pmfimplemented by · binom.pmf is a SciPy function that computes the probability mass of specified outcomes under a binomial distribution.
- Poisson distributionused by · The Poisson distribution is a discrete probability distribution that models the count of events occurring independently at a constant average rate within a fixed interval or exposure.
Questions about probability mass function
What is probability mass function?
A probability mass function assigns nonnegative probabilities to the possible values of a discrete random variable, with those probabilities summing to one.
Which Manning books explain probability mass function?
Statistics Every Programmer Needs, Grokking Statistics, AI-Powered Search and Grokking Bayes.
What should I know before learning probability mass function?
Manning books that teach probability mass function usually introduce random variable first.
What is the difference between probability mass function and probability density?
A probability mass function assigns nonnegative probabilities to the possible values of a discrete random variable, with those probabilities summing to one. A probability density is a nonnegative function describing the distribution of a continuous random variable, with probabilities over intervals or regions given by integrating the function.
What is probability mass function also called?
Probability mass function is also called PMF.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.



