diff --git a/content/4_Gold/Combinatorics.mdx b/content/4_Gold/Combinatorics.mdx index 2fa16063d9..70a8dd3af9 100644 --- a/content/4_Gold/Combinatorics.mdx +++ b/content/4_Gold/Combinatorics.mdx @@ -1107,6 +1107,19 @@ print(expected_ops) +## Expected Products + +Linearity of expectation deals with $E[X + Y]$, but what about $E[X \cdot Y]$? + +$E[X \cdot Y] = E[X] \cdot E[Y]$ if $X$ and $Y$ are independent from each other. +We can reconsider the example of a fair 6-sided die to show that $E[X^2] \neq E[X]^2$. +We know that $E[X] = \frac{7}{2}$, so $E[X]^2 = \frac{7}{2} \cdot \frac{7}{2} = \frac{49}{4}$. + +On the other hand, +$$ +E[X^2] = \sum_x x^2 \cdot P(X = x) = \frac{1 + 4 + 9 + 16 + 25 + 36}{6} = \frac{91}{6}. +$$ + ## Problems