On the Existence of de Bruijn Tori with Two

by Two Windows

Glenn Hurlb ert

Department of

Arizona State University

Tempe Arizona USA

Chris J Mitchell

Department of Computer Science

Royal Holloway University of London

Egham Surrey TW EX UK

and



Kenneth G Paterson

Department of Mathematics

Royal Holloway University of London

Egham Surrey TW EX UK

May



This authors research supp orted by a Lloyds of London Tercentenary Foundation

Research Fellowship

Abstract

Necessary and sucient conditions for the existence of de Bruijn

Tori or Perfect Maps with two by two windows over any alphab et

are given This is the rst twodimensional window size for which

the existence question has b een completely answered for every alpha

b et The techniques used to construct these arrays utilise existing

results on Perfect Factors and Perfect MultiFactors in one and two

dimensions and involve new results on Perfect Factors with punctur

ing capabilities Finally the existence question for twodimensional

Perfect Factors is considered and is settled for two by two windows

and alphab ets of primep ower size

Introduction

A dimensional C ary de Bruijn or Perfect Map is a dimensional

p erio dic array with symbols drawn from an alphab et of size C having the

prop erty that every C ary array of some xed size o ccurs exactly once as a

subarray of the array More precisely in the notation of an R S u v

C

dBT is an R S p erio dic array with symbols drawn from a set of size C having

the prop erty that every p ossible u v array o ccurs exactly once as a p erio dic

subarray of the array The pair u v is often called the window of the torus

A variety of notations have b een introduced to describ e these arrays we use

that of

Perfect Factors are related ob jects which have proved useful in construc

u

C

tions for de Bruijn Tori an R u T PF is a set of T C ary p erio d R

C

R

sequences in which every C ary utuple o ccurs exactly once as a subsequence

The parameter u is often called the span of the sequences Perfect Factors

have b een extensively studied in Both de Bruijn Tori

and Perfect Factors are generalisations of the classical de Bruijn sequences

a de Bruijn sequence is a Perfect Factor with T ie

u

a C u PF while de Bruijn Tori are twodimensional analogues of de

C

u

Bruijn sequences We denote a C ary span u de Bruijn sequence by C u

C

u

dBS It was proved in that there exists a C u dBS for all integers

C

C and u

As noted in there are many applications for such ob jects

In two dimensions one can dene an R S u v T PF as a set of T

C

R S p erio dic arrays with symbols drawn from a set of size C having the

prop erty that every p ossible u v array o ccurs exactly once as a p erio dic

subarray in precisely one of the arrays Of course an R S u v PF is

C

simply an R S u v dBT

C

The following necessary conditions on the parameters of an R S u v

C

dBT are easily established

Lemma Suppose there exists an R S u v dBT Then

C

uv

i RS C

ii R u or R u

iii S v or S v

It has b een conjectured that these conditions are in fact also sucient

for the existence of de Bruijn Tori This has b een proved in a wide variety

of cases and we outline the relevant results next In contrast very little is

known ab out the existence of twodimensional Perfect Factors

Combining ideas from and the conditions of Lemma were shown

to b e sucient for the existence of an R S u v dBT in This work

2

was extended to alphab ets of primep ower size in Square de Bruijn Tori

ie R R u u dBT were considered in while some families of arrays

C

with u v were constructed in The existence question for de

Bruijn Tori over general alphab ets was studied in and higher

dimensional versions were considered in

The main result of is as follows Supp ose C has prime factorisation

k

Y

c

i

C p

i

i=1

uv

By Lemma RS C and so any prime dividing R or S also divides C

We can therefore write

k k

Y Y

r s

i i

R p S p

i i

i=1 i=1

for some r c uv where s c uv r R u and S v

i i i i i

Result Theorem Suppose C R and S have prime factorisations

as above and that for some i we have

r s

i i

p u and p v

i i

Then there exists an R S u v dBT

C

The parameter sets satisfying Lemma for which existence of de Bruijn

r

s

i

i

u or p Tori remains unsettled after Result are those where either p v

i

i

r

s

i

i

for each i The cases where either p u for every i or p v for every i

i

i

could b e resolved if the existence question for onedimensional Perfect Factors

were p ositively settled by using the generalisation of Etzions construction

given in Recent progress on this problem can b e found in

r

i

However there would still remain the mixed parameter sets where p u

i

s

i

for some indices and p v for other indices Our purp ose in this pap er

i

is to develop new construction metho ds for these mixed parameters in the

simplest nontrivial case where u v We are then able to settle the

existence question for de Bruijn Tori with u v

In a mixed parameter set with u v one of the following two cases

must o ccur for each i

p and r c or c

i i i i

p and r or c

i i i

The case where every r is either or c is covered by the following result

i i

which we prove in Section partially answering a question of

4 4

Theorem Suppose m n Then there exists an m n dBT

mn

We consider another sub case in Section where p r and r c

1 1 i i

for i Our main result in that section is

Theorem Suppose n is odd Then for every c there exists a

4 4c1

c

n dBT

2 n

The pro ofs of Theorems and rest on the construction of some sp ecial

classes of onedimensional Perfect Factors in Section The sequences of

these Factors have what we call puncturing capabilities a generalisation

of the notion of the puncturing of de Bruijn sequences In Section we

combine Theorems and with some results from to obtain

Theorem The necessary conditions of Lemma are sucient for the ex

istence of an R S dBT

C

Theorem provides the rst instance where necessary and sucient con

ditions are known for the existence of de Bruijn Tori with a xed two

dimensional window size over all alphab ets

Having solved the existence problem for de Bruijn Tori with windows

we go on to investigate the analogous problem for R S T PFs in

C

Section We obtain a complete answer in the case where C is a prime

p ower

Theorem Let p be a prime and c r s and t be integers The conditions

r s

that p p and r s t c are necessary and sucient for the existence

r s t

c

of a p p p PF

p

We close with some op en questions

Some Classes of Perfect Factors

Perfect MultiFactors

We introduce a class of combinatorial ob jects which have proved useful in

the construction of Perfect Factors In order to unify the presentation we

use notation dierent from that found in Additionally we say that a

v tuple appears in a sequence at position

0 1 v 1 0 1

z if

z z +1 z +v 1 0 1 v 1

Denition Suppose m n C and u are positive integers which sat

u

isfy mjC and C An R u T n Perfect MultiFactor or simply a

C

u

R u T nPMF is a set of T C m C ary sequences of period R mn

C

with the property that for every C ary utuple and integer j with j n

occurs at a position z with z j mo d n in one of the sequences

Result Theorem Suppose n C u are positive integers C

u

and n u Then there exists an n u C nPMF containing the al lzero

C

sequence

Lemma Suppose n C l are positive integers with n C Let z

0

z z z n be a sequence of integers with z z for j

1 l1 l j +1 j

2

l Then there exists an n C nPMF with sequences

C

i j i j C

having the property that sequence i j of the PMF satises

i j i j i j i

z z z

0 1

l1

we say that i j is constant in positions z z z Moreover when

0 1 l1

l C the PMF can be constructed so that sequence i j also satises

i j i j i

z z +1

j j

we say that i j is constant in positions z and z

j j

Proof Since R z z for j l there exists for each

j j +1 j

2 j

j an R C R PMF A as in Result Our aim is to concatenate

j C j

j

sequences from each A to form sequences of p erio d n which comprise the

required PMF

j j

Let a b denote the unique sequence in A which b egins with the

j

tuple a b and let L a b denote the last symbol of that sequence Let

j

j j

X f i b b C g Because of the dening prop erty of A the list

i

j j j

L i L i L i c

j

consisting of the nal symbols of the sequences in X is a p ermutation

i

0

of f C g Thus concatenating each sequence in X with each

i

1 2

sequence of X in any pairing for each i pro duces a set of C sequences

i

2

that constitute a z C z PMF

2 C 2

More generally if we denote the concatenation of a list of l sequences

i

l by l and if is a p ermutation of

j

f C g for each i C and each j l we have

2

that the C sequences

l1 i 1 i 0 i

j i j C j i j i i j i

l1 1 0

2

constitute an n C nPMF It is clear that the sequences i j satisfy

C

i j i j i j i so that the rst condition in the

z z z

0 1

l1

statement of the lemma holds

i

for i Now supp ose that l C In dening the p ermutations

j

C and j l we additionally sp ecify that

i

j i i j C

j

Then tuple i i app ears in sequence i j at p osition z and the second

j

condition in the statement of the lemma is satised 2

Puncturing and Joining Sequences

Let K denote the complete directed graph with lo ops on m vertices An

m

mary span de Bruijn sequence corresp onds to an Eulerian circuit in K

m

while an R T PF corresp onds to a T set of length R edge

m

disjoint circuits in K More generally an mary sequence of p erio d k whose

m

tuples within a p erio d are distinct corresp onds to a circuit of k distinct

edges in K We dene a k puncture in K to b e such a circuit We say

m m

that a p erio dic sequence whose tuples within a p erio d are

0 1

distinct has a k puncture at p osition z if and thus the p erio dic

z z +k

sequence corresp onds to a k puncture in K It is easy to see

z z +k 1 m

that if has such a puncture then the terms can b e removed

z z +k 1

0

from the sequence leaving a sequence whose tuples are still distinct

the tuples removed b eing those which o ccur in the puncture Naturally

we call the pro cess of removing a k puncture puncturing As an example a

puncture in is just the o ccurrence of consecutive identical symbols in

and corresp onds to a lo op edge in K

m

We also need to consider an op eration on sequences that is a kind of

inverse to puncturing This pro cess which we call joining is already well

known Let C b e a circuit of k distinct edges and C a circuit of k

1 1 2 2

distinct edges in K Supp ose that C has edge set E i and that

m i i

E and E are disjoint So C and C corresp ond to p erio dic sequences

1 2 1 2

and which have disjoint sets of tuples as their subsequences If C and

1

C have a vertex in common ie and have a common term then

2

we say that C and C and sequences are adjacent Supp ose C

1 2 1

is comprised of the ordered list of vertices v v v and C the list of

1 2 k 2

1

vertices w w w and that v w for some i and j so that C and

1 2 k i j 1

2

C are adjacent Then it is easy to see that the list

2

v v w w w w v v

1 i j +1 k 0 j i+1 k

2 1

is the vertex list of a circuit C of k k distinct edges in K whose edge

1 2 m

set is E E We say that C is obtained by joining C and C The

1 2 1 2

cycle C corresp onds to a sequence which has p erio d k k contains as

1 2

subsequences exactly those tuples o ccurring in and and has as a

k puncture i i

i

Now supp ose we have a collection X of edge disjoint circuits in K We

m

can dene an undirected adjacency graph GX for these circuits using the

denition of adjacency for circuits given ab ove Supp ose GX is a connected

graph Then rep eatedly using the joining pro cess describ ed ab ove on a span

ning tree for GX we can join all the circuits in X to form a single circuit

that covers exactly the same edges as were covered by the circuits in X

Construction of Perfect Factors

In this subsection we will construct some classes of Perfect Factors with

various puncturing prop erties These are used in the pro ofs of Theorems

and Our main to ol will b e our construction for PMFs in Lemma and

x

Result b elow For any sequence we denote by the concatenation

of with itself x times

Result Construction and Theorem Suppose there exists an

n u t PF with sequences t and an mn u t nPMF

1 C 1 2 D

with sequences t Dene i j to be the CD ary sequence

2

m

i C j of period mn Then the set of cycles f i j i t

1

j t g is an mn u t t PF

2 1 2 CD

2 2

Lemma Suppose m n Then there exists an m n PF in

mn

which every sequence has a puncture

Proof For m n the nite sequence

n n

corresp onds to a path of distinct edges in K Let G denote the graph ob

m

tained from K by removing these edges of from K It is easy to see that

m m

G is connected for every vertex in G is joined to vertex m by a pair of

opp ositely directed edges Moreover every vertex in G has indegree and

outdegree equal except vertex with indegree m and outdegree m

and vertex n with indegree m and outdegree m So G has an

Eulerian trail b eginning at vertex n and ending at vertex Concate

nating and results in an Eulerian circuit of K The corresp onding de

m

Bruijn sequence has punctures at p ositions n

2

We dene z j j n and z m By Lemma there exists

j n

2 2 2

an m n m PMF in which each sequence is constant in some pair of

n

p ositions z z where j n We denote the sequences of this

j j

2 2

PMF by n We apply Result to and n

2 2 2

to obtain an m n PF with sequences i m i i n

mn

Because is constant in every pair of p ositions z z j n

j j

and each i is constant in one of these pairs we have that each i is

constant in one of these pairs Hence each i has a puncture and the

2 2

m n PF has the required prop erties 2

mn

2 2

Lemma Suppose m and n Then there exists an n m

mn

PF in which every sequence has a puncture

Proof By considering paths in K it is easy to see that for n there

n

exists an nary span de Bruijn sequence that b egins ie has a

2

puncture at p osition We dene z z and z n Using

0 1 2

2 2 2

Lemma we can construct an n m n PMF in which each sequence

m

is constant in p ositions z and z From the denition of a PMF

0 1

for every tuple i j i j m there is a unique sequence of the

2 2 2

n m n PMF having i j at p osition We denote this sequence by

m

2 2

i j We apply Result to obtain an n m PF with sequences

mn

i j n i j i j m in which each sequence is constant in

p ositions and ie has a puncture at p osition 2

With notation as in the ab ove pro of let

f i j j j mg i m

i

From the construction of the i j each sequence in has symbol ni

i

in p osition So the adjacency graph for the set of edgedisjoint circuits

corresp onding to is the complete graph on m vertices

i

Moreover for i i and j with i i j m the sequences i j

1 2 1 2 1

and i j have symbol nj in p osition and so any two sets and

2 i

1

contain adjacent sequences

i

2

From these observations it follows that we can select from a connected

2

set of n sequences provided that m n These sequences can b e joined to

4 2 2

obtain a single sequence of p erio d n leaving m n sequences of p erio d

2

n We have

Corollary Suppose m n Then there exists a set of mnary

4 2 2

sequences consisting of one sequence of period n and m n sequences of

2

with the properties that period n

i each mnary tuple occurs exactly once as a subsequence of a sequence

in the set

2

ii each sequence of period n in the set contains a puncture

Lemma Suppose n is odd Then for every c there exists a

2 2c1

c

n PF in which every sequence has a puncture

2 n

2 2c1 2

c

Proof We initially aim to construct a n n PMF in which

2

every sequence is constant in p ositions and In the case where c it

2

is easily veried using the fact that n is o dd that the following pair

2 2

of sequences constitute a n n PMF with the required prop erty

2

2

Here sequence consists of n o ccurrences of followed by while

2 2

sequence consists of n zeros then n ones and nally zeros

2 2c2 2

c1

When c we further construct using Lemma a n n

2

2c2

PMF with sequences i i in which every sequence is constant

in p ositions and We then combine this PMF and the PMF to

c

obtain a new set of ary sequences i j where

c1 2c2

i j i j i j

It is easy to see that every sequence in this set is constant in p ositions

and It is only slightly more dicult to show that the set is in fact a

2 2c1 2

c

n n PMF This can b e shown along the lines of the pro of of

2

Theorem of

Let b e an nary span de Bruijn sequence b eginning ie having

2

a puncture in p osition We apply Result with the n PF and

n

2 2c1 2 2 2c1

c c

our n n PMF to obtain a n PF with sequences

2 2 n

2 2c2

i j n i j i j

Because and each i j are constant in p ositions and so is each i j

Hence each i j has a puncture at p osition and the PF has the required

prop erties 2

Construction of an (m n ; 2 2) dBT

mn

x

As b efore for any sequence we let denote the concatenation of with

+ +

itself x times If has a k puncture at p osition then we write

k + R R

and dene where R is the p erio d of We dene the shift

op erator E by E E and dene

0 1 R1 1 R1 0

x x1

E E E

0

Now supp ose that and are C ary sequences of p erio d R each con

+

taining R distinct tuples and that has a k puncture where R and k

are coprime In the next lemma we consider the tuples o ccurring in the

2 0 R k + R R

p erio d R sequences and

0

Lemma With notation as above let be a tuple occurring in and

0 2

a tuple occurring in Then there exists a unique i with i R such

k 0 0 R

that appears at position i in and appears at position i in

0 0

Proof Supp ose that app ears in at p osition j and app ears in at

0 +

p osition j If j k then app ears in and consequently in p ositions

j l k l R

k

in On the other hand if k j R then app ears in and so in

p ositions

Rk j k l R k l R

k

in In either case b ecause k is coprime to R the R p ositions at which

k

app ears in are all distinct mo dulo R So exactly one of them is congruent

0 0 0

to j mo dulo R But app ears in every p osition congruent to j mo dulo R in

0 R 0

So and app ear exactly once in the same p osition in the sequences

k 0 R

and 2

k 0 R

It follows from Lemma that if and are placed sidebyside then

every tuple that app ears in o ccurs alongside every tuple that app ears

0 k 0 R

in exactly once We say that and are coprime

We can now sketch the idea b ehind our novel construction metho d for

4 4 2

m n de Bruijn Tori Supp ose that k is coprime to m and we can

mn

2 2 2

nd an m n PF with sequences n in which every

mn

2

sequence has a k puncture For each i with i n we form the p erio d

2 2 2

4 0 m k + m m

m sequences i i and i i i We arrange

these sequences as the columns of an array in such a way that for every i j

2

with i j n one of the coprime pairs

0 k k 0

i j or i j

app ears as a pair of consecutive columns in the array Such pairings ensure

that all the subarrays whose rst column comes from i and whose

second column comes from j app ear in the array Because the i form

a PF and we have pairings for all sequences i j we will obtain a de

Bruijn Torus This idea and variations on it lie at the heart of our pro of of

Theorem

Proof of Theorem Supp ose that m n We consider three cases

dep ending on the parities of m and n

We b egin with the simplest case in which n is even and m has either

2 2 2

parity Let n b e the sequences of the m n PF

mn

from Lemma with each sequence having a puncture Let

0 1

4 4

2

b e an n dBS We build an array A with columns A j n as

j

n

0

follows If j is even then we take A If j is o dd then we take

j j

1

A Notice that that we alternate the use of and punctures

j j

so any pair of consecutive columns of A are coprime Because n is even the

1

4 4 4

nal column A is equal to Thus column A and column A

0

n 1 n 1 n 1

are also a coprime pair

4 4

We claim that A is an m n dBT If B is any mnary ma

mn

2 2

trix whose columns are and then by the denition of an m n

1 2 mn

PF there is some i such that app ears in i and there is some j such

1

4

2

that app ears in j Also by the denition of an n dBS there

2

n

4

is a unique p osition h with h n such that i j Let

h h+1

h h

1 2

h h mo d and h h mo d Then i and j o ccur consecu

1 2

tively in A as columns h and h Because of their coprimality B app ears

in these two columns in a unique p osition

In the second case we assume that m is even and n is o dd We will

4 4

construct an n m dBT whose transp ose is a torus with the desired

mn

2 2 2

parameters Let m b e the sequences of the n m PF

mn

+

from Lemma with each sequence i having a puncture i Notice

2 4

that and n are coprime so for each i j with i j m the p erio d n

2 2 2

0 n 2 + n n

sequences i i and j i i are coprime Let

4

2

b e an m dBS We build an array B with columns A

0 1 j

m

4 0

j m as follows If j is even then we take A If j is o dd

j j

1

then we take A Once again any pair of consecutive columns of

j j

4

A are coprime Also since m is even columns A and A are a coprime

0

m 1

4 4

pair We claim that B is indeed an n m dBT the pro of of this

mn

claim is almost identical to the argument in the rst case

In the third and most complex case we have b oth m and n o dd so

m n We can no longer use alternating punctures to build the

columns of our array as in the rst two cases ab ove b ecause the last and

rst columns would never b e coprime We use the PF of Corollary to deal

4 2 2

with this problem Let of p erio d n and i i m n each of

2

p erio d n b e a set of sequences having prop erties i and ii of Corollary

+

Let i denote the puncture in i Notice that and n are coprime so

2

2 2 4 0 n

for each i j with i j m n the p erio d n sequences i i

2 2

2 + n n

and j i i are a coprime pair

Consider the pairs of sequences in the following list

i

4

E i n

i 0

2 2 2

E j i n j m n

i 0

2 2 2

E j i n j m n

0 2 2 0

2 2

i j or i j i j m n

The rst set of pairs ensure that every tuple of o ccurs alongside every

tuple from while the second and third sets cover the cases where a tuple

from app ears with a tuple from a sequence j and viceversa In view

of the coprimalities established ab ove the nal set covers the cases where a

tuple from a sequence i app ears with a tuple from another sequence

4 4

i Thus if we can construct an n m array C in such a way that the

set of pairs of consecutive columns of C are exactly the pairs in the ab ove

4 4

list then C will b e an n m dBT as needed

mn

4

So it remains to sp ecify how the columns C j m of C can b e

j

4

arranged so as to satisfy the ab ove condition Let b e the

0 1

n

P

i1

4

sequence with and j mo d n Notice that b ecause n is o dd

0 i

j =0

4 4

j

4 4

mo d n We b egin by taking C E j n So C is just

j

n n

2 2 2

4

the sequence As columns C j n m n we also take the

n +2j

2 2 2

4

sequence while for columns C j n m n we take the

n +2j +1

following ordered list of sequences

2

1 0 2 0 n 1 0

E E E

2

0

1 0 2 0 n 1 0

E E E E

2

0 0 0

1 0 2 0 n 1 0

E l E l E l E l E

2 2 2 2 2

2 2

where l m n Finally let b e an m n dBS b eginning

m n

2 2 2

and ending with Then for the last m n columns we take

2 0 2 0 0

2 2 2

0 1 2 3

(m n ) 1

so that in these columns we alternate the use of and punctures with the

choice of sequence b eing determined by the terms of Notice that column

0 2 2 2

4

C is equal to b ecause m n is even and when matched with

m 1

0 0

column C accounts for the pair E missing from the description

0

of the middle third of C With this hint it is straightforward to check that

all the required pairings do app ear using this sp ecication of columns This

completes the pro of in the third case 2

c

c

Construction of a (2n 2 ; 2 2) dBT

n

2c1

Proof of Theorem Let i i b e the sequences of a

2 2c1

c

n PF from Lemma Using similar notation as b efore we

2 n

+ +

dene i to b e the puncture in i We also write i i i

2 2

 4 n  + n

so that i has p erio d n Since i and dene i i

2 2 

gcdn n it is easy to see from the construction of i that



any tuple app earing as a subsequence of i do es so in i either once

2 2

in every even p osition mo dulo n or once in every o dd p osition mo dulo n

 

Thus the pair of sequences i E i have the prop erty that b etween

them they contain every tuple app earing in i in every p osition mo dulo

2

n

4 4c1

We aim to build an n array A with the prop erty that for any i j

there are two pairs of adjacent columns in A which b etween them account

for an o ccurrence of every tuple in i alongside every tuple in j To

2

  n

i and E i as columns and ensure do this we use the sequences i

that for every i j A contains as consecutive columns either the pairs

2 2

n  n 

i j and i E j

or the pairs

2 2

 n  n

i j and E i j

4c1

We dene the arrangement of columns A j as follows We

j

4c2

2c1

take to b e the concatenation of a dBS with itself so has

2

2

4c1 n

length If j is even then we take column A to b e If j is o dd

j j

4c2  4c2

and j then we take A If j is o dd and j then we

j j

 4 4c1

c

take A E We claim that A is indeed an n dBT

j j 2 n

In view of the ab ove discussion it suces to note that using the doubled de

Bruijn sequence in the way indicated guarantees that all the sp ecied pairs

of columns do app ear 2

De Bruijn Tori with 2  2 Windows

We b egin with some results on dimensional Perfect MultiFactors from

These will b e used in the pro of of Theorem

Denition Let m m n n C u and v be positive integers with c

1 2 1 2

uv

and m m jC A dimensional m n m n u v T n n PMF is a set

1 2 1 1 2 2 C 1 2

uv

of T C m m dimensional C ary arrays of period m n m n with

1 2 1 1 2 2

the property that for every C ary u v array A and for every i j with

i n j n A occurs at a position z z with

1 2 1 2

z i mo d n

1 1

z j mo d n

2 2

in one of the arrays

Result Lemma Suppose there exists an n n u v dBT and

1 2 C

an m n m n u v n n PMF Then there exists an

1 1 2 2 D 1 2

m n m n u v dBT

1 1 2 2 CD

Result Theorem Suppose u v and m n and n sat

1 1 2

u

isfy m jD n u and n v Suppose further that in the case where

1 1 2

u

v m is even and n is odd we have m jD Then there exists an

1 2 1

m n m n u v n n PMF

1 1 2 2 D 1 2

Proof of Theorem Supp ose C has prime factorisation

k

Y

c

i

p C

i

i=1

Write

k k

Y Y

r 4c r

i i i

R p S p

i i

i=1 i=1

with R S From the discussion in Section to prove Theorem it is

sucient to assume that for each i one of the following cases o ccurs

p and r c or c

i i i i

p and r or c

i i i

Consider the case where every r is either or c Then writing m

i i

Q

c

i

p and n C m we certainly have m n Because of symmetry

r =4c

i

i i

we may assume m n An application of Theorem then shows that an

R S dBT exists

C

We are left to consider the cases where p and r or c In

1 1 1

what follows we assume that r tori with p and r c are

1 1 1 1

easily obtained by transp osing tori of this type Note that we cannot have

Q

r

k

i

So r c r for each i since then we would have R p

i i i

i

i=1

for some i We consider two further cases

Firstly supp ose that r c i k Then we want to construct a

i i

Q

k

4 4c 1 c

1 i

c

n dBT where n p is o dd Such a torus can b e

1

2 n i

i=2

obtained from Theorem

Otherwise some r is zero and another is equal to c We write m

i i

Q

c

c c

i

1 1

and n C m so that m n m n and C mn Using p

r =4c

i

i i

4 4

Theorem and transp osition if n m there exists a m n dBT

mn

4 4c 1 4 4 4

1

c

From Result we can obtain a m n m n PMF By

1

2

4 4c 1 4

1

c

Result there exists a m n dBT ie a

1

2 mn

4 4c 1 4

1

m n dBT as required 2

C

TwoDimensional Perfect Factors

Theorem settles the existence question for de Bruijn Tori with win

dows It is interesting to consider the generalisation of this question to the

case of twodimensional Perfect Factors As well as b eing of mathematical in

terest in their own right these will b e fundamental in building dimensional

de Bruijn Tori Similar conditions to those of Lemma can b e derived for

uv

the parameters of a Perfect Factor condition i simply b ecomes RS T C

We also have the following two results whose pro ofs use a generalisation of

metho ds dating back to Ma and Etzion similar metho ds have also

b een successfully used in Let the weight of a sequence

b e the sum of its entries

uv

Theorem Suppose that RS T C and there exists an R u T PF

1 C

u

where T C R Suppose further that one of the fol lowing two cases

1

occurs

v 1 v

i T jR and there exists an S v T T PMF in which each se

R

1

quence has weight mo d R or

v 1 v

ii R jT and there exists an S v T S PF and an

T

1 1

v 1

S v R S PMF each sequence of the latter having weight

R

mo d R

Then there exists an R S u v T PF

C

Proof We give a construction for what we claim is an R S u v T PF

C

The construction diers slightly in each of the two cases Let i i

v 1

T b e the sequences of the R u T PF In case i the condition T jR

1 1 C

v v

v dBS concatenated with divides S We let b e a T implies that T

T

1

1 1

v 1 v

times In case ii the condition R jT implies that S divides itself ST

1

v v v

S PF S b e the sequences of the S v T and we let i i T T

T

1 1 1 1

Finally in each case we let i b e the sequences of the appropriate PMF

and for each i dene a new sequence i i i by

0 1

if j

P

i

j

j 1

i mo d R if j

k

k =0

Because of the condition on the weight of the PMF sequences each sequence

i has p erio d S

Next we dene a T set of R S arrays Ai j In case i we have

v

i and j T while in case ii we have i T S and

1

v 1

j R In either case we take column k of array Ai j to b e the

(j )

k

sequence E i

k

The pro of that the set of arrays Ai j is a PF with the required param

eters is omitted but as we have already intimated can b e constructed along

the lines of the pro of of Theorem for example 2

Proof of Theorem The necessity is obvious If p the theorem has

b een proven in Lemma so we assume here that p Because

of symmetry we may assume that r s and so r c Hence there is a

r 2cr

c

p p PF by Theorem of If t r then we come under case i

p

s(r t)

of Theorem In this case there is a p dBS A simple way to

(2cr )

p

v r

obtain the S v T T PMF is to puncture the sequence p

R

1

sr sr

p r p

at That is for the sequence p the set of

sr

k p t s t s(r t)

r

sequences fE j k p g form a p p p PMF each

p

r

sequence of which has weight mo d p If t r then we come under case ii

s tr

of Theorem In this case there is a p p PF by Theorem of

(2cr )

p

s r s

r

Finally the simplest way to nd a p p p PMF each sequence

p

s

r p r

of which has weight mo d p is to use the sequences i for each i p

In either case an application of Theorem nishes the pro of 2

It is of course p ossible to combine twodimensional PFs over dierent

primep ower alphab ets to pro duce PFs over general alphab ets supp ose C

Q Q Q

k k k

c r s

i i i

has prime factorisation C p and let R p S p and

i i i

i=1 i=1 i=1

Q

k

4c r s

i i i

T p for some r s with r s c and R u S v

i i i i i i

i=1

Then the pro of of the following corollary of Theorem is a straightforward

generalisation of Lemma

Corollary Suppose that C R S and T are as above and

r s

i i

p and p i k

i i

Then there exists an R S T PF

C

This corollary takes us quite some way to answering the existence question for

twodimensional PFs with windows We ask is it p ossible to generalise

the techniques of Sections and of this pap er to settle this question

We nish with op en questions ab out a much more general problem Let

the dimension d b e an integer the period R hR R i b e a vector of

1 d

integers the window W hW W i b e a vector of integers the size T

1 d

and base C b e integers and the modulus M hM M i b e a vector

1 d

Q Q

W and R W of integers satisfying M jR for each i Let R

i i i i

i i

Q

d

M and dene an R W T M M PMF analogously to Denition

i

i

C

Then the following necessary conditions are straightforward to establish

d

Lemma Suppose there exists an R W T M PMF Then

C

W

i RT C M and

ii for each i d either

a M and R W or

i i i

b M and R W

i i i

It is tempting to conjecture that these conditions are also sucient for

the existence of PMFs in arbitrary dimension d Conjecture of is

that the same is true in one dimension but even this sp ecial case is still

op en Notice that settling this question for arbitrary d includes as sp ecial

cases settling Conjecture of and the main conjecture of b oth on

de Bruijn Tori in two dimensions Also relevant is Conjecture of A

few constructions for PMFs in two dimensions can b e found in and for

higherdimensional de Bruijn Tori in Clearly there is much scop e for

future work in this area

Acknowledgement

We would like to thank the referee for some imp ortant comments on the

original version of this pap er

References

T Van Aardenne Ehrenfest and NG de Bruijn Circuits and trees in

oriented linear graphs in I Gessel and GC Rota editors Classic

pap ers in Birkhauser Boston Reprinted from

Simon Stevin

J Burns and CJ Mitchell Co ding schemes for twodimensional p osition

sensing in M Ganley editor Cryptography and Co ding I I I Oxford

University Press

JC Co ck Toroidal tilings from de BruijnGo o d cyclic sequences Dis

crete Math

NG de Bruijn A combinatorial problem Proc Kon Ned Akad

Wetensch

T Etzion Constructions for Perfect Maps and pseudorandom arrays

IEEE Transactions on Information Theory IT

CT Fan SM Fan SL Ma and MK Siu On de Bruijn arrays Ars

Combinatoria A

C FlyeSainte Marie Solution to problem number Intermediare

Math

H Fredricksen A Survey of Full Length Shift Register Cycle Algorithms

SIAM Review

IJ Go o d Normally recurring decimals J London Math Soc

G Hurlb ert and G Isaak On the de Bruijn torus problem Journal of

Combinatorial Theory Series A

G Hurlb ert and G Isaak A Meshing Technique for de Bruijn Tori

Contemporary Mathematics

G Hurlb ert and G Isaak New Constructions for de Bruijn Tori De

signs Codes and Cryptography

G Hurlb ert and G Isaak On higher dimensional Perfect Factors Ars

Combinatoria in press

SL Ma A note on binary arrays with a certain window prop erty IEEE

Transactions on Information Theory IT

CJ Mitchell Constructing cary Perfect Factors Designs Codes and

Cryptography

CJ Mitchell New cary Perfect Factors in the de Bruijn graph in PG

Farrell ed Co des and Cyphers Cryptography and Co ding IV

IMA Press SouthendOnSea Essex

CJ Mitchell Some Perfect Factors in the de Bruijn Graph SIAM Jour

nal on Discrete Mathematics submitted

KG Paterson Perfect Factors in the de Bruijn Graph Designs Codes

and Cryptography

KG Paterson Perfect Maps IEEE Transactions on Information The

ory IT

KG Paterson New classes of Perfect Maps I Journal of Combinatorial

Theory Series A

KG Paterson New classes of Perfect Maps I I Journal of Combinatorial

Theory Series A