sassyunicorngir
01.08.2019 •
Computers and Technology
Hi i need with this problem ( it is a java coding problem)
give me the answer and the code to this problem
alex runs up a staircase with n steps, and can hop either 1, 2, or 3 steps at a time. count how many possible ways the child can run up the stairs.
Solved
Show answers
More tips
- H Health and Medicine Novomin: What is it and how to use it?...
- P Philosophy Unbelievable stories of encounters with otherworldly forces...
- L Leisure and Entertainment How to Choose the Perfect Gift for Men on February 23rd?...
- H Health and Medicine How to Treat Whooping Cough in Children?...
- H Health and Medicine Simple Ways to Lower Cholesterol in the Blood: Tips and Tricks...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
- L Leisure and Entertainment History of International Women s Day: When Did the Celebration of March 8th Begin?...
- S Style and Beauty Intimate Haircut: The Reasons, Popularity, and Risks...
- A Art and Culture When Will Eurovision 2011 Take Place?...
- S Style and Beauty How to Choose the Perfect Hair Straightener?...
Answers on questions: Computers and Technology
- S Social Studies is the use of splitting a sentence, shock probation or parole, shock incarceration, community service, intensive supervision, or home confinement in lieu of other,...
- E English Only Daughter by Sandra Cisneros • In 1-2 sentences, answer the question: Are Cisneros family expectations similar or different than your family s expectations? • If...
- M Mathematics Pls help I’ve been getting bots all day! I really need help and I will give brainliest!...
- M Mathematics Write an expression that represents the perimeter of triangle. Combine like terms. 3.x 3x 15 Perimeter of triangle: If the perimeter of the triangle is 90, what is...
- M Medicine One of the core symptoms of post-traumatic stress disorder (ptsd) is intrusive memory: disturbing, unwanted memories of the traumatic event keep coming back, either...
Ответ:
Say child has to take n steps.
At every step the child has 3 options, to take 1 step, 2 step or 3 steps.
So if child take 1 step then find the number of ways to complete n-1 steps +1.
Similarly if child take 2 steps then find the number of ways to complete n-2 steps +1.
If child take 3 step then find the number of ways to complete n-3 steps +1.
So total number of ways to complete n steps = No of ways to complete (n-1)steps + No of ways to complete (n-2)steps + No of ways to complete (n-3)steps +1.
Ответ:
4
Explanation:
If we consider a typical staircase with standard design, there is the possibility to move up the staircase by taking a single step at a time. In addition, it is also possible to take two steps followed by one step. It is also possible to take one step first followed by two steps. Lastly, it is also possible to take three steps. Therefore, the possible ways (N) will be:
N = S(1,1,1) + S(2,1) + S(1,2) + S(3) = 4
Ответ:
The question above answer is D