liveBook · Manning

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.

How 2 Manning books explain it

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.

Read how Causal AI explains Bernoulli distribution →

Related concepts

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.