User Rating 0.0 β˜…β˜…β˜…β˜…β˜…
Total Usage 0 times
Higher iterations produce exponentially longer words
Οƒ(a)=ab, Οƒ(b)=ac, Οƒ(c)=a
Is this tool helpful?

Your feedback helps us improve.

β˜… β˜… β˜… β˜… β˜…

About

The Tribonacci word is a fixed point of the morphism Οƒ defined on the alphabet {a, b, c} by Οƒ(a) = ab, Οƒ(b) = ac, Οƒ(c) = a. It generalizes the Fibonacci word to a three-letter alphabet and exhibits factor complexity C(n) = 2n + 1, making it a Rauzy fractal generator and a canonical example of an episturmian word. Miscounting iteration depth or confusing the morphism rules produces words with incorrect combinatorial properties, invalidating any downstream analysis in tiling theory or numeration systems.

The length of the word at iteration n follows the Tribonacci number sequence T(n), where T(n) = T(nβˆ’1) + T(nβˆ’2) + T(nβˆ’3). This tool constructs the actual word string at each iteration, computes symbol frequencies, and reports growth metrics. Note: the word length grows exponentially (ratio converging to the tribonacci constant Ξ² 1.839286), so iterations beyond 28 produce words exceeding 10 million characters and are capped to prevent browser memory exhaustion.

tribonacci word morphism combinatorics on words substitution system tribonacci sequence formal languages fibonacci generalization

Formulas

The Tribonacci word is generated by iterated application of a morphism Οƒ over the alphabet {a, b, c}. The substitution rules are:

Οƒ(a) = ab , Οƒ(b) = ac , Οƒ(c) = a

Starting from w0 = a, each subsequent word is wn+1 = Οƒ(wn). The length satisfies the Tribonacci recurrence:

T(n) = T(n βˆ’ 1) + T(n βˆ’ 2) + T(n βˆ’ 3)

with initial conditions T(0) = 1, T(1) = 2, T(2) = 4. The growth ratio converges to the tribonacci constant Ξ², the real root of:

x3 = x2 + x + 1

which yields Ξ² 1.839286755214161. The substitution matrix M of Οƒ is:

M = 111100010

Where Οƒ = the morphism (substitution function), wn = the Tribonacci word at iteration n, T(n) = length of wn (Tribonacci number), Ξ² = tribonacci constant (1.839286...), M = the incidence matrix whose columns encode how many of each letter each rule produces.

Reference Data

Iteration nWord Length T(n)Count of aCount of bCount of cRatio T(n)/T(nβˆ’1)
01100 -
121102.000
242112.000
374211.750
4137421.857
52413741.846
644241371.833
7814424131.841
81498144241.840
927414981441.839
10504274149811.839
119275042741491.839
121,7059275042741.840
133,1361,7059275041.839
145,7683,1361,7059271.839
1510,6095,7683,1361,7051.839
1619,51310,6095,7683,1361.839
1735,89019,51310,6095,7681.839
1866,01235,89019,51310,6091.839
19121,41566,01235,89019,5131.839
20223,317121,41566,01235,8901.839

Frequently Asked Questions

The Fibonacci word uses a 2-letter alphabet {a, b} with morphism Οƒ(a) = ab, Οƒ(b) = a, producing lengths following the Fibonacci sequence. The Tribonacci word extends this to a 3-letter alphabet {a, b, c} with Οƒ(a) = ab, Οƒ(b) = ac, Οƒ(c) = a. Its lengths follow the Tribonacci recurrence T(n) = T(nβˆ’1) + T(nβˆ’2) + T(nβˆ’3), and it generates the Rauzy fractal in ℝ³ rather than the simpler 1D quasiperiodic tiling of the Fibonacci case.
The factor complexity C(n), counting the number of distinct subwords of length n, equals 2n + 1 for all n β‰₯ 1. This is the minimum possible for a 3-letter aperiodic word, classifying it as an Arnoux-Rauzy (episturmian) word. By comparison, a Sturmian word on 2 letters has complexity n + 1.
The substitution matrix M has characteristic polynomial xΒ³ βˆ’ xΒ² βˆ’ x βˆ’ 1 = 0. Its dominant real root Ξ² β‰ˆ 1.839286755214161 is the tribonacci constant. By the Perron-Frobenius theorem, the ratio T(n)/T(nβˆ’1) converges to this dominant eigenvalue. The other two roots are complex conjugates with modulus less than 1, so their contribution decays exponentially.
Each character in JavaScript occupies 2 bytes (UTF-16). At iteration 25, the word length is approximately 1.3 million characters (~2.6 MB). At iteration 28, it reaches ~8.1 million characters (~16 MB). Beyond iteration 30 (~27.5 million characters, ~55 MB), most browsers will struggle with string allocation. This tool caps at iteration 28 to prevent tab crashes.
Yes. This tool allows custom morphism rules. For example, setting Οƒ(a) = abc, Οƒ(b) = a, Οƒ(c) = b yields a different substitutive sequence with its own growth rate determined by the dominant eigenvalue of the corresponding 3Γ—3 incidence matrix. The tool recomputes all statistics for any valid custom morphism.
The Rauzy fractal is the projection of the stepped surface (the "broken line" of the Tribonacci word embedded in β„€Β³) onto the contracting plane of the substitution matrix M. It is a connected, simply connected compact set that tiles the plane by translation. The fractal has Hausdorff dimension equal to the fractal boundary dimension, approximately 1.0933. The Tribonacci word encodes the symbolic dynamics of the toral rotation associated with this fractal.