Prove equality involving binomial coefficients I was solving a probability problem and I got a different answer than the one given in the book. Seems the authors were using a different way of counting/arguing.
For the two answers to be equal, the following equality should hold true. 
$$\sum_{k=0}^{b-1} \binom{a+k-1}{a-1} p^a (1-p)^k = \sum_{k=a}^{a+b-1} \binom {a+b-1}{k} p^{k} (1-p)^{a+b-k-1}$$
How can this be proved? 
And the problem itself was: in a series of Bernoulli trials with probability for success in a single trial equal to $p$, what is the probability to get $a$ successes before getting $b$ failures?
I think you guys will reverse engineer how I counted and how the authors counted. 
 A: This is a nice question!
The short answer is: You've already proved it! By showing that the two sides are different counts of the same thing, you've proved that they're equal.
On the assumption that you're looking for an algebraic proof, here's a longer answer. Since on the left you only consider as many trials as you need until the result is decided, whereas on the right the authors consider all $a+b-1$ trials until the result is decided no matter what it is, we can transform your sum into their sum by adding the missing irrelevant $b-k-1$ trials:
\begin{eqnarray*}
\sum_{k=0}^{b-1}\binom{a+k-1}{a-1}p^a(1-p)^k
&=&
\sum_{k=0}^{b-1}\binom{a+k-1}{a-1}p^a(1-p)^k1^{b-k-1}
\\
&=&
\sum_{k=0}^{b-1}\binom{a+k-1}{a-1}p^a(1-p)^k(p+(1-p))^{b-k-1}
\\
&=&
\sum_{k=0}^{b-1}\binom{a+k-1}{a-1}p^a(1-p)^k\sum_{j=0}^{b-k-1}\binom{b-k-1}jp^j(1-p)^{b-k-1-j}
\\
&=&
\sum_{k=0}^{b-1}\sum_{j=0}^{b-k-1}\binom{a+k-1}{a-1}p^a(1-p)^k\binom{b-k-1}jp^j(1-p)^{b-k-1-j}
\\
&=&
\sum_{j=0}^{b-1}\sum_{k=0}^{b-j-1}\binom{a+k-1}{a-1}p^a(1-p)^k\binom{b-k-1}jp^j(1-p)^{b-k-1-j}
\\
&=&
\sum_{j=0}^{b-1}p^ap^j(1-p)^{b-1-j}\sum_{k=0}^{b-j-1}\binom{a+k-1}{a-1}\binom{b-k-1}j
\\
&=&
\sum_{j=0}^{b-1}p^ap^j(1-p)^{b-1-j}\sum_{k=0}^{b-j-1}\binom{b-k-1}{b-j-1-k}\binom{a+k-1}k
\\
&=&
\sum_{j=0}^{b-1}p^ap^j(1-p)^{b-1-j}\binom{a+b-1}{b-j-1}
\\
&=&
\sum_{j=0}^{b-1}p^ap^j(1-p)^{b-1-j}\binom{a+b-1}{a+j}
\\
&=&
\sum_{k=a}^{a+b-1}\binom{a+b-1}kp^k(1-p)^{a+b-k-1}\;,
\end{eqnarray*}
where the inner sum is evaluated using the relationship
$$
\sum_{k=0}^n\binom{x+n-k-1}{n-k}\binom{y+k-1}k=\binom{x+y+n-1}n\;,
$$
of which several proofs are given at Proving that ${x +y+n- 1 \choose n}= \sum_{k=0}^n{x+n-k-1 \choose n-k}{y+k-1 \choose k} $.
A: I didn't post this because joriki posted first and his answer is essentially the same (+1). However, since some explanation of the steps might be useful, I will post mine to provide an explanation for his steps.
$$
\begin{align}
&\sum_{k=0}^{b-1}\binom{a+k-1}{a-1}p^a(1-p)^k\tag1\\
&=\sum_{k=0}^{b-1}\binom{a+k-1}{a-1}p^a(1-p)^k(p+(1-p))^{b-k-1}\tag2\\
&=\sum_{k=0}^{b-1}\sum_{j=0}^{b-k-1}\binom{a+k-1}{a-1}\binom{b-k-1}{j}p^a(1-p)^kp^j(1-p)^{b-j-k-1}\tag3\\
&=\sum_{j=0}^{b-1}\sum_{k=0}^{b-j-1}\binom{a+k-1}{a-1}\binom{b-k-1}{j}p^{a+j}(1-p)^{b-j-1}\tag4\\
&=\sum_{j=0}^{b-1}\binom{a+b-1}{a+j}p^{a+j}(1-p)^{b-j-1}\tag5\\
&=\sum_{j=a}^{a+b-1}\binom{a+b-1}{j}p^{j}(1-p)^{a+b-j-1}\tag6
\end{align}
$$
Explanation:
$(2)$: multiply by $1=(p+(1-p))^{b-k-1}$
$(3)$: apply the Binomial Theorem to $(p+(1-p))^{b-k-1}$
$(4)$: switch order of summation and combine terms
$(5)$: sum in $k$ using $\sum_{k=0}^{b-c}\binom{a+k}{a}\binom{b-k}{c}=\binom{a+b+1}{a+c+1}$
$(6)$: substitute $j\mapsto j-a$
A: Starting from
$$\sum_{k=0}^{b-1} {a+k-1\choose a-1} p^a (1-p)^k
= \sum_{k=a}^{a+b-1} {a+b-1\choose k} p^k (1-p)^{a+b-k-1}$$
we simplify to
$$\sum_{k=0}^{b-1} {a+k-1\choose a-1} p^a (1-p)^k
= \sum_{k=0}^{b-1} {a+b-1\choose a+k} p^{a+k} (1-p)^{b-k-1}$$
or
$$\sum_{k=0}^{b-1} {a+k-1\choose a-1} (1-p)^k
= \sum_{k=0}^{b-1} {a+b-1\choose a+k} p^k (1-p)^{b-k-1}.$$
We get for the LHS
$$\sum_{k\ge 0} {a+k-1\choose a-1} (1-p)^k
[[0\le k\le b-1]]
\\ = \sum_{k\ge 0} {a+k-1\choose a-1} (1-p)^k
[z^{b-1}] \frac{z^k}{1-z}
\\ = [z^{b-1}] \frac{1}{1-z}
\sum_{k\ge 0} {a+k-1\choose a-1} (1-p)^k z^k
\\ = [z^{b-1}] \frac{1}{1-z} \frac{1}{(1-(1-p)z)^a}.$$
The RHS is
$$\sum_{k=0}^{b-1} p^k (1-p)^{b-k-1}
[z^{b-1-k}] \frac{1}{(1-z)^{a+k+1}}
\\ = [z^{b-1}] \frac{1}{(1-z)^{a+1}}
\sum_{k=0}^{b-1} p^k (1-p)^{b-k-1}
\frac{z^k}{(1-z)^{k}}.$$
There is  no contribution to  the coefficient extractor in  front when
$k\gt b-1$ and we may extend $k$ to infinity, getting
$$(1-p)^{b-1} [z^{b-1}] \frac{1}{(1-z)^{a+1}}
\sum_{k\ge 0} p^k (1-p)^{-k}
\frac{z^k}{(1-z)^{k}}
\\ = (1-p)^{b-1} [z^{b-1}] \frac{1}{(1-z)^{a+1}}
\frac{1}{1-pz/(1-p)/(1-z)}
\\ = (1-p)^{b-1} [z^{b-1}] \frac{1}{(1-z)^a}
\frac{1}{1-z-pz/(1-p)}
\\ =  [z^{b-1}] \frac{1}{(1-(1-p)z)^a}
\frac{1}{1-(1-p)z-pz}
\\ = [z^{b-1}] \frac{1}{1-z} \frac{1}{(1-(1-p)z)^a}.$$
The LHS and the RHS are seen to be the same and we may conclude.
 Remark.  The  first  one  is the  easy  one  and  follows  by
inspection. The Iverson bracket may be  of interest here as an example
of the method.
