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
v2 · 2026-08-30 · History
Domain-specific #
1521
Origin domain
combinatorics on words
Subdomain
factor complexity
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). This shared cardinality operator is coherent, but the distinction matters: a factor language is closed under taking factors and extension constraints link its length slices, while an arbitrary language need not have either property.[1][2]

Factor complexity converts an unbounded symbolic object into a sequence of finite counts. At the low end, periodicity forces bounded complexity. The Morse–Hedlund theorem states that a right-infinite word is ultimately periodic if \(p_u(n)\le n\) for some positive (n); equivalently every aperiodic word satisfies \(p_u(n)\ge n+1\) for every (n). Binary aperiodic words attaining the minimum (p_u(n)=n+1) are Sturmian.[3] At the high end, a word containing every length-(n) block has (p_u(n)=|A|^n). Intermediate growth distinguishes large families of substitutive, automatic, morphic, and dynamical sequences.[4][5]

The locked identity is finite alphabet + source word or language + exact length (n) + contiguous factors or length-(n) members + equality of words + distinct-class count + the full length-indexed growth profile. The function is not the time or memory needed to compute those blocks, not shortest-description length, and not a frequency distribution. It survives as domain-specific because factor closure, extensions, special factors, recurrence, periodicity, and symbolic entropy give the count a distinctive inferential grammar.

Structural Signature

  • the finite alphabet (A) — the symbol set, whose size (k) bounds the number of possible length-(n) words by (k^n);
  • the source object — a finite word, one-sided or two-sided infinite word, shift space, factorial language, or arbitrary formal language;
  • the length parameter (n) — an exact block length, not a maximum length unless a cumulative variant is explicitly defined;
  • the window rule — consecutive positions for factors, with no skipped symbols;
  • the factor set (operatorname{Fac}_n(u)) — all observed length-(n) windows in the word, independent of multiplicity;
  • the language slice \(L\cap A^n\) — all accepted words having exactly length (n) in the language version;
  • the equality quotient — identical symbol strings form one class even if they occur at different positions;
  • the count (p(n)) — the finite cardinality of that set for each length;
  • the profile — the sequence \(p(0),p(1),p(2),\ldots\), whose growth carries more information than one value;
  • the basic bound — for an infinite word, \(1\le p_u(n)\le k^n\); for a finite word of length (N), \(0\le p_u(n)\le\min(k^n,N-n+1)\) when \(n\le N\);
  • the extension structure — each factor has possible left and right extensions, with branching creating new factor types at the next length;
  • the periodicity threshold\(p_u(n)\le n\) at one positive length forces ultimate periodicity in the one-sided infinite case;
  • the entropy rate — for factorial languages or shift spaces, submultiplicativity yields an asymptotic exponential growth rate from (log p(n)/n);
  • the recurrence condition — recurrence or uniform recurrence governs whether local factors reappear and which stronger classifications the profile supports;
  • the variant rule — abelian, palindromic, cyclic, scattered-subword, or bidimensional complexity changes the equivalence or occurrence relation and must be named.

Recognition requires a set of exact-length symbolic words and a distinct-count operation. Calling any resource-growth curve a “complexity function” does not satisfy the signature.

What It Is Not

  • Not time or space complexity. It counts factor types in an object; it does not measure algorithmic resources as input size grows.
  • Not Kolmogorov complexity. Kolmogorov complexity is the length of a shortest program producing a particular string, not the number of distinct windows it contains.
  • Not state complexity. State or quotient complexity counts automaton states or residual languages.
  • Not factor frequency. A block appearing once and a block appearing one million times each contribute one to (p_u(n)).
  • Not Shannon entropy. Entropy uses probabilities; factor complexity ignores their distribution, though exponential factor growth defines topological entropy.
  • Not a noncontiguous subsequence count. Factors occupy consecutive positions; scattered subwords obey a different occurrence relation.
  • Not cumulative vocabulary. (p(n)) counts exactly length (n), not every factor of length at most (n).
  • Not the number of positions. A length-(N) word has at most (N-n+1) factor positions but can have fewer distinct factors.
  • Not Unavoidable Pattern. Unavoidability quantifies whether morphic instances of a variable pattern must occur in all sufficiently long words; factor complexity counts blocks in one word or language.
  • Not the generic prime Complexity. The prime covers several non-equivalent notions of intricacy; this node supplies one exact combinatorial formalization and its theorems.

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.[1][4]

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:

\[ h_{\mathrm{top}}(X)=\lim_{n\to\infty}\frac{1}{n}\log p_X(n), \]

with division by (log |A|) when a normalized value is desired. Factorial closure gives \(p(n+m)\le p(n)p(m)\), so the logarithm is subadditive and the limit exists.[6]

For a formal language (L), \(p_L(n)=|L\cap A^n|\) is usually called its growth function or density. It measures how many words the language admits at each length and can reveal automaton structure. Regular languages exhibit a polynomial-versus-exponential growth dichotomy; polynomial-density regular languages admit constrained repeated-block forms.[2][7] Arbitrary language growth can be zero at some lengths, oscillate, or fail monotonicity because its length slices need not extend one another.

Digit expansions use factor complexity to distinguish rational from irrational behavior: an eventually periodic base-(b) expansion has bounded complexity, while an irrational expansion is aperiodic and therefore has at least (n+1) distinct length-(n) factors. Stronger claims about algebraic irrational expansions remain research questions and must not be inferred from the lower bound.

The node stops at exact distinct-factor counting. Frequency-weighted block distributions, compression ratios, algorithmic randomness, pattern avoidance, and multidimensional rectangular complexity are related theories requiring additional structure.

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.

For a finite word (u) of length (N), (p_u(n)=0) for (n>N), so eventual decay says only that the source ended. Periodicity theorems concern infinite words. For a one-sided infinite word, the theorem concludes ultimate periodicity; for a bi-infinite word, the corresponding conclusion is periodicity. The sidedness must be stated.

Word complexity and language growth share a formula but not all laws. If \(L=\operatorname{Fac}(u)\), every admitted word has shorter factors in (L), and blocks extend along the infinite word. For arbitrary (L), neither follows. Thus Morse–Hedlund cannot be applied to a general language merely because \(p_L(n)\le n\) at one length.

Equal complexity functions do not generally imply equal factor sets. The function forgets which blocks occur, their positions, and their frequencies. It is a profile of diversity, not a complete invariant. Additional recurrence or structural hypotheses can make the profile more informative but do not restore the lost identities automatically.

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). \]

Factors with more than one right extension are right-special and account for growth. This turns a global count into local extension diagnostics: constant complexity signals deterministic continuation, while new branch choices increase the next value.[8]

The profile also separates regimes without enumerating every factor identity in the final statement. Bounded growth diagnoses ultimate periodicity; minimum linear growth identifies the Sturmian boundary in the binary aperiodic case; polynomial growth describes constrained local diversity; exponential growth supports positive entropy. The distinctions narrow which structural tools are appropriate.

For automata, the language growth function converts paths of length (n) ending in accepting states into a counting sequence. Strongly connected cycle structure and adjacency matrices govern whether growth is polynomial or exponential. For symbolic systems, the same counts feed entropy. The abstraction therefore acts as an interface between local combinatorics, automata, and dynamical behavior.

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.
  4. If one factor has three right extensions and every other factor has one, then (p(n+1)-p(n)=2).
  5. If a word uses an alphabet of size (k), (p(n)>k^n) is impossible and reveals a counting or alphabet-definition error.
  6. If a finite word of length (N) reports more than (N-n+1) distinct length-(n) factors, positions have been double-created.
  7. If two words have the same (p(n)), they may still contain disjoint factor vocabularies; equal counts do not prove language equality.
  8. If factor complexity grows subexponentially, topological entropy is zero, but the word can remain highly nonperiodic.
  9. If (p(n)=k^n) for every (n), every finite word over (A) occurs; the source has maximal factor diversity independent of factor frequencies.
  10. If an arbitrary language has (p_L(n)=0) for odd (n), no monotonicity contradiction follows because its length slices need not extend.
  11. If a regular language has superpolynomial growth, the regular-language dichotomy pushes it into an exponential regime rather than an intermediate one.
  12. If the equivalence relation changes from exact equality to equality up to letter permutation, the result is abelian complexity and can be much smaller.

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.

Alphabet recoding can preserve or change the function. A bijective relabeling preserves all factor identities and counts. A non-injective coding can merge blocks and lower complexity. A sliding block code between shift spaces can change length correspondence and factor counts while constraining entropy. Therefore “same underlying sequence” must name the coding.

Outside symbolic sequence domains, a rolling-window distinct-count curve has a similar skeleton, but interpreting it as factor complexity requires discrete symbols, contiguity, exact equality, and a length-indexed language. The portable residue—Cardinality by scale, Diversity, Growth Rate, Classification, and Entropy—belongs to primes; symbolic extension and periodicity remain the domain accent.

Examples

  • constant word: \(u=a^\omega\) has (p_u(n)=1) for every (n), because only (a^n) occurs;
  • alternating periodic word: \(u=(ab)^\omega\) has two factors of every positive length, one beginning with (a) and one with (b);
  • Sturmian word: the Fibonacci word is aperiodic and has (p_u(n)=n+1), the minimum possible for binary aperiodicity;
  • maximally rich word: a disjunctive infinite word over (k) symbols contains all length-(n) blocks and has (p_u(n)=k^n);
  • finite source: ababa has factors of length two {ab, ba}, so (p(2)=2) although four windows occur;
  • language growth: (L=a*b*) has (p_L(n)=n+1), one word (a^i b^{n-i}) for each split \(0\le i\le n\);
  • oscillating arbitrary language: \(L=\{a^{2m}:m\ge0\}\) has value one at even lengths and zero at odd lengths, unlike an infinite word’s factor profile;
  • abelian variant: two factors with the same letter counts but different order remain distinct under ordinary factor complexity and merge under abelian complexity;
  • non-example—frequency: counting how often ab occurs is a frequency statistic, not the number of distinct length-two factors;
  • non-example—runtime: the time required by a suffix automaton to compute all (p(n)) is algorithmic complexity of the computation, not the values being computed.

Structural Tensions

  • compression vs. completeness — one count per length enables classification, while it discards factor identities, locations, and frequencies;
  • local blocks vs. global organization — factor sets are local, while their growth can force global periodicity or entropy behavior;
  • word case vs. language case — one counting formula unifies them, while factorial closure makes their admissible theorems different;
  • finite observation vs. infinite claim — a finite prefix supplies lower bounds on factor diversity, while periodicity or asymptotic growth concerns the infinite source;
  • exact equality vs. coarser equivalence — exact blocks preserve order, while abelian or other variants reveal different structure by merging classes;
  • low growth vs. randomness intuition — low complexity can be aperiodic and mathematically rich, while high distinctness need not imply probabilistic randomness;
  • entropy rate vs. subexponential detail — entropy separates exponential from subexponential growth, while many important word families all have zero entropy and require finer (p(n)) analysis;
  • alphabet dependence vs. recoding invariance — bijective relabeling preserves counts, while symbol merging or block coding can change them;
  • theoretical profile vs. computation — the function is well defined, while computing it efficiently for large finite data requires suffix structures or other algorithms.

Structural–Framed Character

The node is structural. Once the alphabet, source object, sidedness, occurrence relation, equivalence relation, and length are declared, the factor set and its cardinality are determined. Periodicity bounds, extension identities, and entropy rates are mathematical consequences rather than interpretive judgments.

Small framing choices still matter at the boundary: whether “subword” means factor or subsequence, whether the source is finite or infinite, whether the language is arbitrary or factorial, and whether equality is ordinary or abelian. These are specification choices, not evaluative or institutional frames. Making them explicit resolves the apparent ambiguity.

Structural Core vs. Domain Accent

The structural core is scale parameter + local-window extraction + equivalence classes + distinct count + growth profile + threshold classification. The domain accent is finite alphabet, word, contiguous factor, factorial language, left/right extension, recurrence, periodicity, Sturmian minimality, automata growth, and symbolic entropy.

Remove the accent and one obtains a generic diversity-by-scale statistic. Retain only a scalar “complexity” and the decisive length-indexed factor grammar disappears. The domain node earns autonomy from the way local extension structure makes its counts diagnose symbolic dynamics.

  • Complexity — factor diversity is one exact formalization of intricacy across observation scales.
  • Cardinality — each value is the size of a finite set of equivalence classes.
  • Diversity — multiplicity is discarded so distinct local types, not abundance, determine the value.
  • Growth Rate — polynomial, exponential, and intermediate regimes classify the profile.
  • Threshold — the Morse–Hedlund boundary converts one low count into a periodicity conclusion.
  • Classification — named sequence and language families are separated by exact or asymptotic profiles.
  • Entropy — exponential block growth yields topological entropy after logarithmic normalization.
  • Recurrence — repeated return of factors supplies additional structure not contained by their counts alone.
  • Quotienting — ordinary and variant complexities depend on which blocks are identified.

domain_specific:unavoidable_pattern is a retrieval neighbor only: it quantifies morphic pattern forcing across all long words and does not count the factors of a source. The smallest prospective parent is prime:complexity; factor complexity is a strict combinatorics-on-words specialization rather than exact coverage by that broad prime.

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) — more general patterns this builds on

  • 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

Neighborhood in Abstraction Space

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

Family — Unclustered & Miscellaneous (1565 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-09-08

Not to Be Confused With

  • computational time or space complexity;
  • Kolmogorov or descriptional complexity;
  • state or quotient complexity of an automaton;
  • cyclomatic, graph, or circuit complexity;
  • factor occurrence frequency or a block probability distribution;
  • Shannon entropy, although factor growth defines topological entropy;
  • scattered-subword or subsequence complexity;
  • palindromic complexity counting only palindromic factors;
  • abelian complexity identifying factors by Parikh vector;
  • an Unavoidable Pattern or pattern-avoidance threshold;
  • cumulative count of factors up to length (n);
  • language growth with word-length at most (n), unless that cumulative convention is declared.

References

[1] M. Lothaire, Algebraic Combinatorics on Words, Encyclopedia of Mathematics and its Applications 90 (Cambridge University Press, 2002), https://www.ams.org/bookpages/crmm-27. registry ↩a ↩b

[2] Andrew Szilard, Sheng Yu, Kaizhong Zhang, and Jeffrey Shallit, “Characterizing Regular Languages with Polynomial Densities,” in MFCS 1992, LNCS 629: 494–503, https://doi.org/10.1007/3-540-55808-X_48. registry ↩a ↩b

[3] Marston Morse and Gustav A. Hedlund, “Symbolic Dynamics II: Sturmian Trajectories,” American Journal of Mathematics 62 (1940): 1–42, https://doi.org/10.2307/2371431. registry

[4] Jean-Paul Allouche and Jeffrey Shallit, Automatic Sequences: Theory, Applications, Generalizations (Cambridge University Press, 2003), https://doi.org/10.1017/CBO9780511546563. registry ↩a ↩b

[5] Sébastien Ferenczi, “Complexity of Sequences and Dynamical Systems,” Discrete Mathematics 206 (1999): 145–154, https://doi.org/10.1016/S0012-365X(98)00430-0. registry

[6] Douglas Lind and Brian Marcus, An Introduction to Symbolic Dynamics and Coding, 2nd ed. (Cambridge University Press, 2021), https://doi.org/10.1017/9781108899727. registry

[7] Paweł Gawrychowski, Dalia Krieger, Narad Rampersad, and Jeffrey Shallit, “Finding the Growth Rate of a Regular or Context-Free Language in Polynomial Time,” in DLT 2008, LNCS 5257: 339–358, https://doi.org/10.1007/978-3-540-85780-8_27. registry

[8] Julien Cassaigne, “Complexity and Special Factors,” Bulletin of the Belgian Mathematical Society—Simon Stevin 4 (1997): 67–88. registry

[9] “Complexity function,” Wikipedia, frozen revision 1370334555, https://en.wikipedia.org/wiki/Complexity_function. registry