Sal climbs stairs by taking either one, two, or three steps at a time. Determine a recursive formula for the number of different ways Sal can climb a flight of n steps. Don't forget to include the initial conditions
wow who knows' lets try it 1 step, 1 way 2 steps, 2 ways 3 steps, 4 ways (i think)
how about 5 steps?
oh lets try 4
How did you get four ways for three steps? I got 3 one-steps, 1 two-step + 1 one-step, or 1 three-step?
for three steps i though 1 1 1 1 2 2 1 3
maybe this has something to do with partitions, i don't know the answer, just thinking out loud
Oh that's a very good point! I didn't think about switching the pattern.
4 steps 1 1 1 1 1 1 2 1 2 1 2 1 1 1 3 3 1
see what you can do, i will try in a minute, but unless this is some application of specific topic, i think experimentation is the way to go
5 steps 11111 1112 1121 1211 2111 113 131 311 Right?
If we're going with experimentation...
Oh or there's 221 to add to that taking five steps part
And for four stairs, you can also take 2 2, so so far, we have a pattern of 1, 2, 4, 7, 9
i think your five steps is missing something
1 2 2 2 1 2 1 2 2 2 3 3 2
So far I have: 11111 1112 1121 1211 2111 113 131 311 221 122
So 12 for taking five steps?
1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 2 1 1 1 1 1 3 1 3 1 3 1 1 2 3 3 2
oh right i missed a couple also 2 2 1 2 1 2 1 2 2
So now our pattern so far is 1, 2, 4, 7, 12...
lets see what we have so far 1 gives 1 2 gives 2 3 gives 4 4 gives 7 5 gives 13
Can you write out what pattern you got for 5? I only have 12 for some reason...must be forgetting one?
1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 2 1 1 1 1 2 2 2 1 2 2 2 1 1 1 3 1 3 1 3 1 1 3 2 2 3
let's say there are x 3-step-at-a-time, y 2-step-at-time, and z one-step.
yes it is time to cut to the chase, i am sure there is a snappier way to do this
we can permute the 3-step, 2-step, and 1-step into (x+y+z)!/z!y!z!) ways
oh and also we are looking for a recursion , not a direct formula in terms of \(n\) although that might be helpful
oh, yeah. i forgot that part. i was into counting the ways.
Yes...the requirement is that we find a recursive formula for the number of different ways Sal can climb a flight of n steps.
Do we need an initial condition?
in other words, when we add one more step, can we figure out how many more ways we need
So you want to figure out how many ways for six stairs?
maybe it is just \(a_n=2a_{n-1}-1\) wouldn't that be easy ?
i got 13 for 5 steps lets see if we get 25 for 6 steps
Ha that would be crazy if the definition would be that easy :)
Let's see...for six steps I get: 111111 11112 11121 11211 12111 21111 1122 1221 2211 1212 2121 33 1113 1131 1311 3111
Is this right?
I think that sirm3D had a good idea by assigning the values to one-step, two-step, and three-step
missing 1 2 3 1 3 2 2 1 3 2 3 1 3 1 2 3 2 1
Oh good catch! So we're at 22 now
i think this may be a very hard problem without a gimmick maybe we can see what happens to the list when you add 1
consider n = 6: (111111) = 1, (11112) = 5, (1122) = 6, (1113) = 4, (123) = 6, (222) = 1, (33)=1. Total of 24 possible ways
also missing 2 2 2
i did not. there's (222)
sorry i meant earlier
sirm3d what are your six ways of using 1122?
I got 1122 1221 2211 1212 2121 Which one am I missing?
think of it as \(\dbinom{4}{2}=6\)
missing 2 1 1 2
4!/(2!2!)
so much for my \(2a_{n-1}-1\) theory
Oh yeah..that's a very good point. Well the theory you had, satellite73 was definitely an easier one than I think we're faced with right now :/
maybe one more n = 7 (1111111) =1 (111112) = 7 (11122) = 10 (1 2 2 2) = 4 (1 1 1 1 3) =5 (2 2 3) = 3 (1 1 2 3) = 8 i have no damned idea
(111112) = 6 only.
I think rather than trying to do this out by brute force, we should look at the pattern and see if a formula can't be found...?
i found it. ^^
\[\large a_1=1,\quad a_2=2, \quad a_3=4\]
Oh good! So those are your conditions..
@rachelk09 @satellite73 \[\large a_n=a_{n-1}+a_{n-2}+a_{n-3}, \quad n=4,5,6,...\]
Let's try using that to see if it works for the six that we did out long hand...looks right to me...
The first one was 1 + 2 + 4, which does equal seven. Atempting the next set now. I think you got it!!
n=1: 1 n=2: (11) = 1, (2) = 1 n=3: (111)=1, (12)=2, (3) = 1 n=4: (1111)=1, (112)=3, (13)=2, (22)=1 n=5: (11111)=1, (1112)=4, (122)=3, (113)=3, (23)=2 n=6: (111111)=1, (11112)=5, (1122)=6, (1113)=4, (123)=6, (222)=1, (33)=1 n=7: (1111111)=1, (111112)=6, (11122)=10, (1222)=4, (11113)=5, (1123)=12, (133)=3, (223)=3
Everything checks out. You did it! Thanks so so much!
YW. ^^
Join our real-time social learning platform and learn together with your friends!