Suppose Jim climbs stairs in a parking garage for exercise H
Suppose Jim climbs stairs in a parking garage for exercise. He will sometimes take two steps at a time. Let cn be the number of ways that Jim can climb n steps.
a) Give a recurrence relation for cn. Be sure to include the initial conditions.
b) Use this recurrence relation to calculate in how many ways Jim can climb a flight of 12 steps.
This needs to be related to tecurrence relations for example cn = cn
Solution
(a)
If Jim attained (n-1)th stair then he has only one way to attain the nth stair, by stepping one up. So he has here
1*C(n-1) ways
If Jim attained (n-2)th stair then he has two ways to get to the nth stair, one big step or two small ones. But the two small ones first leads to the (n-1)th stair which we counted already. So we need only to count the one big step case. Thus there are 1*C(n-2) ways
thus the function could be written as :
Cn = C(n-1) + C(n-2).
(b)
Jim can only attain step 0 in c(0)=1 way
and step 1 in c(1)=1 way
therefore
C(12) = 233
therefore total number of ways JIm could . climb are = 233 ways
