Skip to content

Factor Complexity Function

The length-indexed count of distinct contiguous factors in a finite or infinite word—equivalently the density function of its factor language—whose growth separates periodicity, low-complexity aperiodicity, and entropy-bearing pattern diversity.

Version
v3 · 2026-09-19 · History
Domain-specific #
1521
Domain group
Formal Sciences
Origin domain
Mathematics
Subdomains
Combinatorics on Words, Factor Complexity → Mathematics
Aliases
Factor Complexity, Subword Complexity, Block Complexity

Core Idea

For a finite or infinite word (u) over a finite alphabet (A), the factor complexity function records, for every length (n), how many distinct contiguous blocks of that length occur in (u):

\[ p_u(n)=\left|\operatorname{Fac}_n(u)\right|, \qquad \operatorname{Fac}_n(u)=\{u_i u_{i+1}\cdots u_{i+n-1}\}. \]

Repeated occurrences count once. Position and frequency are discarded; distinct local pattern types are retained. For an arbitrary formal language \(L\subseteq A^*\), the analogous length-density or growth function is \(p_L(n)=|L\cap A^n|\). The word case is obtained by taking \(L=\operatorname{Fac}(u)\), the factorial language of all factors of (u).

How would you explain it like I'm…

Different-Bead-Pattern Count

Imagine a long string of colored beads. Pick a size, like 2 beads, and slide a window along the string, writing down each different 2-bead pattern you see. Count how many different patterns there are, not how many times each shows up. Do this for every size, and you get the factor complexity function.

Counting Different Chunks

A word here means a string of letters from a small alphabet, like ABAABAB, and it can even go on forever. A factor is a block of letters that appear next to each other in the word. The factor complexity function tells you, for each length n, how many different blocks of length n appear. If the same block shows up many times, it still only counts once, and where it shows up doesn't matter. A word that just repeats a pattern forever has only a few different blocks, while a word that contains every possible block has as many as possible. This count is not the same as how hard the word is to compute or how often each block appears.

Distinct-Factor Count by Length

For a finite or infinite word u over a finite alphabet, the factor complexity function p_u(n) counts the number of distinct contiguous blocks (factors) of length n in u. Repeated occurrences count once, and position and frequency are ignored. The same idea applies to any set of words L: count how many words of length n belong to L; the word case is the special case where L is the set of all factors of u. Low complexity is linked to periodicity: the Morse–Hedlund theorem says an infinite word is eventually periodic if p_u(n) ≤ n for some n, so every aperiodic word has at least n + 1 factors of each length n. Binary aperiodic words with exactly n + 1 are called Sturmian words. At the other extreme, a word containing every possible block has |A|ⁿ factors of length n. This count is different from the time needed to compute the word, from its shortest description, and from how often blocks occur.

 

For a finite or infinite word u over a finite alphabet A, the factor complexity function is p_u(n) = |Fac_n(u)|, the number of distinct contiguous factors of length n. Repeated occurrences count once, so position and frequency are discarded while distinct local pattern types are retained. The same counting applies to any formal language L via p_L(n) = |L ∩ A^n|, and the word case is L = Fac(u); but a factor language is closed under taking factors and its length slices are linked by extension constraints, which an arbitrary language need not satisfy. The Morse-Hedlund theorem states that a right-infinite word is ultimately periodic if p_u(n) ≤ n for some positive n, so every aperiodic word has p_u(n) ≥ n + 1 for all n; binary aperiodic words attaining n + 1 are Sturmian. A word containing every block has maximal complexity |A|^n, and intermediate growth rates distinguish substitutive, automatic, morphic, and dynamical families. The function must not be confused with computational time or space, with shortest-description length, or with a frequency distribution.

Scope of Application

In combinatorics on words, the function classifies infinite words by local diversity and links that diversity to repetition, balance, return words, special factors, and morphic generation. Sturmian words form the canonical minimum-complexity aperiodic binary class. Episturmian and Arnoux–Rauzy words, interval-exchange codings, substitution fixed points, and automatic sequences have characteristic complexity regimes studied through the same operator.

In symbolic dynamics, a shift space \(X\subseteq A^{\mathbb Z}\) has a language of admissible finite blocks and complexity \(p_X(n)=|\mathcal L_n(X)|\). Its exponential rate defines topological entropy:

Clarity

“Subword” is ambiguous across fields. In combinatorics on words, factor means a contiguous substring, while some literature uses subword for the same object and other literature uses it for a scattered subsequence. This node prefers “factor complexity” and treats “subword complexity” as an alias only when contiguity is explicit.

Manages Complexity

An infinite word contains infinitely many overlapping windows. The function replaces that expanding collection with one integer per scale. Its first difference then localizes branching. For a right-infinite word, if (d^+(v)) is the number of letters extending factor (v) to the right, then

\[ p_u(n+1)-p_u(n)=\sum_{v\in\operatorname{Fac}_n(u)}(d^+(v)-1). \]

Abstract Reasoning

  1. If an infinite binary word has \(p(n)\le n\) for one positive (n), it is ultimately periodic; no further sampling can rescue an aperiodicity claim.
  2. If a binary word is aperiodic and has (p(n)=n+1) for every (n), it lies at the Sturmian minimum-complexity boundary.
  3. If (p(n+1)=p(n)) for an infinite word, every length-(n) factor has exactly one right extension, forcing continuation toward periodic behavior.

Knowledge Transfer

The exact operator transfers among finite and infinite words, shift spaces, factorial languages, formal languages, digit expansions, and symbolic codings: fix length, form the admissible contiguous blocks, quotient by equality, and count. Theorems transfer only when their hypotheses transfer. Morse–Hedlund needs an infinite word or factor language; the regular-language growth dichotomy needs regularity; entropy uses a factorial, shift-compatible language.

Relationships to Other Abstractions

Local relationship map for Factor Complexity FunctionParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Factor ComplexityFunctionDOMAINPrime abstraction: Complexity — is a kind ofComplexityPRIME

Current abstraction Factor Complexity Function Domain-specific

Parents (1) — outgoing typed relations

  • Factor Complexity Function is a kind of Complexity Prime

    factor diversity is one exact formalization of intricacy across observation scales.

Hierarchy path (1) — routes to 1 parentless root

  • Factor Complexity Function → is a kind of Complexity

Neighborhood in Abstraction Space

Factor Complexity Function sits in a sparse region of the domain-specific corpus (87th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Grammar Derivation & Word Complexity (9 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-25