Currently, I'm interested about Pascal's triangle and binomial coefficients. To train my skills in programming, I plotted a Pascal triangle using only its image. So, I got a beautiful recursive function that looks like as: $$ p(l,r) = \begin{cases} 1, & \text{if $l$ or $r$ is 0} \\ p(l-1,r)+p(l,r-1), & \text{otherwise} \end{cases}$$ $l$ and $r$ means are positions number on left side and right side. However, we can transform this function for $n$ and $k$ arguments("$n$ choose $k$") and got: $$ p(n,k) = \begin{cases} 1, & \text{if $k$ is 0} \\ 1, & \text{if $n=k$} \\ p(n-1,k)+p(n-1,k-1), & \text{otherwise} \end{cases}$$ However, there a closed function exists for equivalent computing: $$b(n,k) = \frac{n!}{k!(n-k)!}$$
Question:
1)I'm interested in a step-by-step transformation for $p(n,k)$ from recursive-form to a closed analog with a detailed explanation.
My short comment: It may be difficult, since this function is not primitive recursive function, but is there a general algorithm exists?