How to solve a difference equation $p(a,b)=[p(a-1,b)+p(a,b-1)]/2$ from the gambler's ruin problem with several boundary conditions Recently I read a probability book and it is going to deduce pascal distribution from the famous gambler's ruin problem,where person A need to win for $a$ times or person B to win for $b$ times to end up games.
$p(a,b)$ refers to in such situation the probability that A wins the final game.
The writer give a difference equation:$$p(a,b)=[p(a-1,b)+p(a,b-1)]/2 \quad \tag{1}$$ and it boundary conditions:
$$p(0,b)=1,\ p(a,0)=0,\ p(a,a)=1/2$$
I understand the probability meaning behind the equation and boundary conditions.But I have no idea how to solve a difference linear equation with two variables,the result is $$p(a,b)=\sum_{i=a}^{a+b-1}\binom{a+b-1}{i}(\frac{1}{2})^{a+b-1}$$

I have tried using generating function $G(x,y)=\sum_{a=0}^{\infty}\sum_{b=0}^{\infty}p(a,b)x^ay^b$,
\begin{align*}
\sum_{a=1}^{\infty}\sum_{b=1}^{\infty}p(a,b)x^ay^b&=G(x,y)-\sum_{a=0}^{\infty}p(a,0)x^a-\sum_{b=0}^{\infty}p(0,b)y^b+p(0,0) \quad \tag{2}\\
&=G(x,y)-\sum_{b=0}^{\infty}y^b+\frac{1}{2}\\
&=G(x,y)-\frac{1}{1-y}+\frac{1}{2}\\
\end{align*}
then I use (1) and (2) as LHS, the RHS :
\begin{align*}
\sum_{a=1}^{\infty}\sum_{b=1}^{\infty}p(a-1,b)x^ay^b&=\sum_{a=0}^{\infty}\sum_{b=1}^{\infty}p(a,b)x^{a+1}y^b\\
&=x[G(x,y)-\sum_{a=0}^{\infty}p(a,0)x^a]\\
&=xG(x,y)
\end{align*}
and
\begin{align*}
\sum_{a=1}^{\infty}\sum_{b=1}^{\infty}p(a,b-1)x^ay^b&=\sum_{a=1}^{\infty}\sum_{b=0}^{\infty}p(a,b)x^{a}y^{b+1}\\
&=y[G(x,y)-\sum_{b=0}^{\infty}p(0,b)y^b]\\
&=yG(x,y)-\frac{y}{1-y}
\end{align*}
I solve the $G(x,y)$ is:
$$G(x,y)=\frac{1}{(y-1)(x+y-2)}$$
But it's still hard to expand $G(x,y)$ to series to get the $p(a,b)$.
 A: Boundary conditions. If we assume $p(a,0)=0$ and $p(0,b)=1$ for $a,b>0$, together with the equation $2p(a,b)=p(a-1,b)+p(a,b-1)$ as in $(1)$, then we have $p(a,b)+p(b,a)=1$ for $(a,b)\neq(0,0)$, shown using induction. Thus, $p(a,a)=1/2$ holds for $a>0$; it need not be given. Assume $p(0,0)=q$ is also given (it doesn't play any significant role however).
Generating function. Note that $G(x,0)=\sum_{a=0}^\infty p(a,0)x^a=p(0,0)=q$ should not depend on $x$, while your computed result still does. You seem to assume $q=1/2$ initially, but $q=0$ in
\begin{align*}
\sum_{a,b>0}p(a-1,b)x^ay^b=x\big(G(x,y)-G(x,0)\big)&=x\big(G(x,y)-q\big),
\\
\sum_{a,b>0}p(a,b-1)x^ay^b=y\big(G(x,y)-G(0,y)\big)&=y\left(G(x,y)-q-\frac{y}{1-y}\right).
\end{align*}
So, the corrected equation is $$G(x,y)=q+\frac{y}{1-y}+\frac{x}{2}\big(G(x,y)-q\big)+\frac{y}{2}\left(G(x,y)-q-\frac{y}{1-y}\right),$$ the solution of which is $$G(x,y)=q+\frac{y(2-y)}{(1-y)(2-x-y)}.$$ As expected, $p(a,b)$ don't depend on $q$ for $(a,b)\neq(0,0)$. Assume $q=0$ from now on.
Getting an answer. This can be done in many ways, with results looking differently.
The stated one may be obtained using $\sum_{n\geqslant 0}\binom{n+m}{n}z^n=(1-z)^{-m-1}$:
\begin{align*}
G(x,y)&=\frac{2y}{2-y}\left(1-\frac{x}{2-y}\right)^{-1}\left(1-\frac{y}{2-y}\right)^{-1}
\\&=\frac{2y}{2-y}\sum_{m,n\geqslant 0}\left(\frac{x}{2-y}\right)^m\left(\frac{y}{2-y}\right)^n
\\&=y\sum_{m,n\geqslant 0}x^m y^n 2^{-m-n}(1-y/2)^{-m-n-1}
\\&=y\sum_{m,n,k\geqslant 0}x^m y^n 2^{-m-n}\binom{m+n+k}{k}(y/2)^k
\\\color{gray}{[n+k=s]}&=y\sum_{m,s\geqslant 0}x^m y^s 2^{-m-s}\sum_{k=0}^s\binom{m+s}{k},
\end{align*}
so that $2^{a+b}p(a,b+1)=\sum_{k=0}^{b}\binom{a+b}{k}=\sum_{k=0}^{b}\binom{a+b}{a+b-k}=\sum_{k=a}^{a+b}\binom{a+b}{k}$ as expected.
