Question

Set 5 a. A staircase has 10 steps. You walk up taking one or two at a time. How many ways can you go up? We have n dollars to
0 0
Add a comment Improve this question Transcribed image text
Answer #1

d) Let’s let Nk denote the number of ways to climb k stairs in the manner described. (So we’re looking for N10.) Notice that for k ≥ 4 there are 3 “moves” one can do for your first step: you can climb 1,2, or 3 stairs. If you climb 1 stair then there are Nk−1 ways to finish; if you climb 2 stairs there are Nk−2 ways to finish; and if you climb 3 stairs there are Nk−3 ways to finish. Thus:

Nk = Nk−1 + Nk−2 + Nk−3

Well, it’s pretty easy to see that for the k < 4 we have N1 = 1, N2 = 2 and N3 = 4, so using the above we can calculate N10 using

N_4 = N_3 + N_2 + N_1 = 4 + 2 + 1 = 7\\ N_5 = N_4 + N_3 + N_2 = 7 + 4 + 2 = 13\\ N_6 = N_5 + N_4 + N_3 = 13 + 7 + 4 = 24\\ N_7 = N_6 + N_5 + N_4 = 24 + 13 + 7 = 44\\ N_8 = N_7 + N_6 + N_5 = 44 + 24 + 13 = 81\\ N_9 = N_8 + N_7 + N_6 = 81 + 44 + 24 = 149\\ N_{10} = N_9 + N_8 + N_7 = 149 + 81 + 44 = 274

So there are 274 ways to climb the stairs.

c)  F (0) = 0, 1, 1, 2, 3, 5, 8, 13, 21, 34....................

f_n = f_{n-1}+f_{n-2}

The initial values F0=0 and F1=1 are part of the definition of the Fibonacci sequence. They can't be derived, because e.g. you could just as well pick any two numbers and apply the same recursion relation to get a different sequence. They're just the simplest numbers to start with.

b) Candy = 1

ice cream = 2

Let take n = 1 ==> 1candy = 1way

Let take n = 2 ==> 2candy or 1 icecream = 2 ways

Let take n = 3 ==> 3candy or 1candy+1icecreamz = 2ways

Let take n = 4 ==> 4 candy or 2candy+1icecream or 2icecream = 3ways

Let take n = 5 ==> 5C or 3C + 1I or 1C + 2I = 3ways

Let take n = 6 ==> 6C or 4C + 1I or 2C + 2I or 3I = 4ways

Let take n = 7 ==> 7C or 5C + 1I or 3C + 2I or C+3I = 4ways

Let take n = 8 ==> 8C or 6C + 1I or 4C + 2I or 2C + 3I +  4I = 5ways

From the above we can say that the formula is

= i n t ( n / 2 ) +1 ways

a) Let Nk be the number of ways to get up k stairs, where you can either take one or two steps at a time. Obviously N(1)=1 because when you have one stair left all you can do is walk up it.

With two stairs left to go, we can go up both stairs at once or we can go up one stair and be on stair 1. So N(2)=1+N(1)=1+1=2

Similarly as above problem

N_3=N_2+N_1=2+1=3\\ N_4=N_3+N_2=3+2=5\\ N_5=N_4+N_3=5+3=8\\ N_6=N_5+N_4=8+5=13\\ N_7=N_6+N_5=13+8=21\\ N_8=N_7+N_6=13+21 = 34\\ N_9=N_8+N_7=34+21=55\\ N_{10}=N_9+N_8=55+34=89

So there are 89 ways to climb the stairs.

If you have any doubts please reply in here i will answer.Please rate the answer.Thank you

Add a comment
Know the answer?
Add Answer to:
Set 5 a. A staircase has 10 steps. You walk up taking one or two at a time. How many ways can you...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT