English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

A man can go up the stairs one at a time, two at a time, three at a time, or any combination of ones, twos or threes. In how many ways can the man go up the stairs? And yes, order matters.

2006-07-09 14:43:48 · 4 answers · asked by Scott R 6 in Science & Mathematics Mathematics

boy you're never going to get 10 points SPLATT with that attitude...

2006-07-09 15:31:55 · update #1

boy i thought someone would try this one.....

2006-07-09 15:51:03 · update #2

check your program Michael M

2006-07-09 16:00:49 · update #3

somethings amiss with your analysis michael.. the number of ways should always increase with the number of steps. 1 way for 19 steps?

2006-07-09 16:45:31 · update #4

Michael M your algorithm is missing some I think.....

2006-07-09 17:51:57 · update #5

4 answers

Define N_k as the number of ways this gentleman can climb k stairs.

N_1 = 1 (1)
N_2 = 2 (11,2)
N_3 = 4 (111,12,21,3)

For a staircase with more than 3 steps, if the first step is 1,2 or 3, the total number of ways of climbing the remaining stairs is N_(k-1), N_(k-2), and N_(k-3) respectively. That is:

N_k = N_(k-1) + N_(k-2) + N_(k-3)

So starting with 1,2,4 and adding the last three numbers to get each succeeding number:

1 (N_1)
2
4
7
13
24
44
81
149
274
504
927
1705
3136
5768
10609
19513
35890
66012 (N_19)

--> The answer appears to be 66012 if I haven't made any mistakes. It's probably possible to come up with a formula to solve the recusion relation but it isn't necessary in this case.

2006-07-10 08:28:01 · answer #1 · answered by shimrod 4 · 5 0

According to the computer program I just wrote, there are 65494 ways.

19 foot moves = 1 way
18 foot moves = 18 ways
17 foot moves = 153 ways
16 foot moves = 800 ways
15 foot moves = 2835 ways
14 foot moves = 7098 ways
13 foot moves = 12727 ways
12 foot moves = 16236 ways
11 foot moves = 14355 ways
10 foot moves = 8224 ways
9 foot moves =2515 ways
8 foot moves = 504 ways
7 foot moves = 28 ways
6 - 1 foot moves = 0 ways

Total = 65494

2006-07-09 22:52:23 · answer #2 · answered by Michael M 6 · 0 0

Work in reverse.

If he had to go up 1 step, there would be one way (1)

If he had to go up 2 steps, there would be two ways (2, 11)

If he had to go up 3 steps, there woud be four ways (3, 21, 12, 111).

Now finish the problem yourself.

2006-07-09 22:27:08 · answer #3 · answered by SPLATT 7 · 0 0

Only 1 way, up! Derrrrrr!

2006-07-10 00:31:53 · answer #4 · answered by ? 3 · 0 0

fedest.com, questions and answers