Table of Content
只是加上 condition,其他一切照舊。
Given \(\{A_i\}\) is a partition of the sample space.
In conditional probability, we have
\[P(B) = \sum_i P(A_i)P(B|A_i).\]Here in conditional pmf, we have
\[p_X(x) = \sum_i P(A_i)p_{X|A_i}(x),\]and this is called the total probability theorem.
想像 \(B = \{X=x\}\).
Moreover, if we multiply both sides with \(x\) and sum over it, we get
\[\begin{align*} E[X]=\sum_x xp_X(x) &= \sum_x x\sum_i P(A_i)p_{X|A_i}(x) \\ &= \sum_i \sum_x xP(A_i)p_{X|A_i}(x) \\ &= \sum_i P(A_i)\sum_x xp_{X|A_i}(x) \\ &= \sum_i P(A_i)E[X|A_i]. \end{align*}\]This is called the total expectation theorem.
將樣本空間拆成數個好計算的 disjoint event spaces,個別計算期望值後再依權重(該 event space 的機率)取和。
Define
\[p_{X\vert Y}(x \vert y) = {p_{X,Y}(x,y) \over p_Y(y)},\]i.e.
\[p_{X,Y}(x,y) = p_X(x)p_{Y \vert X}(y \vert x) = p_Y(y)p_{X \vert Y}(x \vert y).\]Moreover,
\[E[X \vert Y = y] = \sum_x xp_{X \vert Y}(x \vert y), \\ E[X] = \sum_yp_Y(y)E[X \vert Y=y].\]For linearity, we have
\[E[(X+Y) \vert Z] = E[X \vert Z] + E[Y \vert Z].\]For variance, we have
\[var(X \vert Y) = E[(X-E[X \vert Y])^2 \vert Y] = E[X^2 \vert Y] - (E[X \vert Y])^2.\]展開整理就可證明。