# in how many ways?

• May 6th 2009, 04:41 AM
i live on the first floor of my building. everyday we come back after a walk me and my dog need to climb 7 stairs. forget about me, how many ways can my dog climb them if he climbs 1-2 stairs in one step.

(Wondering)

eg. he may either climb the 7 stairs by climbing 2, then 2, then 2, then 1, or 1, then 2, then 2, then 2, or he may climb then as 2,2,1,1,1........in total, how may possible ways? thats all i mean.
• May 6th 2009, 11:07 PM
scouser
There are two outcomes to each event: the solution is 2^7. there. figure that out, i dont have my calculator on me.
• May 7th 2009, 04:57 AM
mr fantastic
Quote:

Originally Posted by scouser
There are two outcomes to each event: the solution is 2^7. there. figure that out, i dont have my calculator on me.

This is not correct (and you need a calculator? 2^7 = 2^3 x 2^3 x 2 = 8 x 8 x 2 = 64 x 2 = 128)

The possible combinations are:

(2, 2, 2, 1)

(2, 2, 1, 1, 1)

(2, 1, 1, 1, 1, 1)

(1, 1, 1, 1, 1, 1, 1)

You have to calculate the number of distinct arrangements of each combination and add them together:

$\displaystyle \frac{4!}{3!} + \frac{5!}{2! 3!} + \frac{6!}{5!} + 1 = ....$
• May 7th 2009, 07:49 AM
pankaj
Let $\displaystyle f(n)$ denote the number of ways to climb $\displaystyle n$ stairs.

Therefore, $\displaystyle f(n-2)+f(n-1)=f(n)$

Now $\displaystyle f(1)=1$
$\displaystyle f(2)=2$
$\displaystyle f(3)=f(1)+f(2)=3$
$\displaystyle f(4)=f(3)+f(2)=5$
................... and so on
$\displaystyle f(7)=8+13=21$

Therefore number of ways tho dog can climb $\displaystyle 7$ stairs in $\displaystyle 21$ ways.
• May 7th 2009, 08:19 AM
Quote:

Originally Posted by pankaj
Let $\displaystyle f(n)$ denote the number of ways to climb $\displaystyle n$ stairs.

Therefore, $\displaystyle f(n-2)+f(n-1)=f(n)$

Now $\displaystyle f(1)=1$
$\displaystyle f(2)=2$
$\displaystyle f(3)=f(1)+f(2)=3$
$\displaystyle f(4)=f(3)+f(2)=5$
................... and so on
$\displaystyle f(7)=8+13=21$

Therefore number of ways tho dog can climb $\displaystyle 7$ stairs in $\displaystyle 21$ ways.

hey! thanks. but yeh neeche likhi wali equation kaise ayi?

f(n-2)+f(n-1)=f(n)
• May 7th 2009, 09:11 AM
pankaj
There are two ways in which one can reach the $\displaystyle n-th$ stair(to be done in $\displaystyle f(n)$ ways).

One way is that one reaches the $\displaystyle (n-2)th$ stair which can be done in $\displaystyle f(n-2)$ ways and then reach the $\displaystyle n-th$ stair by climbing $\displaystyle 2$ steps in one go.

Second way is that one reaches the $\displaystyle (n-1)th$ stair which can be done in $\displaystyle f(n-1)$ ways and then reach the $\displaystyle n-th$ stair by climbing the remaining $\displaystyle 1$ stair.

Therefore,$\displaystyle f(n)=f(n-1)+f(n-2)$