Why does $E[X+Y]$ equal the following?:
$$\mathbb{E}[X+Y] = \sum_{x,y}(x+y)P(X=x,Y=y)$$
I dont understand why its a joint probability instead of $P(X=x+Y=y)$. Can somebody please make it clear why its a joint probability instead?
Why does $E[X+Y]$ equal the following?:
$$\mathbb{E}[X+Y] = \sum_{x,y}(x+y)P(X=x,Y=y)$$
I dont understand why its a joint probability instead of $P(X=x+Y=y)$. Can somebody please make it clear why its a joint probability instead?
Call $Z = X+Y$
$$E(Z) = \sum_z z P(Z=z) = \sum_{x+y} (x +y) P(X+Y = x + y) $$
where the last sum is intended as "all the values the sum $x+y$ can take". It means exactly the same thing as $\sum_z zP(X+Y = z)$, I wrote it that way so to remark the "parallelism" between the two formulas. (Hope it's more clear now with the edit)
The key point though is that these sums I just wrote are over all the possible values of $x+y$
If you instead take a sum on all distinct values of $x$ and $y$ (like you do), then you can "group" together all the elements that result in the same $x + y$, and the your joint probability $P(X = x, Y=y)$ gets summed over all the elements that result in the same $x+y$ resulting in $P(X+Y = x + y)$, same expression as above