All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Stairway Ascension Ascertainment (Posted on 2023-03-07) Difficulty: 3 of 5
A stairway consists of 100 steps which can be ascended by one step at a time, two steps, three steps or, by four steps.

Determine the total number of ways to ascend the staircase.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Iterative approach | Comment 2 of 6 |
Let f(n) be the number of ways of ascending to the nth step.

f(1) = 1

The 2nd step can be reached directly, or by taking a one more step from the first step, so F(2) = f(1) + 1 = 2

The 3rd step can be reached directly, or by taking a double step from the first step, or by taking a single step from the 2nd step, so F(3) = f(1) + f(2) + 1 = 4

The 4th step can be reached directly, or by taking a triple step from the first step, or by taking a double step from the 2nd step, or by taking a single step from the 3rd step, so F(3) = f(1) + f(2) + f(3) + 1 = 8

After that, f(n) = f(n-1) + f(n-2) + f(n-3) + f(n-4)

It is very fibonnacci-like, and should be easy to compute with a spreadsheet or a computer program.



  Posted by Steve Herman on 2023-03-07 08:55:27
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (6)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information