Probability mass function
A probability mass function assigns nonnegative probabilities to the possible values of a discrete random variable, with the 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 →
Related concepts
- probability densitycontrasts with · A probability density function is a nonnegative function describing the distribution of a continuous random variable, whose integral over a region gives the probability of values in that region.
- poisson.pmfimplemented by · poisson.pmf is a SciPy statistical function that returns probability mass function values for the Poisson distribution.
- 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.
- samplingused by · Sampling is a procedure for selecting or generating observations, values, or outcomes from a larger population, signal, or probability distribution according to a specified method.
- 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.
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.


