Recurrences & Generating Functions


Answer & solution
Answer: (n+1)(n+2)/2 = C(n+2,2). (no official key was published)
Start with m=1. The recurrence says F(n,1)=F(n−1,1)+F(n,0)=F(n−1,1)+1, and F(0,1)=1. Therefore F(n,1)=n+1.
Now use m=2. We get F(n,2)=F(n−1,2)+F(n,1)=F(n−1,2)+(n+1), with F(0,2)=1. Summing the increments from 1 through n gives
F(n,2)=1+Σ_(r=1)n(r+1)
=1+n(n+1)/2+n
=(n+1)(n+2)/2.
This equals C(n+2,2), anticipating the general binomial formula. A direct induction check also works: the proposed formula for n−1 is n(n+1)/2; adding n+1 gives (n+1)(n+2)/2. The base n=0 gives 1 as required.
For n=1, F(1,2)=F(0,2)+F(1,1)=1+2=3, consistent with the formula. The offset matters: n(n+1)/2 would correspond to a different boundary condition and would incorrectly give 1 when n=1. Both axes in this program have value 1, not 0.