Bernoulli distribution
A Bernoulli distribution is a discrete probability distribution for one binary outcome, assigning probability p to one outcome and 1−p to the other.
Grokking Bayes
A probability distribution for a single experiment with two possible outcomes, parameterized by the probability of success.
- How it is used
- Represents belief about a single uncertain experiment with two possible outcomes.
- How deep it goes
- Defines the binary outcomes and parameter p, but stops short of broader distributional calculations.
- Examples
- Uses a rain-or-no-rain forecast and compares 30% and other beliefs about rain.
- What you can do after
- Apply it to encode a two-outcome belief and calculate the complementary outcome probability.
Fabulous Adventures in Data Structures and Algorithms
A Bernoulli distribution is a probability distribution over two outcomes, conventionally represented by 0 and 1, with an arbitrary probability for one outcome.
- How it is used
- Models binary randomness as a reusable distribution instead of exposing direct calls to a random-number generator.
- How deep it goes
- Explains representation, degenerate cases, GCD normalization, and uniform sampling, but stops short of broader probability theory.
- Examples
- Uses fair, unfair, double-headed, double-tailed, and five-to-seven weighted coins as implementation examples.
- What you can do after
- Build it from scratch in C# with integer weights, normalized odds, singleton edge cases, and a Sample operation.
Read how Fabulous Adventures in Data Structures and Algorithms explains Bernoulli distribution →
Causal AI
The Bernoulli distribution is a discrete probability distribution over a binary outcome with a success-probability parameter.
- How it is used
- Models a binary discrete outcome within probabilistic generative modeling.
- How deep it goes
- Defines Bernoulli as a categorical special case and demonstrates parameterization and log-probability evaluation, without deriving its probability mass function.
- Examples
- Uses heads-and-tails categories, 0-and-1 indices, and Pyro's Bernoulli(probs=0.4) implementation.
- What you can do after
- Apply it via Pyro to instantiate a binary distribution and evaluate an outcome's log probability.
Also covered in
- Applied Reinforcement LearningIn early access (MEAP)
- Bayesian Optimization in Action
- Grokking Statistics
- Ensemble Methods for Machine Learning
- Math and Architectures of Deep Learning
- Privacy-Preserving Machine Learning
- Causal Inference for Data Science
- Building Quantum Software with Python
- Machine Learning Algorithms in Depth
What to know first
- meanThe mean is a measure of central location equal to the arithmetic average of numerical observations, or the probability-weighted average of a random variable’s possible values.
- normal distributionA normal distribution is a continuous probability distribution with a symmetric, bell-shaped density determined by its mean and variance.
- 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
- discrete distributionkind of · A discrete probability distribution assigns probability mass to outcomes in a finite or countably infinite set of distinct values.
- parameteruses · A parameter is a value or named input that specifies or influences the behavior, computation, or output of a function, model, or system.
- probability distributionkind of · A probability distribution is a mathematical specification assigning probabilities or probability densities to the possible values or outcomes of a random variable.
- logistic regressionused by · Logistic regression is a statistical classification model that estimates class probabilities by applying a logistic or softmax function to a linear combination of input features.
- binomial distributionequivalent to · A binomial distribution is the probability distribution of the number of successes in a fixed number of independent trials, each with the same probability of success.
- categorical distributionkind of · A categorical distribution is a discrete probability distribution over a finite set of mutually exclusive categories or outcomes.
Questions about Bernoulli distribution
What is Bernoulli distribution?
A Bernoulli distribution is a discrete probability distribution for one binary outcome, assigning probability p to one outcome and 1−p to the other.
Which Manning books explain Bernoulli distribution?
Grokking Bayes, Fabulous Adventures in Data Structures and Algorithms and Causal AI.
What should I know before learning Bernoulli distribution?
Manning books that teach Bernoulli distribution usually introduce mean, normal distribution and random variable first.
What is Bernoulli distribution a kind of?
Bernoulli distribution is a kind of discrete distribution. A discrete probability distribution assigns probability mass to outcomes in a finite or countably infinite set of distinct values.
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.


