Stair-up problems

Source: Internet
Author: User

When someone goes up the stairs, one step can take 1, 2, or 3 steps. There are 10 steps in total. How many different steps are there from the ground to the top?
This question cannot be determined due to the poor arrangement and combination. I provide a method for your reference: You may wish to set up n-level steps, since only one or two or three steps can be taken at a time, assume that only the last step is required. There are three situations: one step is required and (n-1) is used) order, Walk Method and take n-1 order the same, there are f (n-1) Order walk; two only need to take two steps, the above analysis has F (n-2); three only need to take three steps, F (n-3); so take the N step f (n) = f (n-1) + f (n-2) + f (n-3) walking method; obviously, there is one way to take the level 1 step; there are two ways to take the level 2; there are four ways to take the level 3, as shown below: 1 1 1 1 2 1 3; so I listed the corresponding tables of the total number of steps and steps: 1 2 3 4 5 6 7 8 9 101 2 4 7 13 24 44 81 149 274 so there are 274 steps, isn't it incredible?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.