AI Glossary / Graphs and symbolic AI / Beginner

Bernoulli

Definition

A Bernoulli distribution describes a random variable with two possible values: 1 with probability p and 0 with probability 1 − p. It is a basic model for a single binary outcome, such as whether a request succeeds or an item meets a defined condition.

What it means

The values 1 and 0 are labels used for calculation. The outcome coded as 1 is often called a success, but that is mathematical terminology rather than a judgment that the event is desirable. A failure alert could be coded as 1.

One parameter, p, specifies the distribution. If p is 0.3, the model assigns probability 0.3 to outcome 1 and 0.7 to outcome 0. It does not say that an individual outcome can be 0.3: the realized value remains either 0 or 1.

A single Bernoulli variable does not itself require assumptions about independence across many observations. Those assumptions become relevant when combining repeated trials into models such as the binomial distribution.

How it works

First define the event precisely and decide which outcome receives the value 1. Then assign or estimate p using an appropriate model or data. The probability mass function gives p for 1 and 1 − p for 0, with no mass on other values.

The expected value is p, and the variance is p(1 − p). The expectation summarizes average behavior under the model; it is not a permitted intermediate outcome. Variability is greatest at p = 0.5 and disappears at the endpoints p = 0 or p = 1.

For n independent trials sharing the same probability p, the number of ones has a binomial distribution. If probabilities differ or outcomes are dependent, that particular binomial model may not apply. In machine learning, a binary classifier can predict a different Bernoulli parameter for each input, with calibration and predictive quality assessed separately.

Three practical examples

  • A website experiment records whether a particular visit includes a defined action, using a binary indicator for each eligible visit.
  • A quality-control model represents whether one inspected item fails a specified check, with failure coded as 1.
  • A binary classification system predicts the probability that an incoming document belongs to a target category, then applies a separate decision threshold if a label is needed.

Think of it this way

Think of a coin with an adjustable tendency to land heads. Heads is coded as 1 and tails as 0, while p describes the tendency rather than the outcome of a particular toss.

The analogy does not make every binary business event an independent coin toss. Several requests may share the same outage, and repeated actions by one person may be related. The binary coding and the independence assumption are different matters.

Worked example

From one outcome to several trials

Let X indicate whether an invented test message receives a response within a specified period, with p = 0.3. Then P(X = 1) = 0.3 and P(X = 0) = 0.7. Its expected value is 0.3 and its variance is 0.3 × 0.7 = 0.21.

Now suppose three test messages are independent and all share that same response probability. The probability that none receives a response is 0.7³ = 0.343. Therefore the probability that at least one receives a response is 1 − 0.343 = 0.657.

The expected number of responses is 3 × 0.3 = 0.9, but the observed count can only be 0, 1, 2 or 3. If all three messages go to the same recipient at nearly the same time, the independence assumption may be unreasonable, so the at-least-one calculation would need reconsideration.

Illustrative case study

Fictional case: Cedar Requests models whether each service request completes within its target time. The team initially treats every request as an independent trial with one fixed success probability.

An incident review shows that many failures occur together during shared service interruptions. Analysts retain the useful binary outcome definition but revise the model of repeated observations to account for operating conditions and dependence. They also define how canceled requests and missing completion records are handled.

The lesson is that a correct Bernoulli description of an individual binary variable does not automatically validate a simple model for a whole stream of requests. The event definition and the relationships among observations both matter.

Common misconceptions and mistakes

  • Bernoulli means the two outcomes are equally likely. Any p between 0 and 1 is allowed.
  • A probability of 0.3 means every ten trials contain exactly three ones. Counts fluctuate, even under independent identical trials.
  • The expected value must be a possible observed value. A Bernoulli expectation can be fractional while observations are binary.
  • Binary outcomes automatically imply independence. Shared causes can create dependence.
  • A predicted probability is already a classification decision. A threshold or decision policy is a separate step.

Business use

Bernoulli models provide a clear starting point for binary indicators, experiments and classification. Their simplicity helps teams distinguish the event being measured from the probability assigned to it.

Define eligibility, the observation window and the treatment of missing outcomes before estimating p. Check whether a single probability is appropriate across the population or whether relevant conditions change it. When combining trials, justify assumptions about independence and stability. These choices determine whether a simple calculation is a useful approximation or a misleading summary.

People also ask

How is Bernoulli different from binomial?

Bernoulli describes one binary outcome. Binomial describes the number of ones in a fixed number of independent trials with the same p.

Can p equal zero or one?

Yes. Those are degenerate cases where the outcome is certain under the model.

Does logistic regression use a Bernoulli model?

Binary logistic regression commonly models the outcome conditionally as Bernoulli, with its probability determined by the input features and fitted parameters.

Check your understanding

A model gives a request a 0.8 probability of success. If the request fails, does that single event prove the probability was wrong?

Answer: No. Failure still had probability 0.2 under the model. Assessing probability quality requires suitable evidence across predictions and conditions, not judging one uncertain prediction as though it were a guarantee.

Related terms

  • Probability mass function (pmf)
  • Binomial distribution
  • Expected value
  • Variance
  • Independence
  • Logistic regression
  • Calibration
  • Binary outcome
  • probability mass function

Learn next

Define a binary event from a familiar workflow and state exactly when its outcome is observed. Calculate the mean and variance for p = 0.2, 0.5 and 0.9. Then compare one Bernoulli outcome with a count over several trials, listing the extra assumptions required for the binomial model.

  • Variance

More in Graphs and symbolic AI

  • Belief propagation - Belief propagation is a message-passing method for computing marginal probabilities in a probabilistic graphical model.
  • Belief state - A belief state represents an agent's information about the situation it may currently be in.
  • Benchmarking - Benchmarking is the systematic measurement and comparison of algorithms or systems using a defined set of tasks, data, metrics and test conditions.
  • Best bin first - Best Bin First, or BBF, is an approximate nearest-neighbor search method that explores promising regions of a k-d tree in priority order.
  • Best-first search - Best-first search is a family of search methods that repeatedly expands the most promising waiting node according to an evaluation function.
  • Best node search - Best Node Search, or BNS, is a game-tree search method that aims to identify the best move without necessarily calculating its exact minimax value.

Sources

SciPy documentation, scipy.stats.bernoulli, specifies the probability mass function and parameter range: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.bernoulli.html

AIMA glossary, Bernoulli, provides the source-list binary-distribution definition: https://github.com/aimacode/aima-glossary/blob/master/glossary.md?plain=1

The response calculation and fictional request-monitoring case are original teaching illustrations with explicit repeated-trial assumptions.

Previous: Berndt - Hall - Hall - Hausman algorithm Next: Bernoulli bandit

  • Home
  • Daily AI Updates
  • Blog
  • AIFBL Academy
  • AI Glossary
  • Products and Tools
  • Store
  • Free CFO AI Prompt Pack
  • About Shihan Sheriff
  • Privacy Policy
  • Terms of Use
  • Refund Policy
  • Cookie Policy
  • Earnings Disclaimer