zlacker

[return to "Notation as a Tool of Thought"]
1. fouron+XL[view] [source] 2020-11-30 10:54:38
>>mafaa+(OP)
I recently came accross a math theorem that in my opinion perfectly illustrates how mathematical notation can sometimes reach harmful levels of abuse.

E( E(X|Y) ) = E(X)

This is known as "the law of total expectation", and as a programmer this notation is so weakly typed it makes no sense. The more correct notation is

E_Y(E_X(X|Y))

If you can see that the outer E is summing over Y and the inner one over X, then the theorem is immediately clearer and very intuitive.

◧◩
2. Myrmor+nN[view] [source] 2020-11-30 11:10:28
>>fouron+XL
In the inner expectation there’s only one choice: you’re conditioning on Y so it’s clear that X is the random variable whose expectation is being taken.

In the outer expectation, there’s only one choice: X no longer exists as a potential random variable (as if it were a local variable in the inner expectation) so the outer expectation must be over Y.

I’m not saying that you’re wrong that those subscripts could be used (they often are) but the meaning of the expression is clear after a little while working with expectations.

[go to top]