# Sum of alternating binomial-coefficient-type series

Let $$D,n\in \mathbb N$$ with $$0, and $$y>0$$ is a real number.

Question: Is there a closed-form for the following alternating sequence $$$$\sum_{k=0}^D (-y)^k {n\choose k}?$$$$

This question is related to a similar question where $$y=1$$.

Motivation: These kind of expressions arrive in numerical schemes that I am working on.

First attempt: I tried to repeat some of the techniques from $$y=1$$ case. For instance, using the complex integral argument, we have \begin{align} \sum_{k=0}^D (-y)^k {n\choose k} &= \sum_{k=0}^D (-y)^k \oint_{0<|z|<1} \frac{(1+z)^n}{z^{k+1}}\frac{dz}{2\pi i} = \oint_{0<|z|<1} \frac{(1+z)^n}{z} \sum_{k=0}^D \left(-\frac{y}{z}\right)^k \frac{dz}{2\pi i} \\ &= \oint_{0<|z|<1} \frac{(1+z)^n}{z} \left[\frac{z+y(-y/z)^D}{z+y}\right] \frac{dz}{2\pi i} \\ &= \oint_{0<|z|<1} \frac{(1+z)^n}{z+y} \frac{dz}{2\pi i} + y(-y)^D \oint_{0<|z|<1} \frac{(1+z)^n}{z^{D+1}(z+y)} \frac{dz}{2\pi i}. \end{align} I don't know much about complex integrals and so don't know how to complete this argument. Any ideas?

Or are their any other techniques that will work here? Any ideas/hints are appreciated.

• There should be $|z|=1$ below the integral everywhere. And $\int_{|z|=1}f(z)\,dz = \int_0^{2\pi}f(e^{it})ie^{it}\,dt$. – amsmath Apr 17 at 12:19
• @amsmath I don't understand. Is there a mistake in my question that you are referring to or is something else? Could you please elaborate. – UPS Apr 17 at 12:21
• I just gave you the definition of a complex line integral. – amsmath Apr 17 at 12:23
• BTW: Instead of the circle you can use a square. That might make integration easier. – amsmath Apr 17 at 12:28
• Note that you want to evaluate a special polynomial of degree $D$ at $-y$. So, it might be advantageous to find the zeros of that polynomial (in case that's possible -- I guess not). Otherwise you can use Horner's scheme of course. – amsmath Apr 17 at 12:38

We show the difference between the variant with general $$y$$ and $$y=1$$. We use the coefficient of operator $$[z^n]$$ to denote the coefficient of $$z^n$$ in a series. This way we can write for instance \begin{align*} [z^k](1+z)^n=\binom{n}{k}=\oint_{0<|z|<1} \frac{(1+z)^n}{z^{k+1}}\frac{dz}{2\pi i} \tag{1} \end{align*}

We obtain \begin{align*} \color{blue}{\sum_{k=0}^D(-y)^k\binom{n}{k}} &=\sum_{k=0}^D[z^k](1-yz)^n\tag{2}\\ &=[z^0](1-yz)^n\sum_{k=0}^Dz^{-k}\tag{3}\\ &=[z^0](1-yz)^n\frac{z^{-(D+1)}-1}{z^{-1}-1}\\ &=[z^{-1}](1-yz)^n\frac{z^{-(D+1)}-1}{1-z}\\ &=\left([z^D]-[z^{-1}]\right)\frac{(1-yz)^n}{1-z}\tag{4}\\ &\,\,\color{blue}{=[z^D]\frac{(1-yz)^n}{1-z}}\tag{5} \end{align*}

We see in (5) that in case $$y=1$$ we get \begin{align*} [z^D]\left.\frac{(1-yz)^n}{1-z}\right|_{y=1}=[z^D](1-z)^{n-1}=(-1)^D\binom{n-1}{D} \end{align*} but there is no way to make similar simplifications with general $$y$$.

Comment:

• In (2) we apply the coefficient of operator according to (1).

• In (3) we use the rule $$[z^{p-q}]A(z)=[z^p]z^qA(z)$$.

• In (4) we note $$\frac{(1-yz)^n}{1-z}=(1-yz)^n\sum_{j=0}^\infty z^j$$ is a power series in $$z$$ so that the residue $$[z^{-1}]$$ is zero.

• Thank you for this nice answer. How do you get (4), or rather why exactly is $z^{-1}\frac{(1-yz)^n}{1-z}=0$? – UPS Apr 17 at 16:27
• @UPS: You're welcome. I've added a corresponding comment. – Markus Scheuer Apr 17 at 16:34

You could write it using a hypergeometric function:

$$\left( 1-y \right) ^{n}-{n\choose D+1} \left( -y \right) ^{D+1} {\mbox{_2F_1}(1,-n+D+1;\,D+2;\,y)}$$

• Do you think this is better in numerical terms? – amsmath Apr 17 at 12:32
• Not particularly, though it might depend on how good your library's hypergeometric function evaluator is. – Robert Israel Apr 17 at 12:35
• Also might be useful if $D$ is close to $n$, especially if $y$ is small. – Robert Israel Apr 17 at 12:45
• @RobertIsrael Thank you for this closed form. So in my schemes, $D$ is much smaller than $n$, and $y\geq 1$. As mentioned in the comments above, this expression increases as a function of $n$ and then decreases. For $y=1$ this critical value is $n/2$. Is there a good way to differentiate this hypergeometric expression to arrive at the critical value (even numerically)? Sorry for repeating earlier comment. By the way, should I edit my question to explain this motivation? – UPS Apr 17 at 12:49
• Correction -- I mean it increases as a function of $k$, and then decreases ($n,y$ are fixed). – UPS Apr 17 at 12:57