Algorithm: questions related to dynamic programming

1012

for example, one step at a time, a total of 10 steps, this is one of the ways.
for example, take two steps at a time for a total of five steps, which is another way to go.

but it"s too troublesome to do this one by one. We can just think about the last step, as shown in the following figure

.

so the way to the tenth staircase = to the eighth staircase + to the ninth staircase
We use f (n) to express the way to the nth staircase, so we have f (10) = f (9) + f (8)

.

my question is, how can you tell at a glance that there is no same term between X and Y? Is it certain that X and Y do not have the same way of walking? Please give me some advice. My train of thought is stuck here

Jul.06,2021

x y is the set of all walks at levels 9 and 8, respectively, which are different, of course.
for another example of analogy, let x be a set of natural numbers with a sum of 9 and y a set of natural numbers with a sum of 8, then it is obvious that every term in x cannot be the same as any one in y. The method of counter-proof can be proved simply.
can you understand this analogy?

Menu