Initial conditions for recurrence relation

Click For Summary
The recurrence relation for counting the ways to climb n stairs is given by a_n = a_{n-1} + a_{n-2} + a_{n-3}. The initial conditions proposed are a_0 = 1, a_1 = 1, and a_2 = 3, though there is confusion regarding a_2, which is argued to be 2 based on different interpretations of "ways." Clarification is sought on whether the order of steps matters, as this affects the calculation of a_2 and subsequent values. The discussion emphasizes that initial values can be chosen for convenience, but consistency with the recurrence relation is crucial for accurate results.
Mr Davis 97
Messages
1,461
Reaction score
44

Homework Statement


If ##a_n## counts the number of ways to climb a flight of n stairs if one can take 1, 2, or 3 steps at a time, then ##a_n = a_{n-1} + a_{n-2} + a_{n-3}##. What are the three initial conditions?

Homework Equations

The Attempt at a Solution


I would say that ##a_0 = 1## since there is one way to do nothing (and that is to do nothing), ##a_1=1##, since there is one way to take one step, and ##a_2 = 2##, since I could either take 1 step twice, or take two steps once. However, apparently it is correct that ##a_2=3##. Where am I going wrong?
 
Physics news on Phys.org
More information is needed about what a 'way' is. Is every stride in a trip required to encompass the same number of steps, or can one go 3,1,2,1,3 for instance? If the latter is true then a 'way' is a possibly empty sequence of elements from the set {1,2,3}, that adds to n, with the usual convention that an empty sequence adds to zero. If the former then we add the requirement that all elements in the sequence are equal.

Nevertheless, under either approach , it should be the case that ##a_2=2##. Most likely the source contains an error.
 
Last edited:
  • Like
Likes Mr Davis 97
Seems to me that:

You cannot include 0 steps - after all you could take that number of steps any number of times*;

I cannot see that a anything could be 3. Well you could have a3 =3 if you say that the order of the steps doesn't matter. In that case the problem is identical with finding the number of ways you can get an by additions of 1's, 2's and 3's, order not mattering. But if that is the rule, then you don't get your recurrence relation whereas you do if order matters. To see this it suffices to look at a1,a2, a3, a4 in both cases.

* You just don't need to worry about this being "true" or not at all! Because it is always valid for this kind of problem to take whatever a's are convenient as initial values. I expect you know that this problem has a general solution.
 

Similar threads

Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
9
Views
3K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 2 ·
Replies
2
Views
5K
  • · Replies 1 ·
Replies
1
Views
1K