2

The problem about a frog climbing a stair of size N, in steps of size 1 or 2, can be formulated as Fibonacci; and if it can jump in steps of size $1,2,...k$ there must be $k$ recursive calls.

I want to know if its possible to solve this problem using combinations with repetition instead of using recursion?

Im trying to use combinations with repetition formula to give number of positive integer solutions to the restricted equation representing the problem (for example k=3 and N=4, the equation $a+b+c+d = 4$ with $1 \le a,b,c,d \le k$ ) and after that subtracting the impossible solutions (i.e. solutions wich contain value of zero for one or more variables), but I'm having trouble restricting the equation and counting the impossible solutions.

Wonder if Im walking in the right direction here?

bermick
  • 21
  • See this question; my answer to it gives a general formula, though not an especially nice one. – Brian M. Scott Nov 26 '15 at 02:03
  • thanks for your answer Brian. It only states the way to restrict the equation but doesnt explains how to count the solutions with zeros (not at the end) in order to subtract them from the previous result, can you give me a clue here? – bermick Nov 26 '15 at 21:40
  • The formula there counts only the solutions with no zeroes. – Brian M. Scott Nov 26 '15 at 21:41
  • Thanks Brian, but I think they are different questions, here the position matters since steps can value zero but only at the final places of the sequence, in the other question any container could be zero – bermick Nov 27 '15 at 13:36
  • No container can be zero; each container must be $1$ or $2$, corresponding to a step size of $1$ or $2$. – Brian M. Scott Nov 27 '15 at 13:39
  • thanks Brian obviously Im a noob, could you please help me, Im doing an example with N=4 and k=3, (the solution is 7 different ways of climbing the stair) but I cant conclude it from your generalization – bermick Nov 27 '15 at 18:27

0 Answers0