title: A way to determine Recurrence Equations? (General Approach)
body: <p>I am in the first stages of learning recursion for my a data structures class, and our professor has told us that we should be able to take a recursive method and be able to come up with problem size along with recurrence equations. I am able to write a recurrence equation when the problem size depends on one variable N that is assumed to be positive for simplicity such as:This method simply prints the input number as long as n > 0 at the first call. </p>
  
  <pre><code>public static int simpleCounter(int N) {
      if (n == 0) {
          return;
      }
      else {
          return 1 + simpleCounter(N - 1);
      }
   }
  </code></pre>
  
  <p>However when the problem size is more complicated, such as depending on 2 variables I am not able to create recurrence equations because I don't know what to do with variables. This method counts how many times 2 numbers can be subtracted from each other, assume count is always zero for the first call and a and b are both positive.</p>
  
  <pre><code>public static int complexCount(int a, int b, int count) {
      if ((a - b) &lt;= 0) { 
          return 0; 
      }
      else {
        count = 1 + complexCount((a - b), b, count + 1)
        return count;
       }
   }
  </code></pre>
  
  <p>So what is the problem size here? Doesn't it have to do with both a and b?
  And without knowing problem size I can't come up with recurrence equations:
  Base: T(0) = 1 
  Recurrence: T(N) = 1 + ??</p>