Counting steps!

If you count the ways of climbing 3 steps you will find that there are 4 ways of climbing 3 steps.Imagine that the person's legs are so long that they have capacity of climbing 11 steps at a time.Also the person is allowed only to climb upwards.

Then find the number of ways in which you can climb 11 steps?

Bonus : Generalize this for n n steps.


The answer is 1024.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

4 solutions

Nihar Mahajan
May 12, 2015

A person has to climb the n t h n^{th} step compulsory.But the person on first n 1 n-1 steps steps on it or does not step on it.Hence there are 2 possibilities for every step of the n 1 n-1 steps.

So by product rule, total ways = 2 n 1 = 2^{n-1} .

Here n = 11 n=11 , hence total ways = 2 11 1 = 2 10 = 1024 =2^{11-1}=2^{10}=\boxed{1024}

Nice and easy solution! Should be obvious, and yet, I couldn't think of that...

In case someone didn't fully understand: for each step on the stairs, either you step on it or you don't (2 possibilites). Except for the last step (since you want to get there, you don't have the choice not to step on it).

Rafael Perrella - 6 years ago

I don't understand, why use 2?

Nur Dalila - 2 years, 5 months ago

Because there are two possibilities for each step: you either step on it or you don't i.e. do/don't, 2 options for each step except for the last one which, as the original poster stated, must be stepped on. Hope this helped :D

Daniel Schuster - 2 years, 4 months ago

why can't we use 2^n - 1?

Dibyojyoti Bhattacharjee - 8 months, 1 week ago
Rafael Perrella
May 25, 2015

Another way of solving this is recursively. Let's call W ( x ) W(x) the number of ways of climbing x x steps. There is only one way of climbing zero steps and one way of climbing one step. So, W ( 0 ) = W ( 1 ) = 1 W(0)=W(1)=1 .

Now, notice that if want to climb x x steps, we can:

1) Move 1 step up. We now have to climb ( x 1 ) (x-1) steps. The number of ways is W ( x 1 ) W(x-1) .

2) Move 2 steps up. We now have to climb ( x 2 ) (x-2) steps. The number of ways is W ( x 2 ) W(x-2) .

...

x) Move x steps up, and we now have no steps left to climb. The number of ways is W ( 0 ) = 1 W(0)=1

So, for x x steps ( 2 < = x ) 2<=x) , we have:

W ( x ) = W ( x 1 ) + W ( x 2 ) + . . . + W ( 0 ) W(x) = \color{#EC7300}{W(x-1)+W(x-2)+...+W(0)}

W ( x ) = k = 0 x 1 W ( k ) W(x) = \color{#EC7300}{\sum_{k=0}^{x-1}W(k)}

Let's try to get rid of the sum:

W ( x ) = W ( x 1 ) + k = 0 x 2 W ( k ) W(x) = W(x-1) + \color{#D61F06}{\sum_{k=0}^{x-2}W(k)}

W ( x ) = W ( x 1 ) + W ( x 1 ) W(x) = W(x-1) + \color{#D61F06}{W(x-1)}

W ( x ) = 2 W ( x 1 ) W(x) = 2*W(x-1)

Notice we keep multiplying by 2 until we get to W ( 1 ) = 1 W(1)=1 . So, we multiply ( x 1 ) (x-1) times.

W ( x ) = 2 x 1 W(x) = 2^{x-1}

W ( 11 ) = 2 10 = 1024 W(11) = 2^{10} = \boxed{1024}

May I know how you transform the sum in red into W( x - 1)??

JJ Chai - 5 years, 2 months ago

Log in to reply

It's an application of the orange formula (which is justified in the text above it), but this time summing up to W ( x 2 ) \color{#D61F06}{W(x-2)} instead of W ( x 1 ) \color{#EC7300}{W(x-1)} .

Simon Tyler - 5 years, 1 month ago
Mehul Arora
May 12, 2015

Well, Nihar gave you the formula, But I would like to Explain How it works.

Here, There are 11 steps.

Now, Stepping on any of the first 10 steps is not compulsory, But it is compulsory for the 11th Step, Because it is where we have to climb to.So, There are 2 choices for the first 10 steps, But only 1 for the 11th.

Hence, By the rule of product, The number of ways to climb to the 11th Stair are:-

2 2 2 2 2 2 2 2 2 2 1 = 2 10 = 1024. 2*2*2*2*2*2*2*2*2*2*1={2}^{10}=1024.

Generalization:- For n s t e p s n \ steps Number of ways to climb to the n t h s t e p a r e 2 n 1 nth \ step\ are\ {2}^{n-1}

Challenge student note: There is no point in posting the same solution as a separate solution . If you want to "Explain How the solution works" you could have just added it as a comment to my solution.Thanks!

Nihar Mahajan - 6 years, 1 month ago

Log in to reply

He gave a better solution than you idiot!

Arpit Kharbanda - 3 years, 8 months ago
Harshit Joshi
May 11, 2018

Well there is another way to think about this problem. Since for climbing 11 11 steps he has to choose 10 10 steps. He can therefore choose 0 or 1 or 2 or 3 .... and so so on till 10 or (n-1). So the sum is ( n 1 0 ) {n-1\choose 0} + ( n 1 1 ) {n-1\choose 1} + ( n 1 2 ) {n-1\choose 2} ... ( n 1 n 1 ) {n-1\choose n-1} . This sums up to 2 n 1 2^{n-1} . This is a much more difficult solution though.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...