In
mathematics and
theoretical computer science
Theoretical computer science (TCS) is a subset of general computer science and mathematics that focuses on mathematical aspects of computer science such as the theory of computation, lambda calculus, and type theory.
It is difficult to circumsc ...
, a pattern is an unavoidable pattern if it is unavoidable on any finite alphabet.
Definitions
Pattern
Like a word, a pattern (also called ''term'') is a sequence of symbols over some
alphabet
An alphabet is a standardized set of basic written graphemes (called letters) that represent the phonemes of certain spoken languages. Not all writing systems represent language in this way; in a syllabary, each character represents a s ...
.
The minimum multiplicity of the pattern ''
'' is ''
'' where ''
'' is the number of occurrence of symbol ''
'' in pattern ''
''. In other words, it is the number of occurrences in ''
'' of the least frequently occurring symbol in ''
''.
Instance
Given finite alphabets
and
, a word
is an instance of the pattern
if there exists a non-erasing
semigroup morphism
In mathematics, a semigroup is an algebraic structure consisting of a set together with an associative internal binary operation on it.
The binary operation of a semigroup is most often denoted multiplicatively: ''x''·''y'', or simply ''xy'', ...
such that
, where
denotes the
Kleene star
In mathematical logic and computer science, the Kleene star (or Kleene operator or Kleene closure) is a unary operation, either on sets of strings or on sets of symbols or characters. In mathematics,
it is more commonly known as the free monoid ...
of
. Non-erasing means that
for all
, where
denotes the
empty string
In formal language theory, the empty string, or empty word, is the unique string of length zero.
Formal theory
Formally, a string is a finite, ordered sequence of characters such as letters, digits or spaces. The empty string is the special cas ...
.
Avoidance / Matching
A word
is said to ''match'', or ''encounter'', a pattern
if a factor (also called ''subword'' or ''
substring
In formal language theory and computer science, a substring is a contiguous sequence of characters within a string. For instance, "''the best of''" is a substring of "''It was the best of times''". In contrast, "''Itwastimes''" is a subsequence ...
'') of
is an instance of
. Otherwise,
is said to avoid
, or to be
-free. This definition can be generalized to the case of an infinite
, based on a generalized definition of "substring".
Avoidability / Unavoidability on a specific alphabet
A pattern
is ''unavoidable'' on a finite alphabet
if each sufficiently long word
must match
; formally: if
. Otherwise,
is ''avoidable'' on
, which implies there exist infinitely many words over the alphabet
that avoid
.
By
Kőnig's lemma
Kőnig's lemma or Kőnig's infinity lemma is a theorem in graph theory due to the Hungarian mathematician Dénes Kőnig who published it in 1927. It gives a sufficient condition for an infinite graph to have an infinitely long path. The computab ...
, pattern
is avoidable on
if and only if
In logic and related fields such as mathematics and philosophy, "if and only if" (shortened as "iff") is a biconditional logical connective between statements, where either both statements are true or both are false.
The connective is bi ...
there exists an
infinite word
In formal language theory within theoretical computer science, an infinite word is an infinite-length sequence (specifically, an ω-length sequence) of symbols, and an ω-language is a set of infinite words. Here, ω refers to the first ordinal ...
that avoids
.
Maximal -free word
Given a pattern
and an alphabet ''
''. A
-free word ''
'' is a maximal
-free word over ''
'' if
and
match
.
Avoidable / Unavoidable pattern
A pattern ''
'' is an unavoidable pattern (also called ''blocking term'') if ''
'' is unavoidable on any finite alphabet.
If a pattern is unavoidable and not limited to a specific alphabet, then it is unavoidable for any finite alphabet by default. Conversely, if a pattern is said to be avoidable and not limited to a specific alphabet, then it is avoidable on some finite alphabet by default.
''''-avoidable / ''''-unavoidable
A pattern ''
'' is ''
''-avoidable if ''
'' is avoidable on an alphabet ''
'' of size ''
''. Otherwise, ''
'' is ''
''-unavoidable, which means ''
'' is unavoidable on every alphabet of size ''
''.
If pattern
is
-avoidable, then
is
-avoidable for all ''
''.
Given a finite set of avoidable patterns
, there exists an infinite word
such that
avoids all patterns of
.
Let
denote the size of the minimal alphabet
such that
avoiding all patterns of
.
Avoidability index
The avoidability index of a pattern ''
'' is the smallest ''
'' such that ''
'' is ''
''-avoidable, and ''
'' if ''
'' is unavoidable.
Properties
*A pattern ''
''is avoidable if ''
''is an instance of an avoidable pattern ''
''.
*Let avoidable pattern ''
'' be a factor of pattern ''
'', then ''
'' is also avoidable.
*A pattern ''
'' is unavoidable if and only if ''
'' is a factor of some unavoidable pattern ''
''.
*Given an unavoidable pattern ''
'' and a symbol ''
'' not in ''
'', then ''
'' is unavoidable.
*Given an unavoidable pattern ''
'', then the
reversal ''
'' is unavoidable.
*Given an unavoidable pattern ''
'', there exists a symbol ''
'' such that ''
'' occurs exactly once in ''
''.
*Let
represent the number of distinct symbols of pattern
. If
, then
is avoidable.
Zimin words
Given alphabet
, Zimin words (patterns) are defined recursively
for
and
.
Unavoidability
All Zimin words are unavoidable.
A word ''
'' is unavoidable if and only if it is a factor of a Zimin word.
Given a finite alphabet
, let
represent the smallest
such that
matches
for all
. We have following properties:
*
*
*
*
is the longest unavoidable pattern constructed by alphabet
since
.
Pattern reduction
Free letter
Given a pattern ''
'' over some alphabet
, we say
is free for ''
'' if there exist subsets
of
such that the following hold:
#
is a factor of ''
'' and ''
'' ↔
is a factor of ''
'' and ''
''
#''
''
For example, let ''
'', then ''
'' is free for ''
'' since there exist ''
'' satisfying the conditions above.
Reduce
A pattern ''
'' reduces to pattern ''
'' if there exists a symbol ''
'' such that ''
'' is free for ''
'', and ''
'' can be obtained by removing all occurrence of ''
'' from ''
''. Denote this relation by
.
For example, let ''
'', then ''
'' can reduce to ''
'' since ''
'' is free for ''
''.
Locked
A word ''
'' is said to be locked if ''
'' has no free letter; hence ''
'' can not be reduced.
Transitivity
Given patterns ''
'', if ''
'' reduces to ''
'' and ''
'' reduces to ''
'', then ''
'' reduces to ''
''. Denote this relation by
.
Unavoidability
A pattern ''
'' is unavoidable if and only if ''
'' reduces to a word of length one; hence ''
'' such that ''
'' and ''
''.
Graph pattern avoidance
Avoidance / Matching on a specific graph
Given a simple
graph
Graph may refer to:
Mathematics
*Graph (discrete mathematics), a structure made of vertices and edges
**Graph theory, the study of such graphs and their properties
*Graph (topology), a topological space resembling a graph in the sense of discre ...
''
'', a edge
coloring ''
'' matches pattern ''
'' if there exists a simple
path
A path is a route for physical travel – see Trail.
Path or PATH may also refer to:
Physical paths of different types
* Bicycle path
* Bridle path, used by people on horseback
* Course (navigation), the intended path of a vehicle
* Desire ...
''