Today while doing this topic our professor gave an example with tiles.
The example: There are 2 kinds of tiles, A= 1 x 1 and B= 2 x 1. In how many ways can you arrange tiles in a line n units long?
There are two cases. Case 1: the last tile is 1 x 1 so the preceding tiles are an arrangement of n-1 units. Case 2: the last tile is 2 x 1 so the preceding arrangement is of n-2 tiles. Let's call the number of arrangements of type one $w_{n-1}$ and the number of arrangements of type two $w_{n-2}$. Then we have a recurrence relation $w_{n}$= $w_{n-1}$ + $w_{n-2}$.
I really have no idea what's going on here, if anybody could explain I would be grateful.
Suppose your tiles form a line of length $n$.
If the last tile is of form of $A$, then we are concatenating previous line of length $n-1$ with $A$. Hence, we just have to care about number of ways to form a line of length $n-1$ using those tiles, which is $w_{n-1}$.
If the last tile is of form of $B$, then we are concatenating previous line of length $n-2$ with $B$. Hence, we just have to care about number of ways to form a line of length $n-2$ using those tiles, which is $w_{n-2}$.
Hence $$w_n = w_{n-1} + w_{n-2}$$