I have a grid of size $n\times n$, where the origin is set at $(0,0)$ and the coordinates of the points on this grid, can only be positive.
Let's say that we start at the point $(i,j)$. We can only go 1 step up or 1 step to the right and we want to reach the corner $(n,n)$. What is the total number of paths?
I want to solve this problem recursively (no other solutions allowed).
Let me define $N(i,j)$ the total number of paths to go from $(i,j)$ to $(n,n)$. Then, we need to solve this recursive equation
$$ N(i,j) = N(i+1,j) + N(i,j+1) $$
with boundary conditions
$$ N(n,j) = N(i,n)=1\,,\forall i\neq n, j\neq n\\ N(n,n)=0 $$
How can I solve this equation?
What I have done is to write down the generetical function
$$ f(x,y) = \sum_{i=0}^\infty\sum_{j=0}^\infty N(i,j)x^i y^j = \frac{y f(0,y)+x f(x,0)}{x+y-x y} $$
Is it useful somehow?
Guess a solution, then prove it by induction. By generalizing from small examples, you should be able to guess that: $$ N(i, j) = \frac{(2n - i - j)!}{(n - i)!(n - j)!} $$
It would probably have been easier if you had redefined the function to count paths from $(0, 0)$ to $(i, j)$.
For the inductive step, it would be helpful to recall Pascal's Identity: $$ \frac{p!}{q!(p - q)!} = \frac{(p - 1)!}{(q - 1)!(p - q)!} + \frac{(p - 1)!}{q!(p - q - 1)!} $$