# Expectation with $-1$

I am trying to study probability theory by myself. I asked myself a question about expectation, and I have no idea how to solve it. Please help me with solution and my understanding. The question I asked is following: Let $a, b, c, d$ be non-negative natural numbers, say from the set $\{0, 1, ..., n\}.$ Calculate the expectation $$E\left( (-1)^{a+b+c+d}\right).$$

You should say something about the probability distribution of your four random variables $a,b,c,d$. – Michael Hardy Feb 29 '12 at 3:32
$(-1)^{a+b+c+d} = (-1)^a (-1)^b (-1)^c (-1)^d$. Assuming $a,b,c,d$ are independent (which you didn't say but is probably what is meant), the expected value of the product is the product of the expected values. $(-1)^a$ is $-1$ if $a$ is odd and $1$ if $a$ is even. So if the values $0,1,\ldots,n$ are all equally likely (which again you didn't say but you probably meant), it all comes down to counting how many odd and even numbers there are in $0,1,\ldots,n$.
...and that depends on whether $n$ is odd or even. If $n$ is odd, then there are equally many odd and even numbers, so $E((-1)^a)$ would be $0$. If $n$ is even, it's a bit more complicated. – Michael Hardy Feb 29 '12 at 3:34