I'm trying to find the exact value of the following equation:
$$\sum_{x=0}^{1000}\tfrac{x^{2}-x+5}{x!(1000-x)!}2^{x}7^{1000-x}$$
I've managed to convert to the following:
$$\sum_{x=0}^{1000}((x-\frac{1}{2})^{2}+4.75)\binom{1000}{x}\left(\frac{2}{9}\right)^{x}\left(\frac{7}{9}\right)^{1000-x}$$
So it seems that it's related to the cumulative density of a binomial distribution, I'm just having problems getting rid of the quadratic equation.
Any suggestions? This is for an assignment so I'm not asking for the value, just want to know which way to move forward.
Recall that if $X \sim \mathrm{Binomial}(n,p)$, then $$\mathrm{E}[X] = \sum_{x=0}^n x \binom{n}{x} p^x (1-p)^{n-x} = np,$$ and $$\mathrm{E}[X^2] = \mathrm{Var}[X] + \mathrm{E}[X]^2 = np(1-p) + (np)^2.$$ In general, $$\mathrm{E}[g(X)] = \sum_{x=0}^n g(x) Pr[X = x] = \sum_{x=0}^n g(x) \binom{n}{x} p^x (1-p)^{n-x},$$ where $g$ is some function. In your case, try the choice $g(x) = x^2 - x + 5,$ which lets us get through the linearity of expectation $$\mathrm{E}[X^2 - X + 5] = \mathrm{E}[X^2] - \mathrm{E}[X] + 5 = np(1-p) + (np)^2 - np + 5$$ for a suitable choice of $n$ and $p$. But now you have to be careful to note that the given sum requires multiplication of a suitable constant factor to turn it into the expectation of a function of a binomial distribution.