Professional Documents
Culture Documents
An Introduction
Jeffrey Shallit
School of Computer Science
University of Waterloo
Waterloo, Ontario N2L 3G1
Canada
shallit@cs.uwaterloo.ca
http://www.cs.uwaterloo.ca/~shallit
1 / 201
periodicity
2 / 201
periodicity
patterns and pattern avoidance
3 / 201
periodicity
patterns and pattern avoidance
equations in words
4 / 201
periodicity
patterns and pattern avoidance
equations in words
infinite words and their properties
5 / 201
Some notation
6 / 201
Some notation
7 / 201
Some notation
8 / 201
Some notation
9 / 201
Some notation
10 / 201
Some notation
11 / 201
More notation
12 / 201
More notation
13 / 201
More notation
14 / 201
More notation
15 / 201
More notation
16 / 201
More notation
17 / 201
More notation
xn
z }| {
= xx x, x 0 = ,
18 / 201
More notation
xn
z }| {
= xx x, x 0 = ,
Algebraic framework
20 / 201
Algebraic framework
21 / 201
Algebraic framework
22 / 201
Algebraic framework
23 / 201
Periodicity
words - fundamentally noncommutative
24 / 201
Periodicity
words - fundamentally noncommutative
casebook 6= bookcase
25 / 201
Periodicity
words - fundamentally noncommutative
casebook 6= bookcase
When do words commute?
26 / 201
Periodicity
words - fundamentally noncommutative
casebook 6= bookcase
When do words commute?
Here are two words that almost commute:
27 / 201
Periodicity
words - fundamentally noncommutative
casebook 6= bookcase
When do words commute?
Here are two words that almost commute:
w = 01010 and x = 01011010
28 / 201
Periodicity
words - fundamentally noncommutative
casebook 6= bookcase
When do words commute?
Here are two words that almost commute:
w = 01010 and x = 01011010
wx
= 0101001011010
29 / 201
Periodicity
words - fundamentally noncommutative
casebook 6= bookcase
When do words commute?
Here are two words that almost commute:
w = 01010 and x = 01011010
wx
= 0101001011010
xw
= 0101101001010
By the way, this raises the question: can the Hamming distance
between wx and xw be 1? It cant; there is a one-line proof.
30 / 201
31 / 201
32 / 201
33 / 201
Theorem
Let x, y + . Then the following three conditions are equivalent:
34 / 201
Theorem
Let x, y + . Then the following three conditions are equivalent:
(1) xy = yx;
35 / 201
Theorem
Let x, y + . Then the following three conditions are equivalent:
(1) xy = yx;
(2) There exist z + and integers k, l > 0 such that x = z k and
y = zl;
36 / 201
Theorem
Let x, y + . Then the following three conditions are equivalent:
(1) xy = yx;
(2) There exist z + and integers k, l > 0 such that x = z k and
y = zl;
(3) There exist integers i, j > 0 such that x i = y j .
37 / 201
38 / 201
39 / 201
40 / 201
41 / 201
42 / 201
Primitive words
We say a word x is a power if it can be expressed as x = y n for
some y 6= , n 2.
43 / 201
Primitive words
We say a word x is a power if it can be expressed as x = y n for
some y 6= , n 2.
A nonpower is called primitive.
44 / 201
Primitive words
We say a word x is a power if it can be expressed as x = y n for
some y 6= , n 2.
A nonpower is called primitive.
Every nonempty word can be written uniquely in the form x k
where x is primitive and k 1.
45 / 201
Primitive words
We say a word x is a power if it can be expressed as x = y n for
some y 6= , n 2.
A nonpower is called primitive.
Every nonempty word can be written uniquely in the form x k
where x is primitive and k 1.
Enumeration: there are exactly
X
(d)k n/d
d |n
46 / 201
Primitive words
We say a word x is a power if it can be expressed as x = y n for
some y 6= , n 2.
A nonpower is called primitive.
Every nonempty word can be written uniquely in the form x k
where x is primitive and k 1.
Enumeration: there are exactly
X
(d)k n/d
d |n
47 / 201
Primitive words
We say a word x is a power if it can be expressed as x = y n for
some y 6= , n 2.
A nonpower is called primitive.
Every nonempty word can be written uniquely in the form x k
where x is primitive and k 1.
Enumeration: there are exactly
X
(d)k n/d
d |n
Conjugates
49 / 201
Conjugates
50 / 201
Conjugates
51 / 201
Conjugates
52 / 201
Conjugates
53 / 201
Conjugates
54 / 201
Fractional powers
We say a word w is a p/q power, for integers p q 1, if
w = x bp/qc x 0
for a prefix x 0 of x such that |w |/|x| = p/q.
55 / 201
Fractional powers
We say a word w is a p/q power, for integers p q 1, if
w = x bp/qc x 0
for a prefix x 0 of x such that |w |/|x| = p/q.
For example, the French word entente is a 7/3-power, as it can
be written as (ent)2 e.
56 / 201
Fractional powers
We say a word w is a p/q power, for integers p q 1, if
w = x bp/qc x 0
for a prefix x 0 of x such that |w |/|x| = p/q.
For example, the French word entente is a 7/3-power, as it can
be written as (ent)2 e.
The German word schematische is a 3/2 power.
57 / 201
Fractional powers
We say a word w is a p/q power, for integers p q 1, if
w = x bp/qc x 0
for a prefix x 0 of x such that |w |/|x| = p/q.
For example, the French word entente is a 7/3-power, as it can
be written as (ent)2 e.
The German word schematische is a 3/2 power.
If w = x bp/qc x 0 is a p/q power, then we call x a period of w .
Often the word period is used to refer to |x|.
58 / 201
Fractional powers
We say a word w is a p/q power, for integers p q 1, if
w = x bp/qc x 0
for a prefix x 0 of x such that |w |/|x| = p/q.
For example, the French word entente is a 7/3-power, as it can
be written as (ent)2 e.
The German word schematische is a 3/2 power.
If w = x bp/qc x 0 is a p/q power, then we call x a period of w .
Often the word period is used to refer to |x|.
If a word w is a p/q > 1 power, then it begins and ends with some
nonempty string. Such a string is also called bordered. Otherwise
it is unbordered.
59 / 201
Unbordered words
The unbordered words play the same role for fractional powers as
the primitive words do for ordinary powers.
60 / 201
Unbordered words
The unbordered words play the same role for fractional powers as
the primitive words do for ordinary powers.
Enumeration of unbordered words is more challenging and there is
no simple closed form.
61 / 201
Unbordered words
The unbordered words play the same role for fractional powers as
the primitive words do for ordinary powers.
Enumeration of unbordered words is more challenging and there is
no simple closed form.
However, there are asymptotically ck k n such words, where ck is a
constant that tends to 1 as k tends to .
62 / 201
Duvals conjecture
63 / 201
Duvals conjecture
64 / 201
Duvals conjecture
65 / 201
Duvals conjecture
66 / 201
Theorem
Let w and x be nonempty words. Let y w {w , x} and
z x{w , x} . Then the following conditions are equivalent:
(a) y and z agree on a prefix of length at least
|w | + |x| gcd(|w |, |x|);
67 / 201
Theorem
Let w and x be nonempty words. Let y w {w , x} and
z x{w , x} . Then the following conditions are equivalent:
(a) y and z agree on a prefix of length at least
|w | + |x| gcd(|w |, |x|);
(b) wx = xw ;
68 / 201
Theorem
Let w and x be nonempty words. Let y w {w , x} and
z x{w , x} . Then the following conditions are equivalent:
(a) y and z agree on a prefix of length at least
|w | + |x| gcd(|w |, |x|);
(b) wx = xw ;
(c) y = z.
(c) = (a): Trivial.
69 / 201
Theorem
Let w and x be nonempty words. Let y w {w , x} and
z x{w , x} . Then the following conditions are equivalent:
(a) y and z agree on a prefix of length at least
|w | + |x| gcd(|w |, |x|);
(b) wx = xw ;
(c) y = z.
(c) = (a): Trivial.
Well prove (a) = (b) and (b) = (c).
70 / 201
Proof.
(a) y and z agree on a prefix of length at least
|w | + |x| gcd(|w |, |x|) = (b) wx = xw
71 / 201
Proof.
(a) y and z agree on a prefix of length at least
|w | + |x| gcd(|w |, |x|) = (b) wx = xw
We prove the contrapositive. Suppose wx 6= xw .
72 / 201
Proof.
(a) y and z agree on a prefix of length at least
|w | + |x| gcd(|w |, |x|) = (b) wx = xw
We prove the contrapositive. Suppose wx 6= xw .
Then we prove that y and z differ at a position
|w | + |x| gcd(|w |, |x|).
73 / 201
Proof.
(a) y and z agree on a prefix of length at least
|w | + |x| gcd(|w |, |x|) = (b) wx = xw
We prove the contrapositive. Suppose wx 6= xw .
Then we prove that y and z differ at a position
|w | + |x| gcd(|w |, |x|).
The proof is by induction on |w | + |x|.
74 / 201
Proof.
(a) y and z agree on a prefix of length at least
|w | + |x| gcd(|w |, |x|) = (b) wx = xw
We prove the contrapositive. Suppose wx 6= xw .
Then we prove that y and z differ at a position
|w | + |x| gcd(|w |, |x|).
The proof is by induction on |w | + |x|.
The base case is |w | + |x| = 2. Then |w | = |x| = 1, and
|w | + |x| gcd(|w |, |x|) = 1. Since wx 6= xw , we must have
w = a, x = b with a 6= b. Then y and z differ at the first position.
75 / 201
76 / 201
77 / 201
78 / 201
79 / 201
80 / 201
81 / 201
83 / 201
84 / 201
85 / 201
86 / 201
The proof also implies a way to get words that optimally almost
commute, in the sense that xw and wx should agree on as long a
segment as possible.
87 / 201
The proof also implies a way to get words that optimally almost
commute, in the sense that xw and wx should agree on as long a
segment as possible.
Theorem
For each m, n 1 there exist words x, w of length m, n,
respectively, such that xw and wx agree on a prefix of length
m + n gcd(m, n) 1 but differ at position m + n gcd(m, n).
88 / 201
The proof also implies a way to get words that optimally almost
commute, in the sense that xw and wx should agree on as long a
segment as possible.
Theorem
For each m, n 1 there exist words x, w of length m, n,
respectively, such that xw and wx agree on a prefix of length
m + n gcd(m, n) 1 but differ at position m + n gcd(m, n).
These are the finite Sturmian words.
89 / 201
The proof also implies a way to get words that optimally almost
commute, in the sense that xw and wx should agree on as long a
segment as possible.
Theorem
For each m, n 1 there exist words x, w of length m, n,
respectively, such that xw and wx agree on a prefix of length
m + n gcd(m, n) 1 but differ at position m + n gcd(m, n).
These are the finite Sturmian words.
Many authors have worked on generalizations to multiple periods:
Castelli, Mignosi, & Restivo, Simpson & Tijdeman, Constantinescu
& Ilie, ...
90 / 201
91 / 201
92 / 201
93 / 201
94 / 201
95 / 201
96 / 201
97 / 201
98 / 201
We write
hi
z
}|
{
= h(h(h( ))).
99 / 201
Morphic words
100 / 201
Morphic words
101 / 201
Morphic words
102 / 201
Morphic words
103 / 201
104 / 201
105 / 201
106 / 201
107 / 201
108 / 201
109 / 201
110 / 201
111 / 201
z}|{ z}|{ z}|{ z}|{ z}|{ z}|{ z}|{ z}|{ z}|{ z}|{ z}|{
0 1 0 11
0 1 0 11 0 1 0
0 11 0
0 11 0 1 0
112 / 201
z}|{ z}|{ z}|{ z}|{ z}|{ z}|{ z}|{ z}|{ z}|{ z}|{ z}|{
0 1 0 11
0 1 0 11 0 1 0
0 11 0
0 11 0 1 0
This is squarefree, as a square in this word implies and overlap in
the Thue-Morse word.
113 / 201
114 / 201
115 / 201
116 / 201
117 / 201
118 / 201
119 / 201
Dejeans Conjecture
120 / 201
Dejeans Conjecture
121 / 201
Dejeans Conjecture
122 / 201
Dejeans Conjecture
123 / 201
Dejeans Conjecture
125 / 201
126 / 201
127 / 201
128 / 201
129 / 201
130 / 201
Abelian powers
131 / 201
Abelian powers
132 / 201
Abelian powers
133 / 201
Abelian powers
134 / 201
135 / 201
136 / 201
137 / 201
138 / 201
139 / 201
140 / 201
141 / 201
142 / 201
143 / 201
Equations in words
Example 1:
abX = Xba.
144 / 201
Equations in words
Example 1:
abX = Xba.
The only solutions are X (ab) a.
145 / 201
Equations in words
Example 1:
abX = Xba.
The only solutions are X (ab) a.
Example 2:
XaXbY = aXYbX
146 / 201
Equations in words
Example 1:
abX = Xba.
The only solutions are X (ab) a.
Example 2:
XaXbY = aXYbX
The solutions are X = ai , Y = (ai b)j ai for i 0, j 0.
147 / 201
Equations in words
148 / 201
Equations in words
149 / 201
Equations in words
150 / 201
Equations in words
151 / 201
Equations in words
152 / 201
Equations in words
153 / 201
154 / 201
155 / 201
156 / 201
157 / 201
158 / 201
159 / 201
160 / 201
161 / 201
162 / 201
163 / 201
164 / 201
165 / 201
166 / 201
167 / 201
168 / 201
169 / 201
170 / 201
171 / 201
172 / 201
Subword complexity
173 / 201
Subword complexity
174 / 201
Subword complexity
175 / 201
Subword complexity
176 / 201
Subword complexity
177 / 201
Automatic sequences
178 / 201
Automatic sequences
179 / 201
Automatic sequences
180 / 201
Automatic sequences
182 / 201
0
1
1
1
183 / 201
Robustness
the order in which the base-k digits are fed into the
automaton in does not matter (provided it is fixed for all n);
184 / 201
Robustness
the order in which the base-k digits are fed into the
automaton in does not matter (provided it is fixed for all n);
other representations also work (such as expansion in
base-(k));
185 / 201
Robustness
the order in which the base-k digits are fed into the
automaton in does not matter (provided it is fixed for all n);
other representations also work (such as expansion in
base-(k));
automatic sequences are closed under many operations, such
as shift, periodic deletion, q-block compression, and q-block
substitution.
186 / 201
Robustness
the order in which the base-k digits are fed into the
automaton in does not matter (provided it is fixed for all n);
other representations also work (such as expansion in
base-(k));
automatic sequences are closed under many operations, such
as shift, periodic deletion, q-block compression, and q-block
substitution.
if a symbol in an automatic sequence occurs with well-defined
frequency r , then r is rational.
187 / 201
Christols theorem
Theorem
(Christol [1980]). Let (un )n0 be a sequence over
= {0, 1, . . . , p 1},
where p is
Pa prime. Then the formal power series
U(X ) = n0 un X n is algebraic over GF (p)[X ] if and only if
(un )n0 is p-automatic.
188 / 201
189 / 201
190 / 201
191 / 201
X
n0
t2n X 2n +
t2n+1 X 2n+1
n0
192 / 201
t2n X 2n +
tn X 2n + X
n0
n0
t2n+1 X 2n+1
n0
X
n0
tn X 2n + X
X 2n
n0
193 / 201
t2n X 2n +
tn X 2n + X
n0
n0
t2n+1 X 2n+1
n0
X
n0
tn X 2n + X
X 2n
n0
194 / 201
t2n X 2n +
tn X 2n + X
n0
n0
t2n+1 X 2n+1
n0
tn X 2n + X
n0
X 2n
n0
t2n X 2n +
tn X 2n + X
n0
n0
t2n+1 X 2n+1
n0
tn X 2n + X
n0
X 2n
n0
196 / 201
Open Problems
197 / 201
Open Problems
198 / 201
Open Problems
199 / 201
Open Problems
200 / 201
201 / 201