Construct Tribonacci Words
Construct Tribonacci words by iterative morphism substitution. Visualize word growth, letter frequencies, and Tribonacci number properties up to any iteration.
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.
Formulas
The Tribonacci word is generated by iterated application of a morphism Ο over the alphabet {a, b, c}. The substitution rules are:
Starting from w0 = a, each subsequent word is wn+1 = Ο(wn). The length satisfies the Tribonacci recurrence:
with initial conditions T(0) = 1, T(1) = 2, T(2) = 4. The growth ratio converges to the tribonacci constant Ξ², the real root of:
which yields Ξ² ≈ 1.839286755214161. The substitution matrix M of Ο is:
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 n | Word Length T(n) | Count of a | Count of b | Count of c | Ratio T(n)/T(nβ1) |
|---|---|---|---|---|---|
| 0 | 1 | 1 | 0 | 0 | - |
| 1 | 2 | 1 | 1 | 0 | 2.000 |
| 2 | 4 | 2 | 1 | 1 | 2.000 |
| 3 | 7 | 4 | 2 | 1 | 1.750 |
| 4 | 13 | 7 | 4 | 2 | 1.857 |
| 5 | 24 | 13 | 7 | 4 | 1.846 |
| 6 | 44 | 24 | 13 | 7 | 1.833 |
| 7 | 81 | 44 | 24 | 13 | 1.841 |
| 8 | 149 | 81 | 44 | 24 | 1.840 |
| 9 | 274 | 149 | 81 | 44 | 1.839 |
| 10 | 504 | 274 | 149 | 81 | 1.839 |
| 11 | 927 | 504 | 274 | 149 | 1.839 |
| 12 | 1,705 | 927 | 504 | 274 | 1.840 |
| 13 | 3,136 | 1,705 | 927 | 504 | 1.839 |
| 14 | 5,768 | 3,136 | 1,705 | 927 | 1.839 |
| 15 | 10,609 | 5,768 | 3,136 | 1,705 | 1.839 |
| 16 | 19,513 | 10,609 | 5,768 | 3,136 | 1.839 |
| 17 | 35,890 | 19,513 | 10,609 | 5,768 | 1.839 |
| 18 | 66,012 | 35,890 | 19,513 | 10,609 | 1.839 |
| 19 | 121,415 | 66,012 | 35,890 | 19,513 | 1.839 |
| 20 | 223,317 | 121,415 | 66,012 | 35,890 | 1.839 |