Home

patternsnumber

Patternsnumber is a numerical attribute used in combinatorics on words to quantify the diversity of pattern structures within a finite word. For a word w over a finite alphabet, patternsnumber(w) is defined as the number of distinct pattern templates that occur among all substrings of w. A pattern template is the equivalence class of a substring under pattern isomorphism: two substrings are equivalent if one can be obtained from the other by renaming the letters via a bijection that preserves the relative positions of equal letters. For example, in the word aba, the substrings are a, b, ab, ba, and aba, with patterns 1, 1, 12, 12, and 121 respectively. The distinct patterns are {1, 12, 121}, so patternsnumber(aba) = 3.

Computation of patternsnumber typically proceeds by enumerating substrings and replacing each substring with its canonical pattern

Properties of patternsnumber include invariance under renaming of the alphabet, and the general bound 1 ≤ patternsnumber(w)

form,
then
counting
distinct
forms.
A
naive
approach
runs
in
roughly
cubic
time
in
the
length
of
the
word,
since
there
are
O(n^2)
substrings
and
each
pattern
normalization
can
take
O(n)
time.
Practical
methods
use
optimizations
based
on
suffix
trees
or
automata
to
reduce
constant
factors,
though
the
theoretical
complexity
remains
dependent
on
word
length
and
alphabet
size.
In
practice,
patternsnumber
serves
as
a
proxy
for
repetitiveness
and
structural
variety
in
strings,
rather
than
as
a
single
fixed
invariant.
≤
n(n+1)/2
for
a
word
of
length
n,
with
many
strings
yielding
far
smaller
values
due
to
repeated
pattern
types.
Related
concepts
include
pattern
complexity
and
the
study
of
equivalence
classes
of
substrings
in
combinatorics
on
words.