title: Understanding a recursive method for finding binomial coefficient
body: <p>While trying to solve an assignment for finding the coefficient of a binomial using a recursive method, I came up with this:</p>
  
  <pre><code>public class Binomial
  {
     public static long binom(int n, int k)
     {
         if (k==n || k==0)
           return 1;
         else return binom(n-1,k-1) + binom(n-1, k);
    }
  </code></pre>
  
  <p>For <code>n=5; k=3</code> the method returns a value of 10. Tried it with a bunch of different values for k and n, they all gave the expected results, therefore the code works, I just have no idea why and how. I'd be very grateful for a dumbed-down explanation. Thanks!</p>