0
$\begingroup$

How many strings of length $n$ from symbols $\{0, 1\}$ do not contain the substring $101$?

Please, give me a hint.

$\endgroup$
1
  • $\begingroup$ Welcome to MSE. Please add some context (where this problem comes from, the tools you have at your disposal, your attempts, for instance) in order to improve your question. $\endgroup$ Commented Nov 5, 2017 at 19:44

1 Answer 1

3
$\begingroup$

This is a finite automaton accepting the strings of such language:

enter image description here

with the following transition matrix: $$ M = \begin{pmatrix}1 & 1 & 0 \\ 0 & 1 & 1 \\ 1 & 0 & 0\end{pmatrix} $$ having characteristic polynomial $x^3-2x^2+x-1$. By denoting the number of strings with length $n$ of such language as $L_n$, the Cayley-Hamilton theorem ensures that the characteristic polynomial of $\{L_n\}_{n\geq 0}$ is the same as the characteristic polynomial of $M$, hence

$$ L_{n+3} = 2 L_{n+2} - L_{n+1} + L_n,\quad L_0=1,L_1=2,L_2=4 $$

$$ L_n = A \alpha^n + B \beta^n + C \gamma^n $$ where $\alpha\approx 1.75$ is the only real root of $x^3-2x^2+x-1$ and $\beta,\gamma$ are the complex roots (having modulus $\approx 0.75$). The constants $A,B,C$ can be found by interpolation and the generating function of $L_n$ is given by

$$ \text{GF}(z) = \sum_{n\geq 0}L_n z^n = \frac{1+z^2}{1-2 z+z^2-z^3} $$ and for large values of $n$ we have $$ L_n \approx 1.26724 \cdot 1.75488^n. $$

$\endgroup$
1
  • $\begingroup$ This is nice answer. I never saw something like this. $\endgroup$ Commented Nov 5, 2017 at 20:49

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.