Find a recurrence relation with initial conditions.

61 Views Asked by At

In class we were given these two examples, with the following solutions.

Example $1$: Let $f(n)$ be the number of length $n$ letters words not containing the word "dog". Find a recurrence relation for $f(n)$.

Solution: $f(n) = 26f(n - 1) - f(n - 3)$

Example $2$: Let $g(n)$ be the number of bit strings of length n that do not contain “$000$”. Find a recurrence relation for $g(n)$.

Solution: $g(n) = g(n - 1) + g(n - 2) + g(n - 3)$.

So I understand the solution for both examples, but I am wondering if for example $1$, if $25f(n - 1) + 25f(n - 2) + 25f(n - 3)$ could also be a solution, and if for example $2$, if $2g(n - 1) - g(n - 3)$ could also be a solution, and if not then why?