# Is it possible to extract a variable out of a bounded sum of binomial coefficients

I've got a problem that looks like $$y = \sum\limits^x_{i=0} { a \choose i } b^i$$ where $a, b$ are constant. I'd like to rewrite this equation to define $x$ in terms of $y$, to directly compute the $x$ that belong to certain values of $y$.

If I use the Binomial identity $(1 + b)^a = \sum^\infty_{i=0} { a \choose i}b^i$, I can write the problem as $$y = \sum\limits^x_{i=0} { a \choose i } b^i= \sum^\infty_{i=0} {a \choose i}b^i - \sum^\infty_{i=x+1} {a \choose i}b^i = (1+b)^a - \sum^\infty_{i=x+1} {a \choose i}b^i$$ but that doesn't get me much further...

• So just to clarify, you want to calculate $x(y)$, right? – Ali Jun 29 '18 at 11:51
• That's correct. – Thom Wiggers Jun 29 '18 at 14:37
• There is no closed-form of $y(x)$, and even less of the inverse. – Yves Daoust Jun 29 '18 at 14:40
• That's unfortunate... I'll just have to brute force it then (luckily $x$ won't be that large) – Thom Wiggers Jun 29 '18 at 14:54
• @ThomWiggers: I cannot prove this, but due to the relation with the cumulative binomial distribution, we have sufficient evidence that no easy formula is available (besides explicit summation). The normal approximation doesn't help much, as it would require the inverse of the error function. – Yves Daoust Jun 29 '18 at 15:13

Set $\dfrac p{1-p}=b$ and write

$$y=\sum_{i=0}^x\binom aib^i=\sum_{i=0}^x\binom ai\frac{p^i}{(1-p)^i}=\frac 1{(1-p)^a}\sum_{i=0}^x\binom ai p^i(1-p)^{a-i}.$$

Then $y$ is a scaled cumulative binomial distribution, which can be denoted $(1-p)^aF(x;n,p)$.

The inverse can be expressed as

$$x=F^{-1}\left(\frac y{(1-p)^a};n,p\right)$$ and there is no explicit formula.

If what you are after is a computation algorithm (which I suspect), a possible way is to precompute and store the partial sums up to the maximum $x$ and answer queries by dichotomic search.

• I assume $F$ is the error function you mentioned in your comment? I'm indeed after the results of $x(y)$ much more than I want a formula, but a formula would've been nice. It seems I'm out of luck though – I'll just put a table in my thesis. Thanks! – Thom Wiggers Jun 29 '18 at 16:28
• @ThomWiggers: no, ther error function is $\text{erf}$. – Yves Daoust Jun 29 '18 at 17:32