For each positive integer $n$, let $a_n$ be the number of binary sequences of length $n$ which do not contain the subsequence $011$. Construct a recurrence relation for $a_n$.
My attempt:
Initial conditions: $a_1 = 2, a_1 = 4, a_3 = 7$
Recurrence relation: For $n \ge 4$, $a_n = a_1 * a_{n-1} - a_{n-3}$
My reasoning is that $a_1$ and $a_{n-1}$ themselves do not contain $011$, so the only way $011$ could occur is if $a_1$ starts with $0$ and $a_{n-1}$ starts with $11$. So I subtract $a_{n-3}$ to avoid counting those subsequences that start with $011$. Is this valid?
Thanks in advance.
Your reasoning is correct, but the language in which you couch it is not. You write:
You’re speaking of $a_1$ and $a_{n-1}$ as if they were binary sequences, when in fact they are non-negative integers: $a_k$ is the number of binary sequences of length $k$ that do not contain $011$. Here’s one way to express the same idea correctly.