bernoulli distribution calculator

Bernoulli Distribution Calculator

Enter a probability of success p and choose the outcome x (0 or 1). The calculator returns the probability mass value and key distribution metrics.

Enter values and click Calculate to see results.

What Is a Bernoulli Distribution?

A Bernoulli distribution is the simplest discrete probability distribution. It models an experiment with only two outcomes: success (1) and failure (0). If the probability of success is p, then the probability of failure is 1 - p.

Typical examples include flipping a biased coin (heads = 1, tails = 0), whether a user clicks an ad (click = 1), or whether a manufactured part passes inspection (pass = 1).

Probability Mass Function (PMF)

P(X = 1) = p

P(X = 0) = 1 - p

Since there are only two outcomes, calculating probabilities is direct and intuitive.

Key Properties

  • Support: X ∈ {0, 1}
  • Mean (Expected Value): E[X] = p
  • Variance: Var(X) = p(1 - p)
  • Standard Deviation: √(p(1 - p))

How to Use This Calculator

Step 1: Enter p

Input a valid probability between 0 and 1. For example, p = 0.2 means success happens 20% of the time.

Step 2: Enter x

Enter x as either 0 or 1. Any other value is invalid for a Bernoulli random variable.

Step 3: Calculate

Click the calculate button to get:

  • P(X = x) for your chosen outcome
  • Mean, variance, and standard deviation
  • CDF value at x

Worked Example

Suppose a player makes a free throw with probability p = 0.75.

  • Probability of making the shot (x = 1): P(X = 1) = 0.75
  • Probability of missing (x = 0): P(X = 0) = 0.25
  • Expected value: E[X] = 0.75
  • Variance: 0.75 × 0.25 = 0.1875

Bernoulli vs. Binomial

A Bernoulli random variable represents one trial. A binomial random variable represents the sum of many independent Bernoulli trials with the same p.

  • Bernoulli: one yes/no trial
  • Binomial: number of successes across n trials

Common Mistakes to Avoid

  • Using p outside the interval [0, 1]
  • Entering x values other than 0 or 1
  • Confusing Bernoulli (single trial) with binomial (multiple trials)
  • Forgetting that P(X=0) is 1-p, not p

Why This Distribution Matters

The Bernoulli model appears everywhere: machine learning labels, conversion events in marketing, reliability testing, quality control, and medical outcomes (success/failure). Understanding it builds a foundation for more advanced models such as binomial, geometric, and logistic regression frameworks.

🔗 Related Calculators