Initial conditions for recurrence relation

Click For Summary
SUMMARY

The recurrence relation for counting the number of ways to climb a flight of n stairs, defined as ##a_n = a_{n-1} + a_{n-2} + a_{n-3}##, requires three initial conditions. The correct initial conditions are ##a_0 = 1##, ##a_1 = 1##, and ##a_2 = 3##. The confusion arises from the interpretation of "ways," where each sequence can include combinations of 1, 2, or 3 steps in any order. This interpretation confirms that the order of steps matters, leading to the conclusion that ##a_2## must equal 3.

PREREQUISITES
  • Understanding of recurrence relations
  • Basic combinatorial principles
  • Familiarity with sequences and series
  • Knowledge of mathematical induction
NEXT STEPS
  • Study the derivation of the Fibonacci sequence as a related recurrence relation
  • Explore combinatorial proofs for counting problems
  • Learn about dynamic programming techniques for solving recurrence relations
  • Investigate variations of the staircase problem with different step sizes
USEFUL FOR

Mathematics students, computer science majors, and anyone interested in combinatorial mathematics or algorithm design.

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   Reactions: 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
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
Replies
9
Views
3K
  • · Replies 19 ·
Replies
19
Views
4K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 1 ·
Replies
1
Views
1K