I'm trying to find the number of ways to pay 8$ into a vending machine where the machine only accepts 1$, 2$ and 5$
I need to do this with recursion
I understand that you denote an = # of ways to pay N dollars
and you do the recursion by finding the number of ways to pay 8$ with respect to the first coin you drop
The thing I'm confused about is how to iterate the initial conditions.
If this example is too hard, perhaps try to answer this question..
How many strings of N-digits contain an even number of zeroes
again, I understand how to setup the recursion to solve for an, but not the initial conditions.
XI Wiki

