To reach step , you must come from step (taking 1 step) or step (taking 2 steps). So .
This is the Fibonacci recurrence. Base cases: , . The sum rule applies because reaching from and from are mutually exclusive paths.
Recursive structure
To reach step , you must come from step (taking 1 step) or step (taking 2 steps). So .
This is the Fibonacci recurrence. Base cases: , . The sum rule applies because reaching from and from are mutually exclusive paths.