recurrence relation of a language

172 Views Asked by At

I am looking at the following:

automaton

Consider a language $X$ which consists of all bitstrings with no more than 2 consecutive zeros (represented by the above automaton). Next consider a sequence $s_n$ which is the number of words in $X$ with length $n$. How do I come up with a recurrence relation which defines the sequence $s_n$?

1

There are 1 best solutions below

13
On BEST ANSWER

A word in $X$ of length $n\ge3$ ends in a one followed by $0\le k\le2$ zeros, and what comes before the one is a word in $X$ of length $n-k-1$; so $s_n=s_{n-1}+s_{n-2}+s_{n-3}$.