I know that certain combinatorics problems (I will provide example at the end of the post) can be solved by figuring out recursive formula. However I seem to fail everytime I try to do that. Could anybody of you show me how is it done generally?
Example: How many sequences of length n, consisting of 1 and 0, which don´t contain string "000" are there? Formula: f(n+1)=f(n)+f(n-1)+f(n-2)
How was it derived?
You can do this by cases. For the rest of this post I will call a string "000" a triplet. Such sequences $S$ of length $(n+1)$ split into 3 categories:
Putting this all together gives you the result.
This kind of method generally works when you just have a sum: look at how many terms you have, and try to divide in as many cases, then make every case equivalent to one of a previous step in the recursion.