Summation rule for conditional probability

49 Views Asked by At

Both $A$ and $B$ are random variables. G is a random variable depends on A,B. The expectation is: $\text{E}[G|A,B] = \sum_{g\in G} g P(G=g|A,B)$. I would like to know if

$$ \sum_{a} \big[P(A=a|B)-1\big]\text{E}[G|A,B] = \text{E}[G|B]- \text{E}[G|A,B]$$

holds?

Or, suppose A is an $N$ categorical variable, $$ \sum_{a} \big[P(A=a|B)-1\big]\text{E}[G|A,B] = \text{E}[G|B]- N\text{E}[G|A,B]$$