<s>[INST] 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. 
 [/INST] 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} $.
</s>