Solution (source code)

= Solution

Condition on the first risk-neutral move. After a factor $1+a$, homogeneity of the call payoff gives
$$
\left((1+a)S_N-K\right)^+
=(1+a)\left(S_N-\frac K{1+a}\right)^+,
$$
and the analogous identity holds for $1+b$. Therefore the <binomial call-price recursion> is
$$
\operatorname{EC}(N+1,K)
=u\,\operatorname{EC}\left(N,\frac K{1+a}\right)
+v\,\operatorname{EC}\left(N,\frac K{1+b}\right),
$$
with
$$
\boxed{
u=\frac{(1+a)(b-r)}{(1+r)(b-a)},
\qquad
v=\frac{(1+b)(r-a)}{(1+r)(b-a)}}.
$$
The inequalities $a<r<b$ and $a>-1$ make both coefficients positive.