Professional Documents
Culture Documents
Non-Overlapping Matrices
Non-Overlapping Matrices
Elena Barcucci
Antonio Bernini
Renzo Pinzani
Stefano Bilotta
Abstract
Two matrices are said non-overlapping if one of them can not be
put on the other one in a way such that the corresponding entries
coincide. We provide a set of non-overlapping binary matrices and
a formula to enumerate it which involves the k-generalized Fibonacci
numbers. Moreover, the generating function for the enumerating sequence is easily seen to be rational.
Introduction
A string u over a finite alphabet is said self non-overlapping (or equivalently unbordered or bifix-free) if it does not contain proper prefixes which
are also proper suffixes. In other words, a string u is unbordered if
it can not be factorized as u = vu0 v with v + and u0 . Nielsen in
[13] provided the set X n of all bifix-free strings by means of a recursive construction. More recently, several researches [5, 7, 8, 9] have been
conducted in order to define particular subsets of X constituted by nonoverlapping (or cross-bifix-free) strings: two n length strings u, v X are
said non-overlapping if any non-empty proper prefix of u is different from
any non-empty proper suffix of v, and viceversa.
In [3] the notion of unbordered strings is generalized to the two dimensional case by means of unbordered pictures which are rectangular matrices
over by imposing that all possible overlaps between two copies of the same
picture are forbidden. In particular, the authors extend in two dimensions
the construction of unbordered strings proposed in [13] and describe an algorithm to generate the set U of all the unbordered pictures of fixed size
m n.
The aim of the present paper is to find a subset of unbordered matrices
which are non-overlapping. As well as the sets given in [5, 7, 8, 9] are nonoverlapping subsets (or cross-bifix-free subsets) of strings of X, in the same
For example,
the unbordered matrices
1 0 0 1 1
0 1 1 0 0
A = 0 1 0 1 1 and B = 1 1 0 0 0 can be overlapped as in
0 1 1 1 0
1 0 1 1 1
Figure 1 where the control window is showed.
1 0 0 1
0 1 0 1
0 1 1 1
1 0
1
1 0 0
0 0 0
1 1 1
0
0
0
0
(3)
In other words, some entries on the frame of a matrix in Smn are fixed.
(3)
For example, the matrices in S610 are represented in Figure 2 where the
generic entries {0, 1} are chosen so that the conditions of Definition 2.3
(2)
are satisfied. We note that for k = 2 and n odd the set Smn can not be
defined since the strings vi can not avoid both 00 and 11.
4
(k)
Proposition 2.1
The set Smn Mmn is non-overlapping, for each k
n
with 3 k 2 , m 2 and n 2k.
(k)
Proof.
Given to matrices A, B Smn , we present two possible slippings of B on A (without loss of generality A and B can be interchanged).
1. In the case represented in Figure 3 the obtained control window contains, in its lower row, a string having k consecutive equal symbols.
If A and B would be overlapping matrices, then these k consecutive
equal symbols, belonging to the frame of B, should also appear in a
(k)
row vi of A, against the hypothesis that A Smn .
1 1 0
1 1 0
A =
1 1 1
1 0 0
0
0
1 1 1
0
0
0 0 0
1 0 0
0
0
0
0
0 0 0
=B
Figure 3: The slipping of case 1: the grey entries are a forbidden sequence
of A.
1 1 0
1 1 0
A =
1 1 1
1 0 0
0
0
1 1
0
0 0 0
1 0 0
0
0
0
0
0 0 0
=B
Figure 4: The slipping of case 2: the grey entry contains different values of
A and B.
(k)
(1)
(k)
where, referring to Definition 2.3, the term rn2k+2 counts the number of
(k)
3.1
(k)
The sequence rn
(k)
k
X
(h
(k)
1)rnh
2k2
X
h=k+1
h=2
Summarizing:
rn(k) =
2n2
k
2k2
X
X
(k)
(k)
(h
1)r
+
(2k h 1)rnh
nh
h=2
(k)
(2k h 1)rnh .
if n = 0
if n = 1
if 2 n k
if n k + 1.
h=k+1
(k)
(k)
strings u leading to a recurrence for rn which involves also the term rn1 .
7
HH k
n HH
H
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1
0
1
2
2
4
7
10
17
28
44
72
117
188
305
494
1
0
1
2
4
6
12
22
41
74
137
252
464
852
1568
2884
1
0
1
2
4
8
14
28
54
104
201
386
745
1436
2768
5336
1
0
1
2
4
8
16
30
60
118
232
456
897
1762
3465
6812
1
0
1
2
4
8
16
32
62
124
246
488
968
1920
3809
7554
1
0
1
2
4
8
16
32
64
126
252
502
1000
1992
3968
7904
(k)
(1i )
Let Rn (0k , 1k ) be the subset of Rn (0k , 1k ) of the strings ending with i ones,
k1
[
i
with i = 1, 2, . . . , k 1. Then Rn (0k , 1k ) =
Rn(1 ) (0k , 1k ).
i=1
(11 )
Rn (0k , 1k )
The strings of
are obtained by the strings of Rnj1 (0k , 1k )
j
appending 0 1, for j = 1, 2, . . . , k 1. So that
1
(1 ) k k
(k)
(k)
(k)
(2)
Rn (0 , 1 ) = rn2 + rn3 + . . . + rnk .
(1i )
excluding the strings in Rn1 (0k , 1k ) since the forbidden pattern 1k would
appear. So,
k1
k1
X
(1i ) k k
(1 )
(k)
Rn (0 , 1 ) = rn1 Rn1 (0k , 1k ) .
(3)
i=2
For what the last term is concerned, we observe that the strings of
(11 )
are obtained from the strings of Rn1(k2) (0k , 1k ) appending
k1
1
(1 )
(1 )
(11 )
1k2 . Clearly, Rn1 (0k , 1k ) = Rnk+1 (0k , 1k ). The set Rnk+1 (0k , 1k )
(1k1 )
Rn1 (0k , 1k )
Summarizing, since
rn(k)
1
k1
(1 ) k k X (1i ) k k
= Rn (0 , 1 ) +
Rn (0 , 1 ) ,
i=2
k
X
(k)
rnj
j=1
(k)
2k1
X
(k)
rnj ,
(5)
j=k+1
(k)
(k)
(k)
(k)
where
d(k)
n =
1 if (n mod k) = 0
1 if (n mod k) = 1
0 if (n mod k) 2 .
(k)
Proof.
We can proceed by induction. If n = 2, we have that r2 =
(k)
(k)
(k)
(k)
(k)
(k)
(k)
r1 + r0 + r1 + . . . + r3k + d2 . Since k 3 and r1 = 0, then d2 = 0
(k)
(k)
(k)
(k)
(k)
2k1
X
(k)
rnj .
k+1
(k)
(k)
(k)
(k)
(k)
(k)
3.2
(k)
(k)
(k)
(k)
(k)
(1)
The set Bn (0k , 1k ) can be generated from the strings in Bnj (0k , 1k )
followed by the suffix 0j , with 0 < j < k, so we have
(k)
bn,0 =
k1
X
(k)
bnj,1 , for n k.
j=1
(1)
bn,1 =
k1
X
(k)
bnj,0 , for n k.
j=1
Therefore, for n k,
b(k)
n
(k)
bn,0
(k)
bn,1
k1
X
(k)
bnj,1
(k)
bnj,0
j=1
k1
X
(k)
bnj .
j=1
Summarizing:
n
if 0 n k 1
2
(k)
bn =
(k)
(k)
(k)
bn1 + bn2 + . . . + bnk+1 if n k.
(6)
(k)
In Table 2 we list the first numbers of the recurrence bn for same fixed
values of k.
(0)
(k)
if n = 0
1
(k)
zn =
(k)
bn / 2 if n 1.
10
(7)
HH k
n HH
H
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1
2
4
6
10
16
26
42
68
110
178
288
466
754
1220
1974
1
2
4
8
14
26
48
88
162
298
548
1008
1854
3410
6272
11536
1
2
4
8
16
30
58
112
216
416
802
1546
2980
5744
11072
21342
1
2
4
8
16
32
62
122
240
472
928
1824
3586
7050
13860
27248
1
2
4
8
16
32
64
126
250
496
984
1952
3872
7680
15234
30218
1
2
4
8
16
32
64
128
254
506
1008
2008
4000
7968
15872
31616
(k)
3.3
k1
X
xi
i=1
f (k) (x) =
1
k
X
.
x
(9)
i=1
Since the sequences (6) and (8) are very similar, it is worthwhile to find
a link between the two sequences. It is not difficult to show, by induction,
that
if n = 0
1
b(k)
=
(10)
n
(k1)
2fn1
if n 1.
11
Therefore,
zn(k)
if n = 0
(11)
(k1)
if n 1.
fn1
The rational generating functions b(k) (x) and z (k) (x) for the sequence
(10) and (11), respectively, are
b(k) (x) = 2xf (k1) (x) + 1
and
z (k) (x) = xf (k1) (x) + 1 .
(k)
(k)
(k)
rn(k)
if n = 0
(k1)
(12)
(k)
fn1 +dn
2
if n 1,
(k)
Proof.
We can proceed by induction. If n = 1, then r1 = (f0k1 +
(k)
d1 )/2 = 0 which is the same value obtained by recurrence (5). Suppose
(k)
that rs
(k1)
(k)
fs1 +ds
2
(k)
rn
(k1)
fn2 +dn1
2
fn2 +...+fnk
2
fn1 +dn
2
(k1)
(k1)
Since
n
o
(k)
dn
n0
(k1)
(k)
+ ... +
(k1)
(k)
+
(k)
(k)
i=0
(k)
(k)
+ dn
(k)
(k)
dn +dn1 +...+dnk+1
.
2
n
o
= 1, 1, 0, 0, . . . , 0, 1, 1, 0, 0, . . . , 0, 1, 1, 0, . . . and
| {z }
| {z }
k2
Pk1
(k)
fnk +dnk+1
2
(k)
k2
12
n
o
(k)
dn
n0
(see
sequences A049347 for k = 3, A219977 for k = 4, in The On-line Encyclopedia of Integer Sequence) is given by
1
d(k) (x) =
1+
k1
X
,
xi
i=1
(k)
n and,
o from Proposition 3.2, the generating function r (x) of the sequence
(k)
can be easily obtained as
rn
n0
r(k) (x) =
Following the previous arguments, using (10), (11) and (12), recalling
(k)
(k)
that 3 k n2 , m 2, n 2k, and noting that b0 = 1 and r2 = 1, the
(k)
(k)
|Smn |
(k1) m2
2k1
if n = 2k
(k1) m2
f (k1) f (k1) + d(k)
if n > 2k .
n2k1
n2k+1
n2k+2 fn1
!n+2
!n+2
1+ 5
1 5
1
for n 0 .
fn(2) =
2
2
5
For k > 3n it is o
possible to observe that the generating function for
(k)
the sequence Smn
is rational due to the fact that the Hadamard
n>2k
and B(x) = b0 + b1 x + b2 x2 + . . .
13
0
0
0
0
(3)
0
0
B Smn
n are overlapping matrices, for each k, k with k 6= k and 3
0
k, k 2 .
(k)
beginning of the first and last row an entry 1 in the matrices in S610 and
deleting an entry of that rows chosen among the ones with index j, with
k < j < n k. We can extend this process obtaining the following family
of sets.
Definition 4.1 Let 3 k n2 and let 0 h n 2k. We denote
(k,h)
Smn Mmn the set of the matrices A = (ai,j ) satisfying the following
conditions:
A1 = 1h 1k1 0w1 10k1 , where v1 = 0w1 1 is a binary string of length
14
(k)
Note that, in the case h = 0, the set Smn coincides with Smn . The
following proposition can be easily proved.
(k,h)
(k,h+1)
Proposition 4.1
The set Smn Smn is non-overlapping, for each k
with 3 k n2 , 0 h < n 2k, m 2 and n 2k.
(k,h)
(k,h+j)
On the contrary, the set Smn Smn , with j 2, does not maintain
the non-overlapping property since an overlap is possible by means of a
(k,h)
slipping of the last row of a matrix A Smn on the first row of a matrix
(k,h+j)
B Smn .
Clearly, the matrices in the set we have defined have fixed dimensions
m n. If matrices of different dimensions are considered in the same set,
the definition of non-overlapping matrices should be slightly revised moving
from Definition 2.1 and taking care to the case when one matrix is a proper
submatrix of another one. In this direction, a further
could examine
[analysis
(k)
under which conditions on m, n and k the set
Smn is still a nonm,n,k
overlapping set or a two dimensional code. For this purpose, a first easy
(k)
(k)
result should be the following: fixed k and n, the set Smn Sm0 n , with m <
(k)
References
[1] M. Anselmo, D. Giammarresi, M. Madonia. Two-Dimensional Rational
Automata: A Bridge Unifying One- and Two-Dimensional Language
Theory Lecture Notes in Computer Science 7741 133145, 2013.
[2] M. Anselmo, D. Giammarresi, M. Madonia. Structure and Measure of a
Decidable Class of Two-dimensional Codes. Lecture Notes in Computer
Science 8977 315327, 2015.
[3] M. Anselmo, D. Giammarresi, M. Madonia. Unbordered Pictures: Properties and Construction. Lecture Notes in Computer Science 9270 4557,
2015.
15
16