Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Part 1: The Bernoulli Trial — The Atom of Randomness

DhvaniAI

An Applied Scenario — One Reading from a Vibration Sensor

A factory motor has an accelerometer bolted to its housing. Every millisecond, the sensor reports a vibration amplitude in g (units of gravity). Most of the time the reading sits inside the normal operating band — say, between -2 g and +2 g. Occasionally, a transient impact pushes it above +2 g.

You set up a simple condition monitor: for each new sample, mark it 1 if it exceeds +2 g, else 0.

That single observation — did this sample cross the threshold? — is the smallest possible random event. There are exactly two outcomes. There is one number that controls how often you see a 1: the probability that any given sample is a transient.

You now have everything you need to define the simplest distribution in probability.


Intuition

The atom of all the randomness we’ll study is this: something either happens or it doesn’t.

This binary event is called a Bernoulli trial. It has exactly one parameter: the probability of “success,” pp. (“Success” just means the event you’re counting — a threshold crossing, a fault, an absorbed photon.)

XBernoulli(p)X={1with probability p0with probability 1pX \sim \text{Bernoulli}(p) \quad \Rightarrow \quad X = \begin{cases} 1 & \text{with probability } p \\ 0 & \text{with probability } 1-p \end{cases}

Mean: E[X]=pE[X] = p Variance: Var(X)=p(1p)\text{Var}(X) = p(1-p)

The mean tells you the long-run fraction of 1s. The variance is largest at p=0.5p = 0.5 (maximum uncertainty) and shrinks to 0 as pp approaches 0 or 1 (the outcome becomes predictable).


Back to the Vibration Sensor

For the motor scenario, suppose calibration runs show that on a healthy machine, roughly 1 sample in 200 crosses +2 g from ambient noise alone. That fixes the parameter:

p=1200=0.005p = \frac{1}{200} = 0.005

Each new millisecond is one Bernoulli trial with p=0.005p = 0.005. The stream of 0s and 1s coming out of the threshold check is a sequence of independent Bernoulli outcomes — provided the machine state isn’t changing.

This is already useful on its own: if you start seeing 1s at a rate much higher than 0.005, something has changed. But to quantify “much higher” you need to count successes over a window of nn samples — and that’s the Binomial distribution.


Where Else Bernoulli Trials Appear

The same atom shows up across signal processing and ML wherever a single binary decision is made:

DomainWhat’s the trial?What’s pp?
Vibration monitoringOne sample crosses alarm thresholdProbability of a transient per sample
Audio VADOne frame contains speechSpeech-active fraction
Image sensor (CMOS)One photon produces a detectable electronQuantum efficiency, QE
Image thresholdingOne pixel exceeds intensity TTFraction of “bright” pixels
Binary classifierOne input is classified as positiveClass prior × model accuracy
ReliabilityOne unit fails in its first yearAnnual failure probability

A note on the photon case — it’s the cleanest physical Bernoulli trial in nature. A CMOS photosite converts photons to electrons via the photoelectric effect. The sensor’s quantum efficiency (QE ≈ 0.4–0.9 for modern silicon) is literally a Bernoulli probability:

QE=p=electrons producedphotons incident\text{QE} = p = \frac{\text{electrons produced}}{\text{photons incident}}

Each incident photon is one independent trial. We’ll lean on this in later parts because the physics gives us an exact pp to work with.


Key Insight

Each 1 in a Bernoulli stream is one event — one threshold crossing, one absorbed photon, one positive classification. On its own, a single trial tells you almost nothing. What you actually care about is the count of successes over many trials: how many transients in a 1-second window, how many electrons from a 10 ms exposure, how many positive predictions in a batch.

Counting Bernoulli successes is exactly what the Binomial distribution does — and that’s Part 2.