Next Article in Journal
End-to-End Deep Learning Architectures Using 3D Neuroimaging Biomarkers for Early Alzheimer’s Diagnosis
Next Article in Special Issue
On Some Families of Codes Related to the Even Linear Codes Meeting the Grey–Rankin Bound
Previous Article in Journal
Weighted Log-Rank Test for Clinical Trials with Delayed Treatment Effect Based on a Novel Hazard Function Family
Previous Article in Special Issue
On Generalized Galois Cyclic Orbit Flag Codes
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

A New Approach to Determine the Minimal Polynomials of Binary Modified de Bruijn Sequences

by
Musthofa
1,2,
Indah Emilia Wijayanti
1,
Diah Junia Eksi Palupi
1 and
Martianus Frederic Ezerman
3,*
1
Department of Mathematics, Faculty of Mathematics and Natural Sciences, Universitas Gadjah Mada, Sekip Utara BLS 21, Yogyakarta 55281, Indonesia
2
Department of Mathematics Education, Universitas Negeri Yogyakarta, 1 Colombo Road, Yogyakarta 55281, Indonesia
3
School of Physical and Mathematical Sciences, Nanyang Technological University, 21 Nanyang Link, Singapore 637371, Singapore
*
Author to whom correspondence should be addressed.
Mathematics 2022, 10(15), 2577; https://doi.org/10.3390/math10152577
Submission received: 25 June 2022 / Accepted: 20 July 2022 / Published: 25 July 2022
(This article belongs to the Special Issue Mathematical Coding Theory)

Abstract

:
A binary modified de Bruijn sequence is an infinite and periodic binary sequence derived by removing a zero from the longest run of zeros in a binary de Bruijn sequence. The minimal polynomial of the modified sequence is its unique least-degree characteristic polynomial. Leveraging a recent characterization, we devise a novel general approach to determine the minimal polynomial. We translate the characterization into a problem of identifying a Hamiltonian cycle in a specially constructed graph. The graph is isomorphic to the modified de Bruijn–Good graph. Along the way, we demonstrate the usefulness of some computational tools from the cycle joining method in the modified setup.

1. Introduction

Given a positive integer n, a binary de Bruijn sequence of order n is an infinite sequence over F 2 with period 2 n . Each binary n-tuple appears exactly once per period. Much has been found in the studies of such sequences. One can start from a primitive polynomial p ( x ) F 2 [ x ] with deg ( p ( x ) ) = n . The linear feedback shift register (LFSR) whose characteristic polynomial is p ( x ) produces a maximum length sequence m , also known as an m-sequence, of period 2 n 1 . Appending a 0 to the longest run of zeroes in m results a de Bruijn sequence.
We know from [1], who independently rediscovered the result in [2], that the number of binary de Bruijn sequences of order n is 2 2 n 1 n . The number of primitive polynomials over F 2 is n 1 φ ( 2 n 1 ) , where φ ( · ) is the Euler totient function. The number of de Bruijn sequences from the set of all primitive polynomials becomes minuscule compared to 2 2 n 1 n as n grows.
There are other methods than the route via m-sequences. Interested readers may want to consult Fredricksen’s survey [3] and more recent works, such as the ones by Chang, Ezerman, Ling and Wang in [4], by Gabric, Sawada, Williams and Wong in [5] and in many of their respective references.
The sequence m produced by a primitive polynomial p ( x ) can also be seen as a modification of the corresponding de Bruijn sequence by removing a 0 from the longest run of zeros. We call a sequence modified from any de Bruijn sequence, by such a removal of a 0, a modified de Bruijn sequence.
A sequence’s measure of predictability is given by its linear span or linear complexity. This is defined to be the degree of the shortest linear recursion or minimal polynomial that produces the sequence. The higher the span is, the less predictable the sequence becomes. For cryptographic applications, for example, sequences with large spans are desirable.
The respective minimal and maximal values for the linear span of de Bruijn sequences are 2 n 1 + n and 2 n 1 , for n 3 . This fact and further results on the distribution of the linear span values can be found in [6]. The extremal values were initially established as bounds in [7], where the upper bound was then shown to be achievable. Etzion and Lempel showed how to construct de Bruijn sequences of minimal span in [8].
Let s denote a modified binary de Bruijn sequence of order n and period 2 n 1 . Let s ˜ be its corresponding de Bruijn sequence. One often prefers using s , instead of s ˜ , since the presence of the all zero strings of length n can be undesirable. On the other hand, there are instances where s ˜ has an optimal linear complexity but s performs poorly in this measure.
Example 1.
The sequence s ˜ : = ( 0000100110101111 ) with n = 4 has linear complexity 15. The linear complexity of s = ( 000100110101111 ) drops significantly to 4.
Much less is known regarding the minimal polynomials of modified de Bruijn sequences. An early work on this topic was conducted by Mayhew and Golomb in [9]. Subsequent works by Kyureghyan in [10], by Tan, Xu and Qi in [11] and a more recent one by Wang, Zheng, Wang and Qi in [12] have not managed to supply any systematic method to determine the minimal polynomials.
For any n 4 , let Ω be the set of all nonzero polynomials of degree < n —that is,
Ω : = { 0 h ( x ) : h ( x ) F 2 [ x ] w i t h deg ( h ( x ) ) < n } .
In this work, we propose a general method to design the minimal polynomial of a modified de Bruijn sequence. To briefly outline our method, we defer the formal definition of terms related to polynomials to Section 2. We pick up from where the work by Tan et al. in [11] ends. In particular, we rely on the following useful characterization.
Theorem 1
([11], Theorem 3.2). Let m and n be positive integers satisfying m n > 1 . A polynomial f ( x ) F 2 [ x ] of degree m is the minimal polynomial of a modified de Bruijn sequence of order n if and only if the following conditions hold:
1.
The polynomial f ( x ) satisfies
f ( 0 ) = 1 , and   its   period   is   per ( f ( x ) ) = 2 n 1 .
2.
Let f * ( x ) be the reciprocal polynomial of f ( x ) . There exist g ( x ) F 2 [ x ] with deg ( g ( x ) ) = m n such that
g ( 0 ) = 1 ,
gcd ( g ( x ) , f * ( x ) ) = 1 , a n d
Ω = { ( g ( x ) x i mod f * ( x ) ) mod x n : 0 i < 2 n 1 } .
Theorem 1 requires the two polynomials f ( x ) and g ( x ) to not only satisfy their respective conditions in (2) and (3) but also to simultaneously meet the requirements in (4) and (5) with Ω as defined in (1).
Our first step is to posit an auxiliary self-reciprocal polynomial
F ( x ) : = i = 0 2 n 2 x i = 1 + x + + x 2 n 3 + x 2 n 2
by taking the product of all elements in the set
A : = δ n δ 1 { irreducible   r ( x ) F 2 [ x ] : deg ( r ( x ) ) = δ } .
Since the product of all irreducible polynomials whose degrees divide n is x 2 n + x and the only irreducible polynomials of degree 1 are x and x + 1 , it is clear that
F ( x ) = r ( x ) A r ( x ) = x 2 n + x x ( x + 1 ) .
The next move is to transform the problem of finding a suitable g ( x ) into a problem of determining a Hamiltonian cycle H in a specially constructed graph Γ n . We give a systematic way to determine g ( x ) . The details are covered in Section 3 and Section 4.
   Our main contributions
1.
For a given n 3 , we construct a graph Γ n with the property that every Hamiltonian cycle H in Γ n corresponds to a modified de Bruijn sequence. We then propose basic algorithms to identify numerous Hamiltonian cycles in Γ n .
2.
To each Hamiltonian cycle H in Γ n , we associate a canonical generator polynomial c H ( x ) . Once c H ( x ) is found, we compute d ( x ) : = gcd ( c H ( x ) , F ( x ) ) and prove that the minimal polynomial m s ( x ) of s is f * ( x ) , where f ( x ) : = F ( x ) d ( x ) .
3.
We supply basic computational tools as proofs of concept.

2. Preliminaries

Let s : = s 0 , s 1 , be an infinite sequence over a given finite field F q . If there is a positive integer N for which N is the smallest number such that s i = s i + N for all i 0 , then s is an N-periodic sequence, and we write s = ( s 0 , s 1 , , s N 1 ) . Such an N is the period per ( s ) of s . The sum of two infinite sequences s : = s 0 , s 1 , and t : = t 0 , t 1 , over the same finite field is s + t = s 0 + t 0 , s 1 + t 1 , , and the scalar multiple c s with c F q is simply c s 0 , c s 1 , . Henceforth, unless otherwise stated, all sequences in this work are binary—that is, q = 2 .
Let L be the (left) shift operator that sends
s = ( s 0 , s 1 , , s N 1 ) L ( s ) = ( s 1 , , s N 1 , s 0 ) .
By convention, L 0 fixes the sequence. Two sequences a and b are called distinct or (cyclically) inequivalent if one is not the cyclic shift of the other—that is, there is no integer k 0 such that a = L k b .
A monic polynomial f ( x ) in the ring of binary polynomials F 2 [ x ] of indeterminate x is a characteristic polynomial of s = ( s 0 , s 1 , , s N 1 ) if f ( L ) ( s ) = ( 0 , 0 , , 0 ) . One can then call s a linear feedback shift register (LFSR) sequence. As an LFSR sequence, s may have many characteristic polynomials. We identify the unique characteristic polynomial m s ( x ) of least degree as its minimal polynomial. Any characteristic polynomial of s is divisible by m s ( x ) .
The minimal polynomial of a sequence gives the sequences measure of predictability. The degree Δ : = Δ s = deg ( m s ( x ) ) is the linear complexity or the linear span of s . Knowing any Δ -tuple in s allows us to reconstruct s completely. The zero sequence has linear span 0.
The reciprocal polynomial of a ( x ) : = 1 + a 1 x + + a n 1 x n 1 + x n is the polynomial
a * ( x ) : = x n a ( x 1 ) = 1 + a n 1 x + + a 1 x n 1 + x n .
A polynomial is self-reciprocal if it is its own reciprocal. The order of a ( x ) , denoted by ord ( a ( x ) ) , is the least positive integer λ for which a ( x ) divides x λ 1 . The minimal polynomial of an N-periodic sequence has order N.
We will use the rational fraction representation of any s = ( s 0 , s 1 , , s N 1 ) . Further details can be found in Chapter 6, Section 3 of [13]. The generating function of s is the element
s ( x ) : = s 0 + s 1 x + = i = 0 s i x i
in the ring of formal power series over F 2 . Since s is periodic, it can be represented as a rational function
s ( x ) = i = 0 s i x i = g ( x ) f ( x ) ,
with f ( x ) and g ( x ) in F 2 [ x ] such that
deg ( g ( x ) ) < deg ( f ( x ) ) , gcd ( g ( x ) , f ( x ) ) = 1 , f ( 0 ) = 1 .
The minimal polynomial m s ( x ) of s is the reciprocal f * ( x ) of the denominator f ( x ) in (11). The converse also holds. For any f ( x ) and g ( x ) in F 2 [ x ] satisfying (12), there exists a periodic sequence s for which (11) holds.
The requirement that gcd ( g ( x ) , f ( x ) ) = 1 is not strictly necessary. Indeed, there will be occasions in the sequel that we relax this condition and allow for a rational function representation s ( x ) with gcd ( g ( x ) , f ( x ) ) = d ( x ) 1 . The context will make it clear whether the representation is the simplest one or the more relaxed version.
Theorem 2
([7], Section 2). If a is binary de Bruijn sequence, then the minimal polynomial of a has the form a ( x ) = ( x + 1 ) z for some integer z satisfying 2 n 1 + 1 z 2 n .
Let I ( n ) denote the number of binary irreducible polynomials of degree n in F 2 [ x ] . Let μ ( n ) be the Möbius function. Gauss’ general formula in Theorem 3.25 of [13] says that I ( n ) = 1 n j n μ ( j ) 2 n j . Sequence A001037 in [14] lists I ( n ) .
Theorem 3
([9], Theorem 2). If s ˜ is a de Bruijn sequence of order n 4 whose modified sequence is s , then
Δ ( s ) = d n a d · d , w i t h   0 a d I ( d ) .
Let s be a modified de Bruijn sequence of order n. For small values of n, it is known that n Δ s 2 n 2 . It is conjectured in [11] that Δ s { n + 1 , n + 2 , , 3 n 1 } . If s is not an m-sequence, then we know from Corollary 3 in [12] that Δ s > 5 4 n .
We now recall useful results on the rational fraction representations of modified de Bruijn sequences over F q established by Tan et al. in [11]. For any nonnegative integer k, the k-shifted sequence of a = ( a 0 , a 1 , , a N 1 ) is
L k a : = a k , a k + 1 , , a N 1 , a 0 , , a k 1 .
The set of all shifted sequences of a is L k a : 0 k < N .
Lemma 1
([11], Lemma 3.5). If a = ( a 0 , a 1 , , a N 1 ) is a given N-periodic sequence with rational fraction representation g ( x ) f ( x ) , then, for any 0 k < N , the rational fraction representation of its k-shifted sequence L k a is
g k ( x ) f ( x ) , w h e r e   g k ( x ) : = g ( x ) x N k mod f ( x ) .
Lemma 2
([11], Lemma 3.6). If a = ( a 0 , a 1 , , a 2 n 2 ) is a sequence of period 2 n 1 with g ( x ) f ( x ) as its rational fraction representation, then a is a modified de Bruijn sequence of order n if and only if
Ω = { ( g ( x ) x i mod f ( x ) ) mod x n : 0 i < 2 n 1 } .
Lemma 2 asserts that a is a modified de Bruijn sequence if and only if g k ( x ) mod x n traverses all nonzero polynomials of degree less than n as k goes from 0 to 2 n 2 . The preparation in Lemmas 1 and 2 leads to Theorem 1 in the introduction.
We use graph theoretic notions commonly defined in standard textbooks. A directed gaph or a digraph is an ordered pair G : = ( V , E ) , where V is a set of vertices and E is a set of ordered pairs called directed edges or arcs. In this work, a digraph does not have multiple arcs on the same ordered pair of vertices, although it may contain a loop. A Hamiltonian path (cycle) is a path (cycle) that visits every vertex exactly once, with each arc traced according to its direction. We will often use the terms Hamiltonian cycle and Hamiltonian path interchangably, without causing ambiguity or losing generality.

3. From Polynomials to Directed Graphs

From the work of Mayhew and Golomb in [9] we know that the minimal polynomial of modified binary de Bruijn sequences of order n is a product of distinct irreducible polynomials of degree d 1 , with d n . Setting aside the m-sequences built from primitive polynomials of degree n, there had not been any systematic way to determine the minimal polynomial of a given modified de Bruijn sequence.
Not all possible values given in (13) are the actual values of the linear span. For n = 5 —for instance, there is no modified binary de Bruijn sequence with minimal polynomial f ( x ) = ( x 5 + x 2 + 1 ) ( x 5 + x 3 + 1 ) , which is a product of two distinct irreducible polynomials of degree 5. Table 1 lists the degrees taken by the actual minimal polynomials for n { 4 , 5 , 6 } .
Example 2.
For n = 4 , there are exactly 10 modified de Bruijn sequences with the maximal linear span 14. Their minimal polynomial is F ( x ) = 1 + x + x 3 + + x 14 . Table 2 gives the 10 polynomials g ( x ) that each satisfy the requirements in Theorem 1 with F ( x ) taking the place of f ( x ) . Performing long division, we easily confirm that the first entry in Table 2 with g ( x ) = x 10 + x 8 + x 5 + x + 1 has a representation
g ( x ) F ( x ) = 1 + x 2 + x 5 + x 6 + x 8 + x 9 + x 10 + x 11 + x 15 g ( x ) F ( x ) ,
corresponding to the modified de Bruijn sequence ( 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 ) . The rest of the entries can be similarly interpreted.
We define a digraph Γ n ( V , E ) , or simply Γ , when n is clear from the context, based on the set Ω in (1) as follows. We associate each nonzero polynomial
a ( x ) = a 0 + a 1 x + + a n 2 x n 2 + a n 1 x n 1 Ω
with the n-string
a = a n 1 , a n 2 , , a 1 , a 0
and its integer representation
A = a n 1 2 n 1 + a n 2 2 n 2 + + a 1 2 + a 0 .
Table 2. Degree 10 polynomials g ( x ) = j = 0 10 g j x j , written as g 10 g 9 g 1 g 0 , that generate the set Ω in (1) and their corresponding sequences.
Table 2. Degree 10 polynomials g ( x ) = j = 0 10 g j x j , written as g 10 g 9 g 1 g 0 , that generate the set Ω in (1) and their corresponding sequences.
g ( x ) Modified de Bruijn Sequence s g ( x ) Modified de Bruijn Sequence s
10100100011 ( 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 ) 11011000101 ( 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 )
10011010111 ( 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 0 ) 10100011011 ( 1 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 0 )
11101011001 ( 1 , 1 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 ) 11010111011 ( 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 )
10001101011 ( 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 0 , 0 ) 11011101011 ( 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 , 0 , 0 )
11010110001 ( 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 ) 11000100101 ( 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 )
Hence, there is a one-to-one correspondence between elements in Ω and the integers in { 1 , 2 , , 2 n 1 } , which we use as the vertex set V. Let a ( x ) , b ( x ) Ω be seen as vertices A , B V . By Equations (5) and (6), we add an arc from A to B if and only if
b ( x ) = x a ( x ) mod x n   or
b ( x ) = x a ( x ) mod x n + i = 0 n 1 x i .
The arc governed by (18) is from A to B : = 2 A mod 2 n , while the one defined by (19) is from A to B : = ( 2 n 1 ) ( 2 A mod ( 2 n ) ) . We call the former the doubling arc, marked in blue and labeled by 0, and the latter the double-then-complement arc, marked in red and labeled by a 1. For brevity, the names are abbreviated to double and complement arcs.
The outdegree of each vertex is 2, except for the vertex 2 n 1 whose outdegree is 1 since 0 Ω . This vertex has only a red arc to its complement vertex 2 n 1 . Each vertex has indegree 2, except for the vertex 2 n 1 whose only inbound edge comes from 2 n 1 . There is a loop from vertex A to itself if and only if 3 A mod 2 n = 2 n 1 . This vertex is clearly unique. The graph Γ n is simple for all n such that 3 ( 2 n 1 ) .
Example 3.
The graph Γ 4 is in Figure 1 Top. The loop is from A = 5 to itself.
Let us briefly review the de Bruijn graph on 2 n vertices, denoted by B n or simply B when n is understood. The graph, which is also known as the Good graph and the de Bruin–Good graph, was introduced independently by N. de Bruijn in [1] and by I. J. Good in [15]. Its set of vertices consists of binary n-strings
{ v 1 , v 2 , , v n : v j F 2   for   all   1 j n } .
Each vertex has indegree 2 and outdegree 2. The two arcs from vertex c 1 , c 2 , , c n are to vertices c 2 , c 3 , , c n , 0 and c 2 , c 3 , , c n , 1 . For our purposes, we relabel the vertices by integers from 0 to 2 n 1 by replacing v 1 , v 2 , , v n with v 1 + 2 v 2 + + 2 n 1 v n .
We denote, by D n , the graph obtained by deleting vertex 0 and its incident arcs in B n . In D n , there is an arc from vertex A to vertex B if and only if B = 2 A mod 2 n or B = ( 2 A + 1 ) mod 2 n . Moreover, the only vertex with a loop is 2 n 1 , and the only vertex with outdegree 1 is 2 n 1 .
Theorem 4.
For any positive integer n, the graphs D n and Γ n are isomorphic.
Figure 1. (Top): The graph Γ 4 with blue arcs based on (18) and red arcs based on (19). (Bottom): A Hamiltonian cycle H in Γ 4 .
Figure 1. (Top): The graph Γ 4 with blue arcs based on (18) and red arcs based on (19). (Bottom): A Hamiltonian cycle H in Γ 4 .
Mathematics 10 02577 g001
Proof. 
Since all arithmetic operations are performed modulo 2 n , we omit mod 2 n for brevity. It is clear that D n and Γ n have the same number of vertices and edges. To devise a recursive mapping σ : D n Γ n , we start by sending vertex 2 n 1 in D n to vertex 3 1 ( 2 n 1 ) in Γ n . In their respective graphs, the vertices are the only ones with a loop. Since gcd ( 3 , 2 n ) = 1 , the inverse of 3 always exists for all n. Now that we have σ ( 2 n 1 ) = 3 1 ( 2 n 1 ) , we assign, for y = σ ( x ) , the images
σ ( 2 x ) = 2 y   and   σ ( 2 x + 1 ) = ( 2 n 1 ) 2 y .
A vertex labeled by an even number in D n is sent to an even-numbered vertex in Γ n . Similarly, a vertex labeled by an odd number in D n is mapped to an odd-numbered vertex in Γ n . By definition, σ ( 2 n 1 ) = 2 n 1 , which means that the unique vertex in D n whose outdegree is 1 is sent to the unique vertex with outdegree 1 in Γ n . Let A and B be vertices in D n such that there is an arc from A to B. It is immediate to verify that there is an arc from σ ( A ) to σ ( B ) .
We note that, since B n is a Hamiltonian graph, then so is D n . To show that σ is injective, let H be a Hamiltonian path that starts from vertex 2 n 1 in D n . Let A and B be two distinct vertices in H such that σ ( A ) = σ ( B ) . If vertex C is the predecessor of B in H , then there exists an arc from σ ( C ) to σ ( B ) = σ ( A ) in Γ n . Hence, there must be an arc from C to A, contradicting the fact that H is a Hamiltonian path. Thus, A = B .    □
Example 4.
For n = 4 , we start with σ ( 15 ) = 3 1 15 = 5 . Proceeding recursively, we obtain
σ ( 14 ) = 10 , σ ( 12 ) = 4 , σ ( 13 ) = 11 , σ ( 8 ) = 8 , σ ( 9 ) = 7 , σ ( 10 ) = 6 , σ ( 11 ) = 9 , σ ( 1 ) = 15 , σ ( 2 ) = 14 , σ ( 3 ) = 1 , σ ( 4 ) = 12 , σ ( 5 ) = 3 , σ ( 6 ) = 2 , σ ( 7 ) = 13 .
Definition 1.
Let F ( x ) = i = 0 2 n 2 x i be as in (6). The indexed set
W g : = { ( x i g ( x ) mod F ( x ) ) mod x n : i 0 }
forms a walk generated by g ( x ) and we say that g ( x ) generates the walk W g .
Our task is to identify polynomials g ( x ) , with g ( 0 ) = 1 and gcd ( g ( x ) , F ( x ) ) = d ( x ) , that generate Hamiltonian cycles in Γ n . Once such a g ( x ) is found, Theorem 1 concludes that the reciprocal polynomial f * ( x ) of f ( x ) : = F ( x ) d ( x ) is the minimal polynomial of a modified binary de Bruijn sequence.

4. Hamiltonian Cycles in Γ n

Deciding whether a directed graph is Hamiltonian is difficult. A survey on this topic was performed by Kühn and Osthus in [16]. Further references and discussion can be found in Section 6.1 of [17]. Fortunately, Γ n has many properties that allow us to explicitly determine some Hamiltonian cycles for all n.

4.1. Hamiltonian Cycles by Two Greedy Algorithms

Inspired by some greedy algorithms in the construction of certain classes of de Bruijn sequences discussed by Chang, Ezerman and Fahreza in [18], we devise two basic algorithms. Algorithm 1 prefers the complement over the double arcs when moving from the current vertex to the next vertex. Algorithm 2 swaps the preference with a modification imposed to avoid the inclusion of 0, since 0 Ω .
Algorithm 1Prefer Complement
Input: The order n of the sequences.
Output: Paths in Γ n .
  1:  for i { 1 , 2 , , 2 n 1 } do
  2:      Initiate the indexed set S = { i }                        ▹ v init = i
  3:       j element in S with largest index
  4:       d 2 j mod 2 n
  5:       c 2 n 1 d
  6:      while  c S or d S  do
  7:       if  c S  then
  8:         Append c to S
  9:       else
 10:         Append d to S
 11:      Path is ( s 1 , s 2 ) , ( s 2 , s 3 ) , , ( s 1 , s ) , where S : = { s 1 = i , s 2 , , s 1 , s } .
The two algorithms produce paths, starting from an initial vertex v init . While each initial vertex produces a path, only several of them lead to Hamiltonian cycles. Table 3 lists the Hamiltonian cycles produced for n { 4 , 5 , 6 } .
For a given n 4 , Algorithm 1 yields n 1 distinct—that is, cyclically-inequivalent—Hamiltonian cycles: n 2 of them have two distinct initial vertices, whereas one cycle has three possible initial vertices. Let 1 j < n . Then, v init { 2 j 1 , 2 n 2 j 1 } for each j. When v init = 2 n 1 , the generated cycle is the same as the one produced when j = 1 —that is, with v init { 1 , 2 n 1 } . This is because the only arc from 2 n 1 is to 2 n 1 and the complement of the double of 2 n 1 is 1 = ( 2 n 1 ) ( 2 n 2 ) . Algorithm 2 produces a unique Hamiltonian cycle. It occurs if and only if the initial vertex is either ( 2 n 1 ) / 3 or its complement ( 2 n 1 ) ( 2 n 1 ) / 3 .
Example 5.
For n = 4 , Algorithm 1 yields the Hamiltonian cycle H ˜ in Figure 2 on v init = 1 . The path consists of arcs:
( 1 , 13 ) , ( 13 , 5 ) , ( 5 , 10 ) , ( 10 , 11 ) , ( 11 , 9 ) , ( 9 , 2 ) , ( 2 , 4 ) , ( 4 , 7 ) , ( 7 , 14 ) , ( 14 , 3 ) , ( 3 , 6 ) , ( 6 , 12 ) , ( 12 , 8 ) , ( 8 , 15 ) .
Algorithm 2Modified Prefer Double
Input: The order n of the sequences.
Output: Paths in Γ n .
  1:  for i { 1 , 2 , , 2 n 1 } do
  2:      Initiate indexed set S = { i }                        ▹ v init = i
  3:       j element in S with largest index
  4:       d 2 j mod 2 n
  5:       c 2 n 1 d
  6:      while c S or d S do
  7:       if d = 0 and c S then
  8:         Append c to S
  9:       else
 10:         if d S then
 11:                   Append d to S
 12:         else
 13:                   Append c to S
 14:      Path is ( s 1 , s 2 ) , ( s 2 , s 3 ) , , ( s 1 , s ) , where S : = { s 1 = i , s 2 , , s 1 , s } .
Figure 2. The Hamiltonian cycle H ^ in Γ 4 produced by Algorithm 1 on v init = 1 . It is generated by g ( x ) = x 10 + x 8 + x 5 + x + 1 . The resulting sequence ( 0 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 ) has linear complexity 14, which is maximal.
Figure 2. The Hamiltonian cycle H ^ in Γ 4 produced by Algorithm 1 on v init = 1 . It is generated by g ( x ) = x 10 + x 8 + x 5 + x + 1 . The resulting sequence ( 0 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 ) has linear complexity 14, which is maximal.
Mathematics 10 02577 g002
For brevity, we will only prove, in Theorem 6, that Algorithm 1 on v init = 1 always yields a Hamiltonian cycle. The respective proofs for the other valid initial vertices and on Algorithm 2 when using the two specified initial vertices follow a similar line of reasoning. To identify Hamiltonian cycles beyond those produced by the two algorithms, we establish a general result on the paths produced by Algorithm 1. The result will be used in the next subsection to identify many more Hamiltonian cycles in Γ n by cycle joining.
Table 3. Hamiltonian cycles constructed by Algorithms 1 and 2 for n { 4 , 5 , 6 } .
Table 3. Hamiltonian cycles constructed by Algorithms 1 and 2 for n { 4 , 5 , 6 } .
n v init The Resulting Hamiltonian Cycle
Algorithm 1: Prefer Complement
41, 15, 8(1, 13, 5, 10, 11, 9, 2, 4, 7, 14, 3, 6, 12, 8, 15)
3, 14(3, 9, 13, 5, 10, 11, 6, 12, 7, 1, 2, 4, 8, 15, 14)
7, 12(7, 1, 13, 5, 10, 11, 9, 2, 4, 8, 15, 14, 3, 6, 12)
51, 31, 16(1, 29, 5, 21, 10, 11, 9, 13, 26, 20, 23, 17, 2, 27, 22,
19, 25, 18, 4, 8, 15,30, 3, 6, 12, 7, 14, 28, 24, 16, 31)
3, 30(3, 25, 13, 5, 21, 10, 11, 9, 18, 27, 22, 19, 6, 12, 7,
17, 29, 26, 20, 23, 14, 28, 24, 15, 1, 2, 4, 8, 16, 31, 30)
7, 28(7, 17, 29, 5, 21, 10, 11, 9, 13, 26, 20, 23, 14, 3, 25,
18, 27, 22, 19, 6, 12, 24, 15, 1, 2, 4, 8, 16, 31, 30, 28)
15, 24(15, 1, 29, 5, 21, 10, 11, 9, 13, 26, 20, 23, 17, 2, 27,
22, 19, 25, 18, 4, 8,16, 31, 30, 3, 6, 12, 7, 14, 28, 24)
61, 63, 32(1, 61, 5, 53, 21, 42, 43, 41, 45, 37, 10, 20, 23, 17, 29, 58, 11, 22, 19, 25,
13, 26, 52, 40, 47, 33, 2, 59, 9, 18, 27, 54, 44, 39, 49, 34, 4, 55, 46, 35, 57,
50, 36, 8, 16, 31, 62, 3, 6, 51, 38, 12, 24, 15, 30, 60, 7, 14, 28, 56, 48, 32, 63)
3, 62(3, 57, 13, 37, 53, 21, 42, 43, 41, 45, 26, 11, 22, 19, 25, 50, 27, 9, 18, 36,
55, 17, 29, 5, 10, 20, 23, 46, 35, 6, 51, 38, 12, 39, 49, 34, 59, 54, 44, 24, 15,
33, 61, 58, 52, 40, 47, 30, 60, 7, 14, 28, 56, 48, 31, 1, 2, 4, 8, 16, 32, 63, 62)
7, 60(7, 49, 29, 5, 53, 21, 42, 43, 41, 45, 37, 10, 20, 23, 17, 34, 59, 9, 18, 27, 54,
19, 25, 13, 26, 11, 22, 44, 39, 14, 35, 57, 50, 36, 55, 46, 28, 56, 15, 33,61,
58, 52, 40, 47, 30, 3, 6, 51, 38, 12, 24, 48, 31, 1, 2, 4, 8, 16, 32, 63, 62, 60)
15, 56(15, 33, 61, 5, 53, 21, 42, 43, 41, 45, 37, 10, 20, 23, 17, 29, 58, 11, 22, 19,
25, 13, 26, 52, 40, 47, 30, 3, 57, 50, 27, 9, 18, 36, 55, 46, 35, 6, 51, 38, 12,
39, 49, 34, 59, 54, 44, 24, 48, 31, 1, 2, 4, 8, 16, 32, 63, 62, 60, 7, 14, 28, 56)
31, 48(31, 1, 61, 5, 53, 21, 42, 43, 41, 45, 37, 10, 20, 23, 17, 29, 58, 11, 22, 19, 25,
13, 26, 52, 40, 47, 33, 2, 59, 9, 18, 27,54, 44, 39, 49, 34, 4, 55, 46, 35, 57
50, 36, 8, 16, 32, 63, 62, 3, 6, 51, 38, 12, 24, 15, 30, 60, 7, 14, 28, 56, 48)
Algorithm 2: Modified Prefer Double
45, 10(5, 10, 4, 8, 15, 14, 12, 7, 1, 2, 11, 6, 3, 9, 13)
510, 21(10, 20, 8, 16, 31, 30, 28, 24, 15, 1, 2, 4, 23, 14, 3,
6, 12, 7, 17, 29, 26, 11, 22, 19, 25, 18, 27, 9, 13, 5, 21)
621, 42(21, 42, 20, 40, 16, 32, 63, 62, 60, 56, 48, 31, 1, 2, 4, 8, 47, 30, 3, 6, 12, 24,
15, 33, 61, 58, 52, 23,46, 28, 7, 14, 35, 57, 50, 36, 55, 17, 34, 59, 54, 44, 39,
49, 29, 5, 10, 43, 22, 19, 38, 51, 25, 13, 26, 11, 41, 18, 27, 9, 45, 37, 53)
Theorem 5.
Let V ( Γ n ) = { 1 , , 2 n 1 } . Given an indexed set whose elements are vertices in Γ n in the form of
Θ : = { α 1 , , α 2 n 1 : α i V   a n d   α i α j   f o r   i j } ,
let Ψ be a mapping on Θ defined by, for 1 i < 2 n ,
Ψ : α i β i = ( 2 n 1 ) ( 2 α i mod 2 n ) ,   if   α i   h a d   n o t   b e e n   m a p p e d   t o   β i , 2 α i mod 2 n ,   o t h e r w i s e .
Then, Ψ is a permutation on Θ.
Proof. 
We show that Ψ is a bijection on Θ . It is immediate to verify that there exist indices 1 k < 2 n such that α = ( α k + 2 n 1 ) mod 2 n . If k < , then
Ψ ( α k ) = ( 2 n 1 ) ( 2 α k mod 2 n ) Ψ ( α ) = 2 α k mod 2 n .
If < k , then
Ψ ( α ) = ( 2 n 1 ) ( 2 α k mod 2 n ) Ψ ( α k ) = 2 α k mod 2 n .
Thus, Ψ is injective.
Let α be an arbitrarily selected element of Θ . If α is even, then there exists an integer k 1 , 2 , , 2 n 2 2 such that α = 2 k . Hence, either Ψ ( k ) = α or Ψ ( k + 2 n 1 ) = α . If α is odd, then there exists an integer t 0 , 1 , 2 , , 2 n 2 2 such that α = 2 t + 1 . Then, either Ψ 2 n 2 t 2 2 = α or Ψ 2 n 2 t 2 2 + 2 n 1 = α . We conclude that Ψ is surjective, and the proof is now complete. □
Since the function Ψ in (21) is a permutation on a finite set Θ , then Ψ can be written as a composition of j disjoint cycles
Ψ = C 1 C 2 C j .
Definition 2.
Let α k , 1 , α k , 2 , , α k , be a cycle C k generated by Ψ. We say that C k starts at α k , 1 and endsat α k , since, by then, both possible images Ψ ( α k , ) , one of which being α k , 1 , have appeared. The elements α k , 1 and α k , are, respectively, the starting element and the terminating element of C k .
Lemma 3.
Let the indexed set Θ and the function Ψ be as defined in Theorem 5. Let γ Θ be an even number that is not a starting element in any cycle. Then, the complement 2 n 1 γ of γ is an odd number that occurs before γ in the said cycle.
Proof. 
By how Ψ is defined and since γ Θ is not the starting element, it is impossible for γ to appear in the cycle before its complement, which is an odd number. □
Lemma 4.
Let β { 1 , 2 , , 2 n 1 1 } , and then { Ψ ( β ) , Ψ ( β + 2 n 1 ) } = { 2 n 1 2 β , 2 β } . By the time both 2 n 1 2 β and 2 β appear in a cycle C , we know that both β and β + 2 n 1 must have appeared earlier.
Proof. 
Since Ψ is bijective, the appearance of both 2 n 1 2 β and 2 β requires the prior inclusion of both possible predecessors in the cycle. □
The conclusion that Γ n is Hamiltonian for all n 4 follows from the next theorem.
Theorem 6.
Let the set Θ and function Ψ be as defined in Theorem 5. The function Ψ produces a single cycle of length 2 n 1 that starts at 1 and ends at 2 n 1 .
Proof. 
Let C be the cycle
( 1 , Ψ ( 1 ) , Ψ ( Ψ ( 1 ) ) , , δ , α ) .
Consider the shift-equivalent cycle ( Ψ ( δ ) = α , Ψ ( α ) = 1 , Ψ ( 1 ) , , δ ) . Since Ψ ( α ) = 1 , α must be either 2 n 1 1 or 2 n 1 .
For a contradiction, let us assume that α = 2 n 1 1 . Since 1 has already appeared in C , the only other possible successor of 2 n 1 1 —namely, 2 n 2 —must have appeared in C . The two possible predecessors of 2 n 2 are 2 n 1 1 and 2 n 1 . Hence, C must have the form
C = ( 1 , , 2 n 1 , 2 n 2 , , 2 n 1 1 ) .
On the other hand, since 2 n 1 1 is both an odd number and the terminating element, then its complement—namely, 2 n 1 —must not have appeared in C . However, this rules out 2 n 1 from C as well, contradicting (26). Thus, the terminating element must be α = 2 n 1 .
We now show that all elements of Θ appear in C . The computations are performed modulo 2 n . It is clear that δ = 2 n 1 , since it is the only preimage of 2 n 1 . Hence, we have
C = ( 1 , Ψ ( 1 ) , , 2 n 1 , 2 n 1 ) .
Aided by Lemmas 3 and 4, we proceed by induction to confirm that each even number 2 k 2 n 2 appears.
  • Since δ = 2 n 1 is an even number, Lemma 3 says that its complement δ * : = 2 n 2 n 1 1 = 2 n 1 1 appears. By Lemma 4, both 2 n 2 and 2 n 1 + 2 n 2 must have appeared before both δ and δ * do.
  • Since 2 n 2 is even, by Lemma 3, its complement appears. We infer by Lemma 4 that 2 n 3 and 2 n 1 + 2 n 3 appear.
  • We repeat the same reasoning on 2 n 1 + 2 n 2 . Its complement appears, and so do both 2 n 2 + 2 n 3 and 2 n 1 + 2 n 2 + 2 n 3 .
  • Continuing the process, we establish the appearance of
    2 , 2 2 , , 2 n 1 , 2 + 2 n 1 , 2 2 + 2 n 1 , , 2 n 2 + 2 n 1 , 2 + 2 n 2 + 2 n 1 , 2 2 + 2 n 2 + 2 n 1 , , 2 n 3 + 2 n 2 + 2 n 1 , , , , , 2 + 2 2 + + 2 n 2 + 2 n 1 ,
    which covers all even numbers in the desired range.
Lemma 3 ensures the appearance of each odd number j such that 3 j ( 2 n 3 ) , completing the proof. □
Corollary 1.
The graph Γ n for each n 4 is Hamiltonian.
Proof. 
We built C = ( 1 , Ψ ( 1 ) , Ψ ( Ψ ( 1 ) ) , , 2 n 1 , 2 n 1 ) in the proof of Theorem 6. Following the sequence of vertices in C , a Hamiltonian path in Γ n is formed by the edges
( 1 , Ψ ( 1 ) ) , ( Ψ ( 1 ) , Ψ ( Ψ ( 1 ) ) ) , , ( 2 n 1 , 2 n 1 ) .

4.2. More Hamiltonian Cycles by Cycle Joining

Theorem 6 guarantees that, starting from v init = 1 , Algorithm 1 produces a cycle of length 2 n 1 . However, for most other v init , we obtain disjoint cycles as in (24) with j > 1 . The following lemma gives a condition for when two disjoint cycles can be joined into a longer cycle.
Lemma 5.
Two disjoint cycles C and C ^ can be joined into one cycle if there exist c C and d C ^ such that d is the complement of c—that is, d = 2 n 1 c .
Proof. 
Let C = ( c 1 , , c i 1 , c i , c i + 1 , , c k ) and C ^ = ( d 1 , , d j 1 , d j , d j + 1 , , d ) , with c i and d j forming a complementary pair—that is, c i + d j = 2 n 1 . We exchange the predecessors of c i and d j to obtain the joined cycle
( c 1 , , c i 1 , d j , d j + 1 , , d , d 1 , , d j 1 , c i , c i + 1 , , c k ) .
Theorem 7.
If Ψ generates disjoint cycles as in (24), then all of the cycles can be joined into a single cycle of length 2 n 1 .
Proof. 
If Ψ generates only one cycle, then it is clear that the length of the cycle must be 2 n 1 . Suppose that Ψ generates at least two cycles, and we take any cycle C . It suffices to show that there exists c C whose complement c ^ : = 2 n 1 c does not appear in C . For a contradiction, let there be no such element. Hence, every element in C has its complement in C —that is, c ^ C for any c C . By definition, exactly one of either c or c ^ is an even number e. Therefore, the predecessors of c and c ^ , namely, k : = e 2 and 2 n 1 + k also appear in C . Following this fact, all integers in { 1 , 2 , . . , 2 n 1 } appear in C . This contradicts the assumption that Ψ generates two or more cycles. □
We can implement Theorem 7 and enumerate the number of resulting Hamiltonian cycles that can be constructed by adopting the cycle joining method from the theory of feedback shift registers.
Let Ψ be expressed in terms of its disjoint cycles as in (24). For distinct 1 i k j , let τ i , k : = ( r , s ) denote r C i and s C k with r + s = 2 n 1 . The tuple joins C i and C k by interchanging the respective predecessors of r and s.
To count the number of inequivalent Hamiltonian cycles that can be produced from Ψ , we build the associated undirected multigraph G Ψ as follows. The vertices are C 1 , , C j . We add an edge labeled ( r , s ) between C i and C k whenever there is a pair ( r , s ) with the property that r C i , s C k and r + s = 2 n 1 . The graph G Ψ has no loops but may have multiple edges connecting the same pair of vertices. The number of Hamiltonian cycles that can be constructed in this manner is equal to the number of subgraphs of G Ψ that are rooted spanning trees.
The following well-known counting formula is a variant of the BEST (de Bruijn, Ehrenfest, Smith and Tutte) Theorem. Further details on graphical approaches to the generation of full cycles, including the BEST Theorem and its history, can be found in Section 2 of [3]. The cofactor of entry m i , k in a matrix M : = ( m i , k ) is ( 1 ) i + k times the determinant of the matrix obtained by deleting the i th row and k th column of M.
Theorem 8.
(BEST) Let V : = { C 1 , , C j } be the vertex set of G Ψ . Let M = ( m i , k ) be the j × j matrix derived from G Ψ in which m i , i is the number of edges incident to C i , and m i , k is the negative of the number of edges between vertices C i and C k for i k . Then, the number of rooted spanning trees of G Ψ is the cofactor of any entry of M.
Example 6.
A randomized instance for n = 4 chooses
Ψ = ( 6 , 3 , 9 , 13 , 5 , 10 , 11 ) ( 4 , 7 , 1 , 2 ) ( 14 , 12 , 8 , 15 ) .
We label the cycles from left to right as C 1 , C 2 and C 3 to obtain the associated graph G Ψ in Figure 3.
The associated matrix is
M : = [ 3 2 1 2 4 2 1 2 3 ]
By the BEST Theorem, there are eight Hamiltonian cycles that can be constructed from Ψ. Table 4 lists them. All but one of the sequences have maximal linear complexity 14.
Figure 3. The associated graph G Ψ for Example 6.
Figure 3. The associated graph G Ψ for Example 6.
Mathematics 10 02577 g003
Table 4. The eight Hamiltonian cycles produced from Ψ by cycle joining in Example 6. For n = 4 , we have F ( x ) = 1 + x + x 2 + + x 14 . The edges a, b, c, d and e are specified in Figure 3.
Table 4. The eight Hamiltonian cycles produced from Ψ by cycle joining in Example 6. For n = 4 , we have F ( x ) = 1 + x + x 2 + + x 14 . The edges a, b, c, d and e are specified in Figure 3.
JoiningHamiltonian CycleModified de Bruijn Sequence s m s ( x )
a , c ( 6 , 3 , 9 , 2 , 4 , 8 , 15 , 14 , 12 , 7 , 1 , 13 , 5 , 10 , 11 ) ( 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 0 ) F ( x )
a , d ( 6 , 12 , 8 , 15 , 14 , 3 , 9 , 2 , 4 , 7 , 1 , 13 , 5 , 10 , 11 ) ( 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 0 ) F ( x )
b , c ( 6 , 3 , 9 , 13 , 5 , 10 , 4 , 8 , 15 , 14 , 12 , 7 , 1 , 2 , 11 ) ( 1 , 1 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 ) x 4 + x + 1
b , d ( 6 , 3 , 9 , 13 , 5 , 10 , 4 , 7 , 14 , 12 , 8 , 15 , 1 , 2 , 11 ) ( 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 0 , 0 , 1 , 1 , 0 , 1 , 0 ) F ( x )
e , a ( 6 , 12 , 8 , 15 , 14 , 3 , 9 , 2 , 4 , 7 , 1 , 13 , 5 , 10 , 11 ) ( 0 , 0 , 1 , 0 , 1 , 1 , 0 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 0 ) F ( x )
e , b ( 6 , 12 , 8 , 15 , 14 , 3 , 9 , 13 , 5 , 10 , 4 , 7 , 1 , 2 , 11 ) ( 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 1 , 0 , 1 , 0 ) F ( x )
e , c ( 6 , 12 , 7 , 1 , 2 , 4 , 8 , 15 , 14 , 3 , 9 , 13 , 5 , 10 , 11 ) ( 0 , 1 , 1 , 0 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 0 ) F ( x )
e , d ( 6 , 12 , 8 , 15 , 1 , 2 , 4 , 7 , 14 , 3 , 9 , 13 , 5 , 10 , 11 ) ( 0 , 0 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 1 , 1 , 1 , 0 , 1 , 0 ) F ( x )

5. The Canonical Generator Polynomial

In this section, we show that there exists a canonical generator c H ( x ) F 2 [ x ] for every Hamiltonian cycle H Γ n .
Corollary 2.
If H is a Hamiltonian cycle in Γ n , then there exists a polynomial g ( x ) F 2 [ x ] that generates H . The consecutive elements in
W g = { ( x i g ( x ) mod F ( x ) ) mod x n : 0 i < 2 n 1 }
form the Hamiltonian path in H .
Proof. 
Since H is a Hamiltonian cycle in Γ n , and Γ n is isomorphic to B n by Theorem 4, then H corresponds to a modified binary de Bruijn sequence s , which can be represented as g ( x ) F ( x ) , with deg ( g ( x ) ) < 2 n 2 . Lemma 2 ensures the existence of the required g ( x ) and, by Definition 1, g ( x ) generates H . □
We recall Lemma 1 before establishing our next result. If s is a modified binary de Bruijn sequence whose rational fraction representation is g ( x ) F ( x ) , for some g ( x ) F 2 [ x ] , then, for any 0 k < 2 n 1 , the rational fraction representation of the k-shifted sequence L k s in Equation (15) is g k ( x ) F ( x ) where g k ( x ) = g ( x ) x 2 n 1 k mod F ( x ) . Two polynomials g ( x ) and h ( x ) may generate the same Hamiltonian cycle H in Γ n . The following lemma explains how to relate the polynomials to one another.
Lemma 6.
Let n 4 be given, and let F ( x ) : = i = 0 2 n 2 x i = 1 + x + x 2 + + x 2 n 2 . Two polynomials g ( x ) and h ( x ) in F 2 [ x ] generate the same Hamiltonian cycle H in Γ n if and only if
h ( x ) = x k g ( x ) mod F ( x )   f o r   s o m e   0 k < 2 n 1 .
Proof. 
To verify that x 2 n 1 g ( x ) mod F ( x ) = g ( x ) , it suffices to use the fact that F ( x ) divides x 2 n 1 + 1 , which implies x 2 n 1 mod F ( x ) = 1 .
Let a ( x ) be any element of Ω . If g ( x ) and h ( x ) generate the same Hamiltonian cycle H , then there exist i and j, where 0 i , j < 2 n 1 , such that
a ( x ) = ( x i g ( x ) mod F ( x ) ) mod x n = ( x j h ( x ) mod F ( x ) ) mod x n .
If i j , then letting k : = i j yields
x k g ( x ) mod F ( x ) mod x n = h ( x ) .
If i < j , then multiplying both sides of (31) by x 2 n 1 gives us
x 2 n 1 + k g ( x ) mod F ( x ) mod x n = x 2 n 1 h ( x ) .
Since x 2 n 1 h ( x ) mod F ( x ) = h ( x ) , we conclude that
h ( x ) = x k g ( x ) mod F ( x ) mod x n .
Conversely, let h ( x ) = x k g ( x ) mod F ( x ) for some k with 0 k < 2 n 1 . We take two vertices A and B in Γ n that correspond, respectively, to
a ( x ) = x i h ( x ) mod F ( x ) mod x n   and b ( x ) = x i + 1 h ( x ) mod F ( x ) mod x n
for some 0 i < 2 n 1 . Then,
a ( x ) = x i x k g ( x ) mod F ( x ) mod x n   and b ( x ) = x i + 1 x k g ( x ) mod F ( x ) mod x n .
Using j : = ( i + k ) mod 2 n 2 , one writes
a ( x ) = x j g ( x ) mod F ( x ) mod x n   and b ( x ) = x j + 1 g ( x ) mod F ( x ) mod x n .
Thus, both g ( x ) and h ( x ) generate the same H in Γ n . □
Example 7.
Each of the polynomials
g ( x ) = x 10 + x 9 + x 7 + x 5 + x 4 + 1 , x g ( x ) = x 11 + x 10 + x 8 + x 6 + x 5 + x , x 2 g ( x ) = x 12 + x 11 + x 9 + x 7 + x 6 + x 2 , x 3 g ( x ) = x 13 + x 12 + x 10 + x 8 + x 7 + x 3 , x 4 g ( x ) = x 12 + x 10 + x 7 + x 6 + x 5 + x 3 + x 2 + x + 1 .
generates the Hamiltonian cycle H in Figure 1 Bottom.
Lemma 6 tells us to focus on the polynomial with the least degree that generates H . We formally define this polynomial.
Definition 3.
Let H be a Hamiltonian cycle in Γ n . The polynomial with the least degree ℓ among all of the polynomials that generate H is the canonical generator c H ( x ) of H .
Theorem 9.
Let n 4 be given, and let g ( x ) F ( x ) be a rational fraction representation of a modified binary de Bruijn sequence s . Then, there exists a polynomial g k ( x ) F 2 [ x ] of degree 2 n n 2 such that g k ( x ) F ( x ) is a rational fraction representation of the k-shifted sequence L k s for some 0 k < N . The polynomial g k ( x ) is the canonical generator of the Hamiltonian cycle H that corresponds to s .
Proof. 
We claim that deg ( g k ( x ) ) 2 n n 2 . Suppose, on the contrary, that there exists some r, with 0 r < 2 n 1 , such that deg ( g r ( x ) ) < 2 n n 2 . Let
[ n r ] = n r if   n r , n r + 2 n 1 if   n < r .
Then, g ( x ) x [ n r ] = g ( x ) x 2 n 1 r + n = g r ( x ) x n mod F ( x ) . Therefore,
g ( x ) x [ n r ] = ( 0 mod F ( x ) ) mod x n ,
which contradicts the fact that 0 Ω .
Next, we show the existence of g u ( x ) , for some 0 u < 2 n 1 , which satisfies deg ( g ( x ) ) = 2 n n 2 and g u ( 0 ) = 1 . Since Ω = { g k ( x ) mod x n : 0 k < 2 n 1 } , then there exists some t, with 0 t < 2 n 1 , such that g t ( x ) = x n 1 mod x n . If g t ( x ) = g ˜ t ( x ) x n + x n 1 with deg ( g ˜ t ( x ) ) < 2 n n 2 , then
g ( x ) x 2 n 1 t = g ˜ t ( x ) x n + x n 1 mod F ( x ) .
Since gcd ( x , F ( x ) ) = 1 , we multiply both sides by x 1 n . If u = ( t + n 1 ) mod ( 2 n 1 ) , then g ( x ) x 2 n 1 u = g u ( x ) = g ˜ t ( x ) x + 1 mod F ( x ) . Finally, we infer
deg ( g u ( x ) ) = deg ( g ˜ t ( x ) ) + 1 2 n n 2 .
Thus, deg ( g u ( x ) ) = 2 n n 2 . By Corollary 2 and Definition 3, we confirm that g k ( x ) is precisely c H ( x ) of s . □
Every Hamiltonian cycle H in Γ n has c H ( x ) of degree 2 n n 2 . We now show how to determine c H ( x ) for a given H .
Theorem 10.
If H is a Hamiltonian cycle in Γ n 4 and h n = i = 0 n 1 x i H , then its canonical generator c H ( x ) can be determined by the following procedure.
  • Begin by writing c H ( x ) = x 2 n n 2 + i = 1 2 n n 3 c i x i + 1 .
  • Let k = 0 , 1 , , 2 n 2 and i = 2 n 2 n k . Determine each c i by solving x n + k c H ( x ) = h n + k mod F ( x ) mod x n .
Proof. 
Since c H ( x ) : = x 2 n 2 n + i = 1 2 n n 3 c i x i + 1 and h n = i = 0 n 1 x i satisfies
h n = x n c H ( x ) mod F ( x ) mod x n ,
then the solution of x n + k c H ( x ) = h n + k mod F ( x ) mod x n determines the value of c 2 n 2 n k . Thus, all c i s can be determined. □
Example 8.
Let H Γ 4 be given in terms of its successive vertices
( 1 , 13 , 5 , 10 , 11 , 9 , 2 , 4 , 7 , 14 , 3 , 6 , 12 , 8 , 15 ) .
We have c H ( x ) = x 10 + i = 1 9 c i x i + 1 and F ( x ) = i = 0 14 x i . Hence, x 4 c H ( x ) = x 3 + x 2 + x + 1 , which is vertex 15. Consequently, ( c H ( x ) mod F ( x ) ) mod x 4 = x + 1 is vertex 3. Hence, c H ( x ) = x 10 + c 9 x 9 + c 8 x 8 + c 7 x 7 + c 6 x 6 + c 5 x 5 + c 4 x 4 + x + 1 . We iterate the process and read the resulting polynomials in terms of their vertices in Γ 4 . Since x 5 c H ( x ) is vertex 1, we obtain c 9 = 0 . Since x 6 c H ( x ) is vertex 13, we infer c 8 = 1 . We end with c H ( x ) = x 10 + x 8 + x 5 + x + 1 from Example 7.
Finally, we are ready to determine the minimal polynomial of a modified binary de Bruijn sequence.
Theorem 11.
Let F ( x ) = x 2 n 2 + x 2 n 3 + + x 2 + x + 1 . Let H be a Hamiltonian cycle in Γ n whose canonical generator is c H ( x ) . The reciprocal polynomial f * ( x ) of
f ( x ) = F ( x ) d ( x ) , w h e r e   d ( x ) : = gcd ( c H ( x ) , F ( x ) ) ,
is the minimal polynomial m s ( x ) of the modified de Bruijn sequence s that corresponds to the given H .
Proof. 
Since c H ( x ) is the canonical generator of H in Γ n , we know that
Ω = ( x i c H ( x ) mod F ( x ) ) mod x n : 0 i 2 n 2 .
Hence, c H ( x ) F ( x ) is a rational fraction representation of s . If d ( x ) = gcd ( c H ( x ) , F ( x ) ) , then
c H ( x ) = d ( x ) c ˜ ( x )   and   F ( x ) = d ( x ) f ( x ) .
Thus, c ˜ ( x ) f ( x ) is also a rational fraction representation of s , whose minimal polynomial is m s ( x ) = f * ( x ) . □
Example 9.
When n = 4 , the canonical polynomial c H ( x ) = x 10 + x 7 + x 5 + x + 1 generates the cycle of vertices ( 1 , 2 , 11 , 9 , 13 , 5 , 10 , 4 , 7 , 14 , 3 , 6 , 12 , 8 , 15 ) . The arcs forming the Hamiltonian path are
( 1 , 2 ) , ( 2 , 11 ) , ( 11 , 9 ) , ( 9 , 13 ) , ( 13 , 5 ) , ( 5 , 10 ) , ( 10 , 4 ) , ( 4 , 7 ) , ( 7 , 14 ) , ( 14 , 3 ) , ( 3 , 6 ) , ( 6 , 12 ) , ( 12 , 8 ) , ( 8 , 15 ) ,
and the corresponding sequence is s = ( 0 , 1 , 1 , 1 , 1 , 0 , 0 , 1 , 0 , 1 , 0 , 0 , 0 , 1 , 1 ) . Since d ( x ) = gcd ( F ( x ) , c H ( x ) ) = x 2 + x + 1 ,
m s ( x ) = f * ( x ) = f ( x ) = F ( x ) d ( x ) = x 12 + x 9 + x 6 + x 3 + 1 .

6. Conclusions and Future Works

This work provides a systematic method to determine the minimal polynomial of a modified binary de Bruijn sequence. As a concluding remark, we highlight that, if, for any n 3 , one can characterize the occasions for which gcd ( ( c H ( x ) , F ( x ) ) = 1 , then we can confirm that there exist modified de Bruijn sequences with maximal complexity 2 n 2 . The computational evidence for small values of n strongly suggests that most modified de Bruijn sequences have maximal complexity. Determining a closed formula for the number of such sequences is a worthy research challenge to solve.

Author Contributions

Conceptualization, M., I.E.W., D.J.E.P. and M.F.E.; investigation, M., I.E.W., D.J.E.P. and M.F.E.; writing—original draft preparation, M.; writing—review and editing, I.E.W., D.J.E.P. and M.F.E.; visualization, M.F.E.; supervision, I.E.W., D.J.E.P. and M.F.E.; project administration, M.; funding acquisition, M. and I.E.W. All authors have read and agreed to the published version of the manuscript.

Funding

Musthofa is supported by the Indonesian Endowment Fund for Education, known by its abbreviation LPDP in Bahasa Indonesia, a full-ride scholarship from the Indonesian Ministry of Finance. Nanyang Technological University Grant 04INS000047C230GRT01 supports the research conducted by M.F.E.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

References

  1. De Bruijn, N.G. A combinatorial problem. Proc. Sect. Sci. K. Ned. Akad. Wet. 1946, 49, 758–764. [Google Scholar]
  2. Sainte-Marie, C.F. Solution to question nr. 48. Interméd. Math. 1894, 1, 107–110. [Google Scholar]
  3. Fredricksen, H. A survey of full length nonlinear shift register cycle algorithms. SIAM Rev. 1982, 24, 195–221. [Google Scholar] [CrossRef]
  4. Chang, Z.; Ezerman, M.F.; Ling, S.; Wang, H. On binary de Bruijn sequences from LFSRs with arbitrary characteristic polynomials. Des. Codes Cryptogr. 2019, 87, 1137–1160. [Google Scholar] [CrossRef] [Green Version]
  5. Gabric, D.; Sawada, J.; Williams, A.; Wong, D. A successor rule framework for constructing k-ary de Bruijn sequences and universal cycles. IEEE Trans. Inform. Theory 2020, 66, 679–687. [Google Scholar] [CrossRef]
  6. Etzion, T. Linear complexity of de Bruijn sequences-old and new results. IEEE Trans. Inform. Theory 1999, 45, 693–698. [Google Scholar] [CrossRef]
  7. Chan, A.H.; Games, R.A.; Key, E.L. On the complexities of de Bruijn sequences. J. Comb. Theory Ser. A 1982, 33, 233–246. [Google Scholar] [CrossRef] [Green Version]
  8. Etzion, T.; Lempel, A. Construction of de Bruijn sequences of minimal complexity. IEEE Trans. Inform. Theory 1984, 30, 705–709. [Google Scholar] [CrossRef] [Green Version]
  9. Mayhew, G.; Golomb, S. Linear spans of modified de Bruijn sequences. IEEE Trans. Inform. Theory 1990, 36, 1166–1167. [Google Scholar] [CrossRef]
  10. Kyureghyan, G.M. Minimal polynomials of the modified de Bruijn sequences. Discrete Appl. Math. 2008, 156, 1549–1553. [Google Scholar] [CrossRef] [Green Version]
  11. Tan, L.; Xu, H.; Qi, W.-F. Preliminary results on the minimal polynomial of modified de Bruijn sequences. Finite Fields Appl. 2018, 50, 356–365. [Google Scholar] [CrossRef]
  12. Wang, H.-Y.; Zheng, Q.-X.; Wang, Z.-X.; Qi, W.-F. The minimal polynomials of modified de Bruijn sequences revisited. Finite Fields Appl. 2020, 68, 101735. [Google Scholar] [CrossRef]
  13. Lidl, R.; Niederreiter, H. Finite Fields, Encyclopaedia of Mathematics and Its Applications; Cambridge University Press: New York, NY, USA, 1997. [Google Scholar]
  14. Sloane, N.J.A. Sequence No. A0001037. In The Online Encyclopedia of Integer Sequences; The OEIS Foundation Inc.: Highland Park, NJ, USA, 2009; Available online: https://oeis.org/A0001037 (accessed on 20 June 2022).
  15. Good, I.J. Normal recurring decimals. J. London Math. Soc. 1946, s1-21, 167–169. [Google Scholar] [CrossRef]
  16. Kühn, D.; Osthus, D. A survey on Hamilton cycles in directed graphs. Eur. J. Comb. 2012, 33, 750–766. [Google Scholar] [CrossRef] [Green Version]
  17. Bang-Jensen, J.; Gutin, G.Z. Digraphs: Theory, Algorithms and Applications, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 2009. [Google Scholar]
  18. Chang, Z.; Ezerman, M.F.; Fahreza, A.A. On greedy algorithms for binary de Bruijn sequences. Appl. Algebra Eng. Commun. 2020. [Google Scholar] [CrossRef]
Table 1. The degrees of actual minimal polynomials of modified de Bruijn sequences of order n { 4 , 5 , 6 } , reproduced from [9].
Table 1. The degrees of actual minimal polynomials of modified de Bruijn sequences of order n { 4 , 5 , 6 } , reproduced from [9].
nDegrees of Actual Minimal Polynomials
4 4 , 12 , 14
5 5 , 15 , 20 , 25 , 30
6 6 , 27 , 30 , 32 , 33 , 35 , 36 , 38 , 39 , 41 , 42 , 44 , 45 , 47 , 48 , 50 , 51 , 53 , 54 , 56 , 57 , 59 , 60 , 62
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Musthofa; Wijayanti, I.E.; Palupi, D.J.E.; Ezerman, M.F. A New Approach to Determine the Minimal Polynomials of Binary Modified de Bruijn Sequences. Mathematics 2022, 10, 2577. https://doi.org/10.3390/math10152577

AMA Style

Musthofa, Wijayanti IE, Palupi DJE, Ezerman MF. A New Approach to Determine the Minimal Polynomials of Binary Modified de Bruijn Sequences. Mathematics. 2022; 10(15):2577. https://doi.org/10.3390/math10152577

Chicago/Turabian Style

Musthofa, Indah Emilia Wijayanti, Diah Junia Eksi Palupi, and Martianus Frederic Ezerman. 2022. "A New Approach to Determine the Minimal Polynomials of Binary Modified de Bruijn Sequences" Mathematics 10, no. 15: 2577. https://doi.org/10.3390/math10152577

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop