pebble-grouping

Sun Jul 05 2026

Why is E(X+Y)=E(X)+E(Y)E(X+Y) = E(X) + E(Y) with no independence assumption? My instinct said you need the distribution of X+YX+Y first, and building that distribution means working out how XX and YY interact. This note is the regrouping move that dissolved the itch, and the same move later turned out to prove LOTUS too.

Setup

Two fair coins. X=1X = 1 if the first coin lands heads, else 0. YY the same for the second coin. The route I trusted: find the distribution of X+YX+Y (values {0,1,2}\{0,1,2\} with probabilities {1/4,1/2,1/4}\{1/4, 1/2, 1/4\}, where the middle 1/21/2 comes from merging HT and TH), then E(X+Y)=1E(X+Y) = 1. That merge step felt essential. It is where the two coins combine, so I assumed any proof of linearity had to pass through it.

Now the second route. The sample space has four pebbles, HH, HT, TH, TT, each with weight 1/41/4. Sum directly over pebbles, never forming any distribution:

E(X+Y)=s(X(s)+Y(s))P({s})=214+114+114+014=1.E(X+Y) = \sum_s \big(X(s) + Y(s)\big)\,P(\{s\}) = 2 \cdot \tfrac14 + 1 \cdot \tfrac14 + 1 \cdot \tfrac14 + 0 \cdot \tfrac14 = 1.

Each term splits as X(s)P({s})+Y(s)P({s})X(s)P(\{s\}) + Y(s)P(\{s\}), so the whole sum splits into two pebble sums, one for XX and one for YY.

Where I got stuck

I refused to call those two sums E(X)E(X) and E(Y)E(Y). The sum sX(s)P({s})\sum_s X(s)P(\{s\}) runs over the four-pebble Cartesian-product world, but XX was born on a two-outcome world with its own PMF. The underlying experiment changed, so why would a sum over the wrong sample space compute E(X)E(X)? I could feel the informal rescue (each P({s})P(\{s\}) shrank, and the number of pebbles grew in proportion, so it balances out) but I could not formalize it.

The key move: group by value

Take the XX-part of the sum and, instead of adding left to right, collect the pebbles by the value XX takes:

sX(s)P({s})=1(14+14)+0(14+14)=112+012.\sum_s X(s)P(\{s\}) = 1 \cdot \big(\tfrac14 + \tfrac14\big) + 0 \cdot \big(\tfrac14 + \tfrac14\big) = 1 \cdot \tfrac12 + 0 \cdot \tfrac12.

Inside each group XX is constant, so it factors out. And each group's total weight is P(X=x)P(X = x) by definition, on whatever sample space XX happens to live. That is the marginal probability, computed by pooling pebbles. So the pebble sum is xxP(X=x)=E(X)\sum_x x\,P(X=x) = E(X), always. My "shrank but grew in proportion" intuition was this grouping, stated loosely. One correction to my first attempt at formalizing it: I leaned on "each xx repeats Y|Y| times", which only works for this product-shaped example. The grouping argument needs no product structure and no equal weights. Any pebble world, same move.

bh-ch4-pebble-grouping

The picture to keep: expectation has two accounting systems. Pebble-by-pebble sums over outcomes, value-by-value sums over the PMF. They are the same sum with the terms regrouped, and regrouping a finite sum changes nothing. So you compute in whichever system is convenient, and equalities proven in one system transfer to the other for free.

Payoff 1: linearity is unconditional

The split (X(s)+Y(s))P({s})=X(s)P({s})+Y(s)P({s})(X(s)+Y(s))P(\{s\}) = X(s)P(\{s\}) + Y(s)P(\{s\}) happens per pebble, before any distribution is formed. No joint structure exists yet, so independence never gets consulted. The merge I thought was essential (HT and TH pooling into P(X+Y=1)=1/2P(X+Y=1) = 1/2) is just the grouping move applied to the value of X+YX+Y, and it happens after linearity is already settled. That is the whole reason E(X+Y)=E(X)+E(Y)E(X+Y) = E(X) + E(Y) holds for dependent variables too.

Payoff 2: the same move is the LOTUS proof

Group the pebbles by the value of g(X)g(X) instead of the value of XX and you get LOTUS: E(g(X))=xg(x)P(X=x)E(g(X)) = \sum_x g(x)P(X=x). I did this by hand before knowing the theorem's name. Computing E(W)E(W) for W=(X3.5)2W = (X-3.5)^2 on a die, I instinctively paired the six terms into three collision braces (x=1x=1 with x=6x=6, and so on), and each brace held a constant value of WW with pooled weight 16+16=13=P(W=w)\tfrac16 + \tfrac16 = \tfrac13 = P(W=w). The braces are super-pebbles. Same grouping, different sorting key. The full LOTUS story, including what it does not license, lives in lotus-and-variance.

One move, two theorems: split before grouping gives linearity, group by g(X)g(X) gives LOTUS.