Chapter 3: The World of Simple Programs

Section 5: Substitution Systems

Other examples [of substitution systems]

(a) (Period-doubling sequence) After t steps, there are a total of 2t elements, and the sequence is given by Nest[MapAt[1 - # &, Join[#, #], -1]&, {0}, t]. It contains a total of Round[2t/3] black elements, and if the last element is dropped, it forms a palindrome. The nth element is given by Mod[IntegerExponent[n, 2], 2]. As discussed on page 885, the sequence appears in a vertical column of cellular automaton rule 150. The Thue–Morse sequence discussed on page 890 can be obtained from it by applying

1 - Mod[Flatten[Partition[FoldList[Plus, 0, list], 1, 2]], 2]

(b) The nth element is simply Mod[n, 2].

(c) Same as (a), after the replacement 1 {1, 1} in each sequence. Note that the spectra of (a) and (c) are nevertheless different, as discussed on page 1080.

(d) The length of the sequence at step t satisfies a[t] 2a[t - 1] + a[t - 2], so that a[t] = Round[(1 + 2)t - 1/2] for t > 1. The number of white elements at step t is then Round[a[t]/2]. Much like example (c) on page 83 there are m + 1 distinct blocks of length m, and with f = Floor[(1 - 1/2)(# + 1/2)] & the nth element of the sequence is given by f[n + 1] - f[n] (see page 903).

(e) For large t the number of elements increases like λt with λ = (13 + 1)/2; there are always λ times as many white elements as black ones.

(f) The number of elements at step t is Round[(1 + 2)t/2], and the nth element is given by Floor[2 (n + 1)] - Floor[2 n] (see page 903).

(g) The number of elements is the same as in (f).

(h) The number of black elements is 2t - 1; the total number of elements is 2t - 2 (t + 1).

(i) and (j) The total number of elements is 3t - 1.

Image Source Notebooks:

From Stephen Wolfram: A New Kind of Science [citation]