arXiv reader

An alternating colouring function on strings

Jonathan Garbe

arXiv
2411.00562v1 · PDF · 1 November 2024
Categories
math.CO, math.DS
Licence
CC BY 4.0 The site shows the text.

Abstract

An alternating colouring function is defined on strings over the alphabet \{0, 1\}. It divides the strings in colourable and non-colourable ones. The points in the subshift of finite type defined by forbidding all non-colourable strings of a certain length alternate between states of one colour and states of the other colour. In other words, the points in the 2nd power shifts all have the same colour. The number K_n of non-colourable strings of length n \ge 2 is shown to be 2 \cdot (J_{n-2} + 1) where J is the sequence of Jacobsthal numbers. The number of sources and sinks in the de Bruijn graph of dimension n \ge 3 with non-colourable edges removed is shown each to be K_n - 4.

Items 97

Notation

Notation Notation

Y6NK

Define – &l, r, m, R, C, T, CT&l, r : \mathcal A_{2}^{\ge 1} \to \mathcal A_{2}^*, m : \mathcal A_{2}^{\ge 2} \to \mathcal A_{2}^*, R, C : \mathcal A_{2}^* \to \mathcal A_{2}^*, T, CT : \mathbb N \to \mathcal A_{2}^*l, r, m, R, C, T, CT l, r : \mathcal A_{2}^{\ge 1} \to \mathcal A_{2}^*, m : \mathcal A_{2}^{\ge 2} \to \mathcal A_{2}^*, R, C : \mathcal A_{2}^* \to \mathcal A_{2}^*, T, CT : \mathbb N \to \mathcal A_{2}^* by

\begin{aligned} l \p w &= w_{[0, \# w - 1)} \\ r \p w &= w_{[1, \# w)} \\ m &= l \circ r \\ R \p{w_0 \dots w_{\#w-1}} &= w_{\#w-1} \dots w_0 \\ C \p{w_0 \dots w_{\#w-1}} &= C \p{w_0} \dots C \p{w_{\#w-1}} \text{, where } C \p \bm 0 = \bm 1 \land C \p \bm 1 = \bm 0 \\ T^n &= \begin{cases} \upepsilon & \text{if } n = 0 \\ T^{n-1} \bm 0 & \text{if } n \text{ odd} \\ T^{n-1} \bm 1 & \text{if } n \text{ even} > 0 \end{cases} \\ CT^n &= C \p {T^n}. \end{aligned}
Remark

Remark Remark

KID4

l \p w, r \p w are prefix and suffix with length \# w - 1 of w. m \p w is the proper infix of length \# w - 2. R \p w is the reverse of w (meaning that w is a palindrome if and only if R \p w = w) while C \p w is its complement. T^n, CT^n are the strings of length n starting with \bm 0, \bm 1 respectively and alternating between \bm 0 and \bm 1.

Example

Example Example

1LL8
\begin{aligned} l \p{\bm{0010110}} &= \bm{001011} \\ r \p{\bm{0010110}} &= \bm{010110} \\ m \p{\bm{0010110}} &= \bm{01011} \\ R \p{\bm{0010110}} &= \bm{0110100} \\ C \p{\bm{0010110}} &= \bm{1101001} \\ T^7 &= \bm{0101010} \\ CT^7 &= \bm{1010101} \end{aligned}
Observation

Observation \zarabicsection.\zarabicthrm

6J1C
\begin{aligned} l \circ r &= r \circ l \\ l \circ m = m \circ l &\land r \circ m = m \circ r \\ R \circ l = r \circ R &\land R \circ r = l \circ R \\ R \circ m &= m \circ R \\ C \circ l = l \circ C &\land C \circ r = r \circ C \\ C \circ m &= m \circ C \\ R \circ C &= C \circ R \end{aligned}
Definition

Definition Definition

6EML

– &the function \xi&\xithe function \xi \xi : \mathcal A_{2}^* \to \crl{-1, 0, 1} is defined recursively by

\begin{aligned} \xi\p w &= \begin{cases} 0 & \text{if } w = \upepsilon \\ 1 & \text{if } w \in \crl T ^ {\mathrm{even} \ge 0} \\ -1 & \text{if } w \in \crl {CT} ^ {\mathrm{even} \ge 0} \\ \operatorname{sgn} \p{\xi \p{l \p w} + \xi \p{r \p w}} & \text{else}. \end{cases} \end{aligned}
Remark

Remark Remark

Q5HX

The function \xi tells on which side of the vertical axis a vertex appears in a de Bruijn graph when drawn as is done in the examples given in this thesis. In figures ? to ? the background is coloured according to the value of \xi evaluated on the vertices. The vertices w for which \xi \p w = 0 are found in the centre. The letter \xi was chosen with the word x-axis in mind.

Observation

Observation \zarabicsection.\zarabicthrm

0SBR

Let w \in \mathcal A_{2}^{\ge 1}.

\begin{aligned} \xi \p w = 0 &\iff w \notin \crl{T}^\mathrm{even} \cup \crl{CT}^\mathrm{even} \land \xi \p{l \p w} = -\xi \p{r \p w} \end{aligned}
Corollary

Corollary \zarabicsection.\zarabicthrm

SSK2

Let w \in \mathcal A_{2}^{\ge 1} such that \xi \p{l \p w}, \xi \p{r \p w} \ne 0. Then

\begin{aligned} \xi \p w = 0 \iff \xi \p{l \p w} \ne \xi \p{r \p w} \end{aligned}
Remark

Remark Remark

WAK9

When \xi \p{l \p w}, \xi \p{r \p w} \ne 0, it is equivalent to say \xi \p{l \p w} = -\xi \p{r \p w} or \xi \p{l \p w} \ne \xi \p{r \p w}. For aesthetic reasons, the latter formulation will be preferred, also in future occasions.

Lemma

Lemma \zarabicsection.\zarabicthrm

5WKA

Let w \in \mathcal A_{2}^{\ge 1} such that \xi \p{w} \ne 0. Then

\begin{aligned} \xi \p{l \p{w}} \ne 0 &\implies \xi \p{w} = \xi \p{l \p w} \\ \xi \p{r \p{w}} \ne 0 &\implies \xi \p{w} = \xi \p{r \p w} . \end{aligned}
Lemma

Lemma \zarabicsection.\zarabicthrm

RSKJ

Let k \ge 2. Then

\begin{aligned} \xi \p{T^k \bm 0} &= \begin{cases} 0 & \text{if } k \text{ is even{{}}} \\ -1 & \text{if } k \makebox[\widthof{$ \text{ is even{{}}} {}$}][l]{$\text{ is odd{{}}}$} \end{cases} \\ \xi \p{T^k \bm 1} &= 1 \\ \xi \p{CT^k \bm 0} &= -1 \\ \xi \p{CT^k \bm 1} &= \begin{cases} 0 & \text{if } k \text{ is even{{}}} \\ 1 & \text{if } k \makebox[\widthof{$ \text{ is even{.}} {}$}][l]{$\text{ is odd{.}}$} \end{cases} \end{aligned}
Lemma

Lemma \zarabicsection.\zarabicthrm

QMQA

Let w \in \mathcal A_{2}^{\ge 1} such that \xi \p{l \p w} = \xi \p{r \p w} = 0. Then

\begin{aligned} \xi \p w = \makebox[\widthof{$-1$}][r]{$0$} &\implies w \in \crl \bm 0 ^* \cup \crl \bm 1 ^* \\ \xi \p w = \makebox[\widthof{$-1$}][r]{$1$} &\implies w \in \crl{ T}^\mathrm{even} \\ \xi \p w = -1 &\implies w \in \crl{CT}^\mathrm{even} . \end{aligned}
Remark

Remark Remark

2M3N

The argument used in this proof, considering l^3, l^2 \circ r, l \circ r^2 and r^3 of a certain string and using the fact that the functions \xi and \phi only attain three different values will be important also for the proof of lemma \zarabicsection.\zarabicthrm.

Remark

Remark Remark

GLMY

The number ? is omitted in numbering the results to keep section ? and ? having the same structure. There is nothing equivalent to say about the function \xi as is said about the function \phi in corollary \zarabicsection.\zarabicthrm.

Lemma

Lemma \zarabicsection.\zarabicthrm

W2GB

Let n \ge 2, w \in \mathcal A_{2}^n such that \xi \p{m \p w} = 0. Then

\begin{aligned} &\xi \p{l \p w} = \xi \p{r \p w} = \makebox[\widthof{$-1$}][r]{$0$} \iff w \in \crl{\bm 0^n, \bm 1^n} \\ &\xi \p{l \p w} = \xi \p{r \p w} = \makebox[\widthof{$-1$}][r]{$1$} \iff w \in \crl{ \bm 0 T^{n-1}, T^{n-1} \bm 1 } \land n \makebox[\widthof{$ \text{ is even{{}}} {}$}][l]{$\text{ is odd{{}}}$} \\ &\xi \p{l \p w} = \xi \p{r \p w} = -1 \iff w \in \crl{ CT^{n-1} \bm 0, \bm 1 CT^{n-1} } \land n \makebox[\widthof{$ \text{ is even{{}}} {}$}][l]{$\text{ is odd{{}}}$} \\ &\xi \p{l \p w} = \makebox[\widthof{$-1$}][r]{$0$} \land \xi \p{r \p w} = \makebox[\widthof{$-1$}][r]{$1$} \iff w = \bm 0^{n-1} \bm 1 \\ &\xi \p{l \p w} = \makebox[\widthof{$-1$}][r]{$0$} \land \xi \p{r \p w} = -1 \iff w = \bm 1^{n-1} \bm 0 \\ &\xi \p{l \p w} = \makebox[\widthof{$-1$}][r]{$1$} \land \xi \p{r \p w} = \makebox[\widthof{$-1$}][r]{$0$} \iff w = \bm 0 \bm 1^{n-1} \\ &\xi \p{l \p w} = -1 \land \xi \p{r \p w} = \makebox[\widthof{$-1$}][r]{$0$} \iff w = \bm 1 \bm 0^{n-1} . \end{aligned}
Remark

Remark Remark

2EO4

Already at this point, \# \crl{w \in \mathcal A_{2}^n; \xi \p w = 0} could be investigated. However, that result shall be postponed until section ?, as the relevance of that set and its size will be more obvious by then.

Theorem

Theorem \zarabicsection.\zarabicthrm

ZLGS

Let k, n \in \mathbb N and w \in \mathcal A_{2}^{k+n} be such that

w_{\hopen{0, n}} = w_{\hopen{k, k+n}} \land \exists \imath < k \quad \xi \p{w_{\hopen{\imath, \imath+n}}} = 1.

Then

\begin{aligned} \exists \jmath < k \quad \xi \p{w_{\hopen{\jmath, \jmath+n}}} = -1. \end{aligned}
Remark

Remark Remark

8Z5K

The statement also holds when switching the rolls of 1 and -1; the proof is analogous.

Using the notion of \xi as defining a left, a centre and a right part of the de Bruijn graph, theorem \zarabicsection.\zarabicthrm tells that there are no non-empty closed walks in the right part. Figure ? does not contain non-trivial closed walks in the blue (or red) highlighted area.

The proof idea is simpler than it seems: A string representing a walk in a certain de Bruijn graph also represents a walk in the de Bruijn graph one dimension lower. If a walk passes a vertex v for which \xi \p v = -1 of a graph by the construction of the \xi function it will also do so in a higher dimensional de Bruijn graph – with one notable exception: The vertex CT^n for even n. Take for example the walk \bm{0101} in the 2-dimensional de Bruijn graph. Glancing at figure ? shows that this walk passes both the area with blue and the area with red background. Now consider the same string a walk through the 3-dimensional de Bruijn graph. A look at figure ? tells that the graph does not pass the area with red background. This one exception is what makes the construction of \tilde w necessary.

Remark

Remark Remark

ALYK

Section ? has the same structure as the previous one. Each result but corollary \zarabicsection.\zarabicthrm can be compared with the result of the same number in section ?. Often the proofs are similar.

Definition

Definition Definition

SDQL

– &the function \phi&\phithe function \phi \phi : \mathcal A_{2}^* \to \crl{-1, 0, 1} is defined recursively by

\begin{aligned} \phi\p w &= \begin{cases} 0 & \text{if } w = \upepsilon \\ -1 & \text{if } w \in \crl \bm 0 ^ \mathrm{odd} \\ 1 & \text{if } w \in \crl \bm 1 ^ \mathrm{odd} \\ \operatorname{sgn} \p{\phi \p{r \p w} - \phi \p{l \p w}} & \text{else}. \end{cases} \end{aligned}
Remark

Remark Remark

CGTT

In figures ? to ? the vertices and edges are coloured according to the value \phi assigns to them.

Observation

Observation \zarabicsection.\zarabicthrm

C0AL

Let w \in \mathcal A_{2}^{\ge 1}.

\begin{aligned} \phi \p w = 0 &\iff w \notin \crl \bm 0 ^\mathrm{odd} \cup \crl \bm 1 ^\mathrm{odd} \land \phi \p{l \p w} = \phi \p{r \p w} \end{aligned}
Corollary

Corollary \zarabicsection.\zarabicthrm

RTEA

Let w \in \mathcal A_{2}^{\ge 1} such that \phi \p{l \p w}, \phi \p{r \p w} \ne 0. Then

\begin{aligned} \phi \p w = 0 \iff \phi \p{l \p w} = \phi \p{r \p w} \end{aligned}
Lemma

Lemma \zarabicsection.\zarabicthrm

YKH8

Let w \in \mathcal A_{2}^{\ge 1} such that \phi \p{w} \ne 0. Then

\begin{aligned} \phi \p{r \p{w}} \ne 0 &\implies \phi \p{w} = \phi \p{r \p w} \\ \phi \p{l \p{w}} \ne 0 &\implies \phi \p{w} \ne \phi \p{l \p w} . \end{aligned}
Lemma

Lemma \zarabicsection.\zarabicthrm

YZ7G
\forall w \in \mathcal A_{2}^{\ge 1} \quad \phi \p{l \p w} = \phi \p{r \p w} = 0 \implies w \in \crl \bm 0 ^\mathrm{odd} \cup \crl \bm 1 ^\mathrm{odd}
Lemma

Lemma \zarabicsection.\zarabicthrm

SNNB

Let w \in \mathcal A_{2}^{\ge 2} such that \phi \p{l^2 \p w} = \phi \p{r^2 \p w} \ne 0. Then

\begin{aligned} \phi \p{m \p w} \ne 0. \end{aligned}
Lemma

Lemma \zarabicsection.\zarabicthrm

XKFS

Let w \in \mathcal A_{2}^2 such that \phi \p{m \p w} = 0. Then

\begin{aligned} \phi \p w \ne 0 \iff w \in \Lambda^{\ge 2} = \bigcup_{n \ge 1} \crl{ \bm 0^n \bm 1, \bm 0 \bm 1^n, \bm 1 \bm 0^n, \bm 1^n \bm 0 }. \end{aligned}
Lemma

Lemma \zarabicsection.\zarabicthrm

V3Q6

Let w \in \mathcal A_{2}^{\ge 2} such that

\begin{aligned} \xi \p{l^2 \p w}, \xi \p{r^2 \p w} \ne 0 = \xi \p{m \p w} . \end{aligned}

Then

\begin{aligned} \phi \p{l^2 \p w} = \phi \p{r^2 \p w} \iff \# w \makebox[\widthof{$ \text{ is even{{}}} {}$}][l]{$\text{ is odd{{}}}$} . \end{aligned}
Lemma

Lemma \zarabicsection.\zarabicthrm

WW6K

Let k, n \in \mathbb N, w \in \mathcal A_{2}^\mathbb N such that k \ge 1 and

\begin{aligned} \forall \jmath \le k \quad \p{ \xi \p{w_{\hopen{\jmath, \jmath+n}}} \ne 0 \iff \jmath \in \crl{0, k} }. \end{aligned}

Then

\begin{aligned} \phi \p{w_{\hopen{0, n}}} = \phi \p{w_{\hopen{k, k+n}}} \iff n \makebox[\widthof{$ \text{ is even{{}}} {}$}][l]{$\text{ is odd{{}}}$} \land \xi \p{w_{\hopen{0, n}}} \ne \xi \p{w_{\hopen{k, k+n}}} . \end{aligned}
Remark

Remark Remark

EY6O

The proof idea is to determine those spots in the de Bruijn graph where several edges w for which \xi \p w = 0 follow upon each other. By looking at the graphs one gets the impression that happens only around \bm 0^n, \bm 1^n and around the centre of odd-dimensional de Bruijn graphs, which lemma \zarabicsection.\zarabicthrm confirms. In all other cases the statement is already established by corollary \zarabicsection.\zarabicthrm and lemma \zarabicsection.\zarabicthrm.

Definition

Definition Definition

M7AQ

Define \psi: \mathcal A_{2}^* \to \crl{-1, 0, 1} by

\begin{aligned} \psi \p w &= \p{\xi \p w}^{\# w} \cdot \phi \p w . \end{aligned}

\psi is called the – &alternating colouring function \psi&alternating colouring functionalternating colouring function \psi alternating colouring function .

w \in \mathcal A_{2}^* is called – &colourable string&colourablecolourable string colourable if \psi \p w \ne 0. For n \ge 2 the sft generated by prohibiting the strings in \crl{w \in \mathcal A_{2}^n; \psi \p w = 0} is called the – &&maximal n" colourable shift maximal n" colourable shift . Any subshift of the maximal n" colourable shift is called – &n-colourable shift&n" colourablen-colourable shift n" colourable .

Remark

Remark Remark

1M4F

In figures ? to ? the vertices and edges are coloured according to the value \psi assigns to them. Colourable are those vertices and edges that are coloured blue or red.

The maximal n-colourable shift is the edge shift of the \p{n-1}-dimensional de Bruijn graph of which all the non-colourable edges (the green ones in figures ? to ? that is) have been removed. Equivalently it is the vertex shift of the n-dimensional de Bruijn graph of which all non-colourable vertices have been removed.

Remark

Remark Remark

W7J4

Lemma \zarabicsection.\zarabicthrm will often be used without explicit reference. Saying that w is colourable should always be understood as \xi \p w, \psi \p w \ne 0. To show colourability, of course the easier condition \xi \p w \ne 0 will be used.

Theorem

Theorem \zarabicsection.\zarabicthrm

T0NS

Let k, n \in \mathbb N, w \in \mathcal A_{2}^\mathbb N such that k \ge 1 and

\begin{aligned} w_{\hopen{\jmath, \jmath+n}} \text{ is colourable} \iff \jmath \in \crl{0, k}. \end{aligned}

Then

\begin{aligned} \psi \p{w_{\hopen{0, n}}} \ne \psi \p{w_{\hopen{k, k+n}}} . \end{aligned}
Remark

Remark Remark

U0OQ

Theorem \zarabicsection.\zarabicthrm states that in an infinite string, a colourable substring always has a different \psi" colour than the preceding colourable substring of the same length – no matter how many non-colourable substrings there are in between.

Remark

Remark Remark

Y2NG

Consider a de Bruijn graph of which all non-colourable vertices have been removed. Corollary \zarabicsection.\zarabicthrm states that the colour of the vertices a walk passes alternates between blue and red. For the resulting vertex shift that result will be expressed in corollary \zarabicsection.\zarabicthrm.

In the even powers of such a graph there are only walks from vertices of one colour to vertices of the same colour. Figure ? shows the 2 power of the 4-dimensional de Bruijn subgraph without non-colourable edges.

Corollary

Corollary \zarabicsection.\zarabicthrm

VR35

Let k, n \in \mathbb N, w \in \mathcal A_{2}^\mathbb N such that {w_{\hopen{0, n}}}, {w_{\hopen{k, k+n}}} are colourable. Set

z = \# \crl{\jmath < k; w_{\hopen{\jmath, \jmath + n}} \text{ is not colourable}}.

Then

\begin{aligned} \psi \p{w_{\hopen{k, k+n}}} = \p{-1}^{k-z} \cdot \psi \p{w_{\hopen{0, n}}} . \end{aligned}
Corollary

Corollary \zarabicsection.\zarabicthrm

L046

Let n \in \mathbb N and w be a point in an n" colourable shift. Then

\begin{aligned} \forall k \in \mathbb N \quad \psi \p{w_{[k, k+n)}} = \p{-1}^{k} \cdot \psi \p{w_{[0, n)}} . \end{aligned}
Lemma

Lemma \zarabicsection.\zarabicthrm

Z0IH

Let n \ge 4. Then

\begin{aligned} \#\crl{ w \in \mathcal A_{2}^n; \xi \p{m \p w} = 0 \land \xi \p w \ne 0 } = 6 - 2 \cdot \p{-1}^{n} \end{aligned}
Corollary

Corollary \zarabicsection.\zarabicthrm

9Z24

For n \in \mathbb N set K_n = \# \crl{w \in \mathcal A_{2}^n; \psi \p w = 0}. Let n \ge 4. Then

\begin{aligned} K_n = 4 \cdot K_{n-2} - 6 + 2 \cdot \p{-1}^{n}. \end{aligned}
Definition

Definition Definition

Z5X0

For n \in \mathbb N the – &&Jacobsthal number Jacobsthal number J_n is defined as

\begin{aligned} J_n = \frac{2^n - \p{-1}^{n}}{3} . \end{aligned}
Corollary

Corollary \zarabicsection.\zarabicthrm

R7G6

Let n \ge 2. Then

\begin{aligned} n \text{ is even{{}}} \implies& K_n = \frac{2^n + \makebox[\widthof{$16$}][r]{$8$} }{6} \\ n \makebox[\widthof{$ \text{ is even{{}}} {}$}][l]{$\text{ is odd{{}}}$} \implies& K_n = \frac{2^n + 16}{6} . \end{aligned}
Definition

Definition Definition

HH9B

Let w \in \mathcal A_{2}^*. If w \bm 0, w \bm 1 are not colourable, w is called a – &&colourability sink colourability sink ; if \bm 0 w, \bm 1 w are not colourable, w is called a – &&colourability source colourability source . \upepsilon is called the – &trivial colourability sink and source&trivialtrivial colourability sink and source trivial colourability sink and source.

Lemma

Lemma \zarabicsection.\zarabicthrm

309A

If w \in \mathcal A_{2}^* is a colourability sink \bm 0 w, \bm 1 w are colourable. If w is a colourability source w \bm 0, w \bm 1 are colourable.

Lemma

Lemma \zarabicsection.\zarabicthrm

XJTZ

If w \in \mathcal A_{2}* is a colourability sink,

\begin{aligned} \xi \p{\bm 0 w} &= \xi \p{\bm 1 w} = \xi \p w \\ \phi \p{\bm 0 w} &= \phi \p{\bm 1 w} = \phi \p w \\ \psi \p{\bm 0 w} &= \psi \p{\bm 1 w} = \xi \p w \cdot \psi \p w . \end{aligned}

If w is a colourability source,

\begin{aligned} \xi \p{w \bm 0} &= \xi \p{w \bm 1} = \xi \p w \\ \phi \p{w \bm 0} &= \phi \p{w \bm 1} = -\phi \p w \\ \psi \p{w \bm 0} &= \psi \p{w \bm 1} = -\xi \p w \cdot \psi \p w . \end{aligned}
Theorem

Theorem \zarabicsection.\zarabicthrm

AHRF

Let w \in \mathcal A_{2}^*. Then

\begin{aligned} w \bm 0, w \bm 1 \text{ are colourable} &\implies \psi \p{w \bm 0} = \psi \p{w \bm 1} \\ \bm 0 w, \bm 1 w \text{ are colourable} &\implies \psi \p{\bm 0 w} = \psi \p{\bm 1 w} \end{aligned}
Remark

Remark Remark

27JU

Theorem \zarabicsection.\zarabicthrm makes it possible to define a function that assigns to the vertices of a de Bruijn graph a colour that corresponds to the colour of the incoming edges while differing from the colour of the outgoing ones. Lemma \zarabicsection.\zarabicthrm and corollary \zarabicsection.\zarabicthrm show that for odd-dimensional de Bruijn graphs that function is just \phi. Figures ? and ? give examples for even-dimensional de Bruijn graphs.

Remark

Remark Remark

OY0W

Theorem \zarabicsection.\zarabicthrm is a little bit more surprising than it looks at first glance: Due to the definition of a colourability sink focusing on w \bm 0 and w \bm 1, S_n rather says something about \mathcal A_{2}^{n+1} than about \mathcal A_{2}^n. K_n in contrast should be seen as an information about \mathcal A_{2}^n.

Source and licence

The text on this page is from arXiv:2411.00562v1 by Jonathan Garbe, under the licence CC BY 4.0. The corpus made these changes: it read the items out of the LaTeX source, it expanded the macros of the paper, it put each proof after its statement, and it converted the text to HTML. The formulas are the TeX of the paper, and KaTeX renders them. A formula or a reference can look different from the PDF. The page is published under CC BY 4.0.

The record of each item is in analysis/objects/2411/2411.00562.jsonl.