# Summation using cdf of binomial distribution

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.
Hint: $~\displaystyle(1+u)^n=\sum_{k=0}^n{n\choose k}u^k.\quad$ Now differentiate both sides with regards to u, and see what
happens. ;-$)~$ Can you take it from here ?
There are two parts in the sum and each is amenable to the binomial expansion $$\sum_{k=0}^n{n\choose k}2^k7^{n-k}=(2+7)^n=9^n.$$ First part: $$\sum_{x=0}^{1000}\frac{x(x-1)}{x!(1000-x)!}2^{x}\cdot7^{1000-x}\stackrel{x=k+2}{=}\sum_{k=0}^{998}\frac1{k!(998-k)!}4\cdot2^{k}\cdot7^{998-k}=\frac4{998!}9^{998}$$ Second part: $$\sum_{x=0}^{1000}\frac{5}{x!(1000-x)!}2^{x}\cdot7^{1000-x}=\frac5{1000!}9^{1000}$$ The sum of the two parts: $$\frac{9^{998}}{1000!}\,\left(4\cdot999\cdot1000+5\cdot9^2\right)\approx2\cdot10^{-1609}.$$