# On Embedding De Bruijn Sequences by Increasing the Alphabet Size

The generalization of De Bruijn sequences to infinite sequences with respect to the order n has been studied iand it was shown that every de Bruijn sequence of order n in at least three symbols can be extended to a de Bruijn sequence of order n + 1. Every de Bruijn sequence of order n in two symbols can not be extended to order n + 1, but it can be extended to order n + 2. A natural question to ask is if this theorem is true with respect to the alphabet. That is, we would like to understand if we can extend a De Bruijn sequence of order n over alphabet k into a into a De Bruijn sequence of order n and alphabet k+1. We call a De Bruijn sequence with this property an Onion De Bruijn sequence. In this paper we show that the answer to this question is positive. In fact, we prove that the well known Prefer Max De Bruijn sequence has this property, and in fact every sequence with this property behaves like the Prefer max De Bruijn sequence.

## Authors

• 26 publications
• 2 publications
• 8 publications
06/28/2019

### Extending de Bruijn sequences to larger alphabets

A circular de Bruijn sequence of order n in an alphabet of k symbols is ...
04/07/2021

### A Cycle Joining Construction of the Prefer-Max De Bruijn Sequence

We propose a novel construction for the well-known prefer-max De Bruijn ...
01/11/2018

### Almost Every Simply Typed Lambda-Term Has a Long Beta-Reduction Sequence

It is well known that the length of a beta-reduction sequence of a simpl...
02/21/2018

### An Information-Theoretical Analysis of the Minimum Cost to Erase Information

We normally hold a lot of confidential information in hard disk drives a...
12/04/2020

### Connecting 3-manifold triangulations with monotonic sequences of bistellar flips

A key result in computational 3-manifold topology is that any two triang...
01/30/2018

### An Efficient Generalized Shift-Rule for the Prefer-Max De Bruijn Sequence

One of the fundamental ways to construct De Bruijn sequences is by using...
09/01/1997

### Identifying Hierarchical Structure in Sequences: A linear-time algorithm

SEQUITUR is an algorithm that infers a hierarchical structure from a seq...
##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

A De Bruijn sequence of order over the alphabet is a sequence of words where for every and if then . One can view De Bruin sequences as hamiltonian cycles in the De Bruijn digraph , whose vertices are elements of and is connected to if and only if for every i. De Bruijn sequences are named after N. G. De Bruijn, who studied them systematically in [1].

The generalization of De Bruijn sequences to infinite sequences with respect to the order has been studied in [2], in which it was shown that

###### Theorem 1 (Theorem 1 in [2]).

Every de Bruijn sequence of order in at least three symbols can be extended to a de Bruijn sequence of order . Every de Bruijn sequence of order in two symbols can not be extended to order , but it can be extended to order .

A natural question to ask is if this theorem is true with respect to the alphabet. That is, we would like to understand if we can extend a De Bruijn sequence of order over alphabet into a into a De Bruijn sequence of order and alphabet . We call a De Bruijn sequence with this property an Onion De Bruijn sequence, as defined in 2.

In this paper we show that the answer to this question is positive. In fact, we prove in Theorem 2 that the well known Prefer Max De Bruijn sequence has this property, and in fact every sequence with this property behaves like the Prefer max De Bruijn sequence.

We use the lower-case Greek letters to denote symbols in the alphabet , the lower-case Latin letters to denote words in for the same , the lower-case Latin letters to denote natural numbers and indexes, and the lower-case Latin letters and to denote natural numbers which will be constant parameters throughout the text.

## 2 An infinite De Bruijn sequence

###### Definition 1.

The -prefer-max cycle, , is defined recursivaley by, and if then where is the maximal letter such that .

The prefer max De Bruijn was first defined and studied in the binary case in [3] and in [4].

Our first result is an observation regarding the relation between the -prefer-max and the -prefer-max sequences:

###### Theorem 2 (Onion Theorem).

For every , the prefer-max sequence is a suffix of the -prefer-max sequence.

###### Proof.

The proof goes by showing that . We will say that a symbol is in , and denote , if there exist such that . Let . By minimality, since is the only symbol that is in and is not in , we have that . Since and because (it does not contain the symbol ), we get, by the construction of the prefer-max sequence, that . This means that there exists some such that .

Assume, towards contradiction, that . In particular which means that . Therefore, and thus . Since the second set in this union does not contain , we get that . This leads to a contradiction because it means that which cannot happen in a De Bruijn sequence. This contradiction gives us that .

The sequence is therefore as follows:

 σ1,…,σi0−n−1,k−1,n-1 times0,…,0all the wis here contain k−1,k−2σi0,σi0+1,…,σkn+1

To complete the argument, we need to show that all substrings of length that contain appear before .

For and , let be such that , where is the letters suffix of . Because zero is the smallest symbol in our alphabet, we get that it is added by the prefer-max rule only if all the other symbols cannot be added, i.e., when adding other symbols would generate a substring that has already being seen before. Since comes, as a window, right before a word of the form for some , we have that comes after (or is equal to) which is after . Similar arguments give us that appears before which appears before and so on. Together we get that . Note that , i.e, that appears as a window at the ’s symbol of the sequence.

We will now show that if contains the symbol it must appear as a substring before the ’s symbol in the sequence, i.e., that . Consider first the case where the last (right-most) symbol of is . In this case, so we have, because , that appears as a substring before the ’th symbol in the sequence. The second case is when the last (right-most) symbol in is not but there is another letter in which is . In this case we have that appears less than steps after a window that ends with and the window does not appear in the windows between them because they all contain at a letter that is not their first. Formally, we have that there is some such that , and . This gives us that, also in this case, the window appears before the index .

To conclude the proof we note that we established that the windows up to the index contain all and only the words in and that this part of the sequence ends with zeros and then the next part begins with the symbol . This means that from this point on the prefer-max construction acts exactly as it does when the sequence begins with so it must constructs the -prefer-max sequence. ∎

From Theorem 2, we can see that for every , the prefer max sequence can be extended into the prefer max sequence, which could also be extended into the prefer max sequence and so on. So we can construct an infinite De Bruijn prefer max sequence of order n, which contains all prefer-max De Bruijn sequences as suffixes.

## 3 Onion De Bruijn sequences

###### Definition 2.

Let be a De Bruijn sequence of order over the alphabet . We say that is an onion De Bruijn sequence of order if for every , the subsequence is an De Bruijn sequence.

By the Onion Theorem 2, the De Bruijn prefer max sequences generate an onion De Bruijn sequence, thus the definition is not meaningless. But the infinite prefer max sequence is not the unique onion De Bruijn sequnce, as we can see from the following construction:

For and , let denote the De Bruijn graph, and define the -th Layer of to be the subgraph in which we removed the edges of (but keep all of the vertices of ). It is known that -De Bruijn sequences correspond to Hamiltonian cycles on , which correspond to Eulerian cycles on (for more information on this correspondence, see for example [1]). We know that is Eulerian, so we can choose a eulerian cycle for every layer, assuming without loss of generality that the cycle starts at . Thus by connecting all the eulerian cycles we get an onion De Bruijn. In fact, every Onion De Bruijn sequence can be constructed in such a fashion, layer by layer.

Although there are Onion De Bruijn sequences which are not the Prefer max De Bruijn sequence, they are not independent of it. The following theorem tells us that if we have an Onion De Bruijn sequence then it is the infinite prefer max sequence from some point with respect to every element of the sequence.

More formally, for every word of length , starting from some , which depends upon , the sequence behaves like the prefer max De Bruijn sequence with perspective to , i.e., the sequence where appears in increasing order in , where we denote the prefix relation by , i.e., if .

Thus we can view the infinite prefer max sequence as the "Universal Onion De Bruijn sequence", which all other onion De Bruijn sequences factor through.

###### Theorem 3.

Let be an onion De Bruijn sequence of order . Then for every the subsequence appears in increasing order in , where .

###### Proof.

First, note that if then the set is in the De Bruijn prefix of the sequence , and in fact is in the De Bruijn prefix of the sequence . Now lets assume towards contradiction that there exists and such that comes before . Know since and , then is in the De Bruijn prefix of the sequence and is in the De Bruijn prefix, but since is an onion De Bruijn sequence then the De Bruijn prefix of the sequence is it self a prefix of the the De Bruijn prefix of the sequence , so it can not be that comes before . ∎

## References

• [1] N. G. De Bruijn, A combinatorial problem, in: Proc. Koninklijke Nederlandse Academie van Wetenschappen, Vol. 49, 1946, pp. 758–764.
• [2] V. Becher, P. A. Heiber, On extending de bruijn sequences, Information Processing Letters 111 (18) (2011) 930–932.
• [3] M. H. Martin, A problem in arrangements, Bulletin of the American Mathematical Society 40 (12) (1934) 859–864.
• [4] L. R. Ford, A Cyclic Arrangement of n-tuples, Rand Corporation, 1957.