Visual walkthrough — Bagging and bootstrap aggregating
We are going to answer one question: when you average many wobbly guesses, how much does the wobble shrink — and what stops it from shrinking to zero?
Step 0 — What is a "wobbly guess"? (setting the stage)
WHAT. Picture one machine — say a decision tree — that looks at a fresh input point and spits out a number, its prediction. Call that number . The little hat "" just means estimate — a guess, not the truth. The subscript means "machine number 1."
There is also a true answer we wish we knew, the real target value at . We write it — no hat, because it is the truth, not a guess. Keep both in mind: is a machine's attempt at the true .
WHY treat it as random? Because we trained it on a resampled copy of the data (a bootstrap sample). Shuffle the deck differently and the tree comes out slightly different, so its guess jumps around. A quantity that jumps around when you re-run the experiment is exactly what mathematicians call a random variable.
PICTURE. Below, one tree is asked the same question many times, each time trained on a differently-shuffled deck. Every white dot is one guess. They scatter around a centre.

Term by term:
- reads "expected value of" — imagine running the experiment a million times and taking the plain average. It returns the centre .
- reads "variance of" — the average squared distance from that centre. It returns the spread .
Step 1 — The averaging move
WHAT. Instead of trusting one tree, we build of them (say ) on different decks, then average their guesses:
Reading the symbols left to right:
- — the bar on top means "averaged." This is the whole ensemble's single answer.
- — divide by how many trees there are (that is what "average" means).
- — the ("sigma", capital S for Sum) says add up, letting the counter run from tree to tree .
WHY average and not, say, pick the best? Because we don't know which tree is best on a new point — its errors are random. Averaging is the one operation that lets opposite errors cancel: a tree guessing too high pairs with one guessing too low.
PICTURE. Many clouds collapsing toward one tight centre.

Step 2 — Averaging does NOT move the aim (bias is untouched)
WHAT. We compute the centre of the averaged guess .
WHY this first? Before celebrating a tighter cloud, we must check we didn't drag the aim off-target. A tight cloud around the wrong spot is useless.
The tool we need is linearity of expectation: the average of sums is the sum of averages. can slide through and through constant multipliers untouched. That is the only property we use here, and it is always true — no independence required.
- Pull the constant out front (allowed — linearity).
- Each inner expectation is (all trees have the same aim).
- Add to itself times ; the cancels the .
Result: the aim is still , so the bias is exactly what it was for one tree. Same centre. This is why bagging cannot fix bias — it only reshapes the cloud, never relocates it.
PICTURE. The single tree's centre and the ensemble's centre sit at the exact same dashed line; only the width differs.

Recall Why can't averaging move the centre?
Because it does not throw information away directionally — it treats over-guesses and under-guesses symmetrically. Symmetric cancellation leaves the balance point where it was. Averaging changes the width but not the aim ::: yes — bias stays fixed, only variance shrinks.
Step 3 — The variance of a sum: the honest bookkeeping
WHAT. Now the payoff — the spread of . To get there we need one general fact about the variance of a weighted sum. Let be any random numbers and fixed weights (in a moment we will set , the -th tree's guess, and — the are our trees, nothing more exotic):
WHY does the second sum appear at all? Variance is built from squares: . When , squaring a sum produces every cross-term , not just the squares — think of : the is the cross-term. Each cross-term measures how tree and tree move together, which is exactly the covariance. So "add the variances alone" () is only correct when every cross-term vanishes — i.e. when the are independent. Our trees share the original dataset, so they err together and the cross-terms survive.
PICTURE. Squaring a sum of two arrows fills a block — two diagonal "square" tiles and two off-diagonal "cross" tiles. Those cross tiles are the covariances.

Step 4 — Plug in our specific numbers
WHAT. Set and the weights . Every tree has variance ; every distinct pair has covariance . Now count the cells in the full pair-grid:
- Diagonal cells (tree with itself): there are of them, each contributing .
- Off-diagonal cells (distinct pairs): a grid has cells; remove the diagonal ones, leaving pairs, each contributing .
WHY count so carefully? Because the whole punchline lives in the ratio of these two counts. As grows, the off-diagonal cells ( of them) vastly outnumber the diagonal ones ( of them) — so the shared-error term will refuse to die. That is the floor, forming before our eyes.
PICTURE. The full grid, now shaded: a thin diagonal ribbon (shrinking share) versus a huge off-diagonal field (dominant share).

Step 5 — Simplify to the boxed law
WHAT. Expand the bracket and divide each piece by :
Rewrite and regroup so the terms sit together:
WHY regroup this way? We want to physically separate the two behaviours the reader cares about: the part that survives forever (no attached) from the part that melts as grows (carries a ). Collecting all the without a into one bucket, and everything with a into another, makes those two fates literally sit side by side.
Term by term — read this like a dashboard:
- — the floor. It has no in it. Adding trees can never touch it. It is set purely by how alike the trees are.
- — the meltable part. It carries a , so it shrinks toward as you add trees.
Step 6 — Cover every case (the edges)
A law you can't stress-test isn't understood. Push the two knobs and to their extremes.
Case A — (independent trees). Floor . Variance : the classic "divide by ." Ten trees → one-tenth the wobble. This is the dream, rarely reachable because trees share data.
Case B — (clone trees, e.g. a stable learner like linear regression). Floor ; meltable part . Variance stays no matter how many trees — bagging does nothing. This is the parent note's "don't bag stable models" mistake, proven.
Case C — (one tree). . Sanity check: one tree must have its own variance . ✓
Case D — (infinite trees). The term vanishes; . You hit the floor. The only escape left is to lower — which is exactly why Random Forests inject extra randomness at each split.
PICTURE. Variance-versus- curves for several values, each flattening onto its own floor .

The one-picture summary
Everything above lives in one diagram: the total variance is a floor you cannot melt plus a puddle that adding trees melts away.

Recall Feynman: tell the whole walkthrough to a friend
One tree is a friend who guesses the weather with random over/under errors — a fat cloud of guesses (that width is , the centre is , and how far sits from the real weather is the bias). Ask fifty friends and average them: the over-guesses and under-guesses cancel, so the cloud tightens — but the centre stays put (that's why bagging fixes wobble, never a wrong aim). How much does it tighten? If the friends thought totally independently, the cloud would shrink by a full . But they all read the same newspaper, so their mistakes overlap — that overlap is . The math splits the wobble into two parts: a floor that no number of friends can remove because it's baked into their shared reading, and a meltable puddle that shrinks with every friend you add. Add friends → puddle gone → you're left standing on the floor. Want to go lower? Make the friends read different newspapers (lower ) — that's the whole idea behind Random Forests.