Skip to content

Bernoulli Distribution (Discrete)

1
2
3
4
5
6
7
8
!uv pip install -q \
    pandas==2.3.3 \
    numpy==2.3.2 \
    scipy==1.16.2 \
    altair==5.5.0 \
    matplotlib==3.10.6 \
    sympy==1.14.0 \
    latexify-py==0.4.4

Models a single experiment with exactly two outcomes: Success (\(k=1\)) or Failure (\(k=0\)).

  • Parameters: \(p\) (probability of success)
  • Function: PMF
  • Mean (\(E[X]\)): \(p\)
  • Variance (\(\sigma^2\)): \(p \cdot q\) (where \(q = 1-p\))

Use Case & Example:

Scenario Question \(p\) \(q\)
Coin Flip Will the next flip be Heads (\(k=1\))? \(0.5\) \(0.5\)
Quality Control Will the next item on the line be Defective (\(k=1\))? \(0.02\) \(0.98\)
Sales Will the next website visitor make a Purchase (\(k=1\))? \(0.1\) \(0.9\)