2 Nondeterminism and overlap-free words
In this chapter we develop some properties of nondeterministic automatic complexity. As a corollary we get a strengthening of a result of Shallit and Wang [ 19 ] on the complexity of the infinite Thue–Morse word \(\mathbf t\). Moreover, viewed through an NFA lens we can, in a sense, characterize the complexity of \(\mathbf t\) exactly. A main technical idea is to extend the following result, which says that not only do squares, cubes and higher powers of a word have low complexity, but a word completely free of such powers must conversely have high complexity.
Suppose \(w\in \Sigma ^*\) is \(k\)th-power-free for some integer \(k\ge 2\), i.e., \(w\) contains no subword of the form \(x^k\) with \(x\ne \varepsilon \). Then \(A(w)\ge \frac{\lvert w\rvert +1}k\).
The way we strengthen their results is by considering a variation on squarefreeness and cube-freeness, overlap-freeness. This notion also goes by the names of irreducibility and strong cube-freeness in the combinatorial literature. We also take up an idea from [ 19 , Theorem 8 ] and use it to show that the natural decision problem associated with nondeterministic automatic complexity is in the complexity class E = DTIME(\(2^{O(n)}\)). This result is a theoretical complement to the practical fact that the nondeterministic automatic complexity can be computed reasonably quickly, a fact that enabled the creation of the lookup service at [ 10 ] .
2.1 Introduction
The nondeterministic automatic complexity \(A_N(x)\) of a string \(x\) of length \(n\) satisfies
Let \(n=2m+1\) be odd and let \(K_m\) be a Kayleigh graph, Figure 2.1. For a proof by induction it is convenient to label the states in the opposite order of the usual:
Then we just observe that there are no walks of odd length \({\lt}n\) accepted, and there is exactly one walk of odd length \(n\) accepted, and these two observations persist inductively.
For a number perspective, let \(W_{m,k}\) be the number of accepting walks in \(K_M\) of length \(k\). We show by induction on \(m\) that \(W_{m,2m+1}=1\) and \(W_{m,2s+1}=0\) whenever \(s{\lt}m\).
If \(m=0\), the NFA \(K_m\) is simply
which accepts one word of length 1 and, of course, no word of shorter odd lengths.
For the inductive step, note that \(K_m\) is schematically:
An accepting walk of length \(2m+1\) consists of the edge labeled \(x_1\), followed by a walk of length \(2m-1\), followed by the edge labeled \(x_n\). The walk of length \(2m-1\) can stay within \(K_{m-1}\) in which case by induction there is exactly one possible walk. Or it can venture out of \(K_{m-1}\) to visit \(q_0\) a certain number \(0{\lt}t\le m-1\) of times; each such time contributes a walk of length 2. Between these times, an accepting walk in \(K_{m-1}\) must be performed.
By the induction hypothesis, these walks have lengths \(\ell _0,\dots ,\ell _t\) where if \(t{\gt}0\) and \(W_{m-1,\ell _i}{\gt}0\) then \(\ell _i\) is even. So if \(t{\gt}0\), they have lengths that must add up to an odd number
which is impossible.
If \(n{\gt}0\) is even then \(x=ya\) where \(\lvert y\rvert \) is odd; by the second subword inequality ?? ??, \(A_N(x)\le A_N(y)+1\), as desired. Finally, if \(n=0\) then the result follows from \(A_N(\varepsilon )=1\).