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 2^t elements, and the sequence is given by Nest[MapAt[1-#&, Join[#, #], -1]&, {0}, t]. It contains a total of Round[2^t/3] black elements, and if the last element is dropped, it forms a palindrome. The n^th 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


(b) The n^th 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 + Sqrt[2])^(t - 1)/2] for t>1. The number of white elements at step t is then Round[a[t]/Sqrt[2]]. Much like example (c) on page 83 there are m+1 distinct blocks of length m, and with f = Floor[(1 - 1/Sqrt[2])(# + 1/Sqrt[2])] & the n^th 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 λ=(Sqrt[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+Sqrt[2])^t/2], and the n^th element is given by Floor[Sqrt[2] (n+1)]-Floor[Sqrt[2] n] (see page 903).

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

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

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

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