Search NKS | Online

The first m rules (which yield far more than m elements of the original sequence) are obtained for any h that is not a rational number from the continued fraction form (see page 914 ) of h by Map[(({0  Join[#, {1}], 1  Join[#, {1, 0}]} &)[Table[0, {# - 1}]]) &, Reverse[Rest[ContinuedFraction[h, m]]]] Given these rules, the original sequence is given by Floor[h] + Fold[Flatten[#1 /. #2] &, {0}, rules] If h is the solution to a quadratic equation, then the continued fraction form is repetitive, and so there are a limited number of different substitution rules. … For h = GoldenRatio the substitution system is {0  {1}, 1  {1, 0}} (see page 890 ), for h = √ 2 it is {0  {0, 1}, 1  {0, 1, 0}} (see page 892 ) and for h = √ 3 it is {0  {1, 1, 0}, 1  {1, 1, 0, 1}} . (The presence of nested structure is particularly evident in FoldList[Plus, 0, Table[Mod[h n, 1] - 1/2, {n, max}]] .)
Equation for the background [in my PDEs] If u[t, x] is independent of x , as it is sufficiently far away from the main pattern, then the partial differential equation on page 165 reduces to the ordinary differential equation u''[t]  (1 - u[t] 2 )(1 + a u[t]) u[0]  u'[0]  0 For a = 0 , the solution to this equation can be written in terms of Jacobi elliptic functions as ( √ 3 JacobiSN[t/3 1/4 , 1/2] 2 ) / (1 + JacobiCN[t/3 1/4 , 1/2] 2 ) In general the solution is (b d JacobiSN[r t, s] 2 )/(b - d JacobiCN[r t, s] 2 ) where r = -Sqrt[1/8 a c (b - d)] s = (d (c - b))/(c (d - b)) and b , c , d are determined by the equation (x - b)(x - c)(x - d)  -(12 + 6 a x - 4 x 2 - 3 a x 3 )/(3a) In all cases (except when -8/3 < a < -1/ √ 6 ), the solution is periodic and non-singular. For a = 0 , the period is 2 3 1/4 EllipticK[1/2] ≃ 4.88 . … For a = 8/3 , the solution can be written without Jacobi elliptic functions, and is given by 3 Sin[Sqrt[5/6] t] 2 /(2 + 3 Cos[Sqrt[5/6] t] 2 )
[Rules for the] primes cellular automaton The rules are {{13, 3, 13}  12, {6, _, 4}  15, {10, _, 3 | 11}  15, {13, 7, _}  8, {13, 8, 7}  13, {15, 8, _}  1, {8, _, _}  7, {15, 1, _}  2, {_, 1, _}  1, {1, _, _}  8, {2 | 4 | 5, _, _}  13, {15, 2, _}  4, {_, 4, 8}  4, {_, 4, _}  5, {_, 5, _}  3, {15, 3, _}  12, {_, x : (2 | 3 | 8), _}  x, {_, x : (11 | 12), _}  x - 1, {11, _, _}  13, {13, _, 1 | 2 | 3 | 5 | 6 | 10 | 11}  15, {13, 0, 8}  15, {14, _, 6 | 10}  15, {10, 0 | 9 | 13, 6 | 10}  15, {6, _, 6}  0, {_, _, 10}  9, {6 | 10, 15, 9}  14, {_, 6 | 10, 9 | 14 | 15}  10, {_,6|10,_}  6, {6 | 10, 15, _}  13, {13 | 14, _, 9 | 15}  14, {13 | 14, _, _}  13, {_, _, 15}  15, {_, _, 9 | 14}  9, {_, _, _}  0} and the initial conditions consist of {10, 0, 4, 8} surrounded by 0 's.
Implementation [of 2D cellular automata] An n × n array of white squares with a single black square in the middle can be generated by PadLeft[{{1}}, {n, n}, 0, Floor[{n, n}/2]] For the 5-neighbor rules introduced on page 170 each step can be implemented by CAStep[rule_, a_] := Map[rule 〚 10 - # 〛 &, ListConvolve[{{0, 2, 0}, {2, 1, 2}, {0, 2, 0}}, a, 2], {2}] where rule is obtained from the code number by IntegerDigits[code, 2, 10] . For the 9-neighbor rules introduced on page 177 CAStep[rule_, a_] := Map[rule 〚 18 - # 〛 &, ListConvolve[{{2, 2, 2}, {2, 1, 2}, {2, 2, 2}}, a, 2], {2}] where rule is given by IntegerDigits[code, 2, 18] . In d dimensions with k colors, 5-neighbor rules generalize to (2d + 1) -neighbor rules, with CAStep[{rule_, d_}, a_] := Map[rule 〚 -1 - # 〛 &, a + k AxesTotal[a, d], {d}] AxesTotal[a_, d_] := Apply[Plus, Map[RotateLeft[a, #] + RotateRight[a, #]&, IdentityMatrix[d]]] with rule given by IntegerDigits[code, k, k(2d(k - 1) + 1)] . 9-neighbor rules generalize to 3 d -neighbor rules, with CAStep[{rule_, d_}, a_] := Map[rule 〚 -1 - # 〛 &, a + k FullTotal[a, d], {d}] FullTotal[a_, d_] := Array[RotateLeft[a, {##}] &, Table[3, {d}], -1, Plus] - a with rule given by IntegerDigits[code, k, k((3 d - 1)(k - 1) + 1)] .
An example is Gray code ordering, in which successive numbers are arranged to differ in only one digit. … The number which appears at position i is given by BitXor[i, Floor[i/2]] . (Iterating the related function BitXor[i, 2i] yields numbers whose digit sequences correspond to the rule 60 cellular automaton).
(a_  s_)  (rtab 〚 i k + a + 1 〛  k 2r (s - 1) + 1 + Mod[i k + a, k 2r ]), {i, 0, k 2r - 1}]&, net], 1] where here elementary rule 126 is specified for example by {2, 1, Reverse[IntegerDigits[126, 2, 8]]} . Starting from the set of all possible sequences, as given by AllNet[k_:2] := {Thread[(Range[k] - 1)  1]} this then yields for rule 126 the network {{0  1, 1  2}, {1  3, 1  4}, {1  1, 1  2}, {1  3, 0  4}} It is always possible to find a minimal network that represents a set of sequences. … The result from MinNet for rule 126 is {{1  3}, {02, 1  1}, {02,1  3}} .
The evolution of the system for t steps can be obtained from SSEvolve[rule_, init_, t_, d_Integer] := Nest[FlattenArray[# /. rule, d] &, init, t] FlattenArray[list_, d_] := Fold[Function[{a, n}, Map[MapThread[Join, #, n] &, a, -{d + 2}]], list, Reverse[Range[d] - 1]] The analog in 3D of the 2D rule on page 187 is {1  Array[If[LessEqual[##], 0, 1] &, {2, 2, 2}], 0  Array[0 &, {2, 2, 2}]} Note that in d dimensions, each black cell must be replaced by at least d + 1 black cells at each step in order to obtain an object that is not restricted to a dimension d - 1 hyperplane.
Multiplication systems [from cellular automata] The rules for the cellular automaton shown here are {{_, 0, 3 | 8}  5, {_, 0, 2 | 7}  8, {_, 1, 4 | 9}  9, {_, 1, 3 | 8}  4, {_, 1, 2 | 7}  8, {_, 10, 4 | 9}  3, {_, 10, 3 | 8}  7, {_, 10, 2 | 7}  2, {5 | 6, 1, 0}  9, {5 | 6, 10, 0}  3, {5 | 6, 1, _}  6, {5 | 6, 10, _}  5, {_, 2 | 3 | 4 | 5, _}  10, {_, 6 | 7 | 8 | 9, _}  1, {_, x_, _}  x} and the initial condition consists of a single 3 surrounded by 0 's. … After t steps, the width of the pattern shown here is about Sqrt[Log[2, 3] t] .
Central Limit Theorem Averages of large collections of random numbers tend to follow a Gaussian or normal distribution in which the probability of getting value x is Exp[-(x - μ ) 2 /(2 σ 2 )] / (Sqrt[2 π ] σ ) The mean μ and standard deviation σ are determined by properties of the random numbers, but the form of the distribution is always the same. The only conditions are that the random numbers should be statistically independent, and that their distribution should have bounded variance, so that, for example, the probability for very large numbers is rapidly damped. (The limit of an infinite collection of numbers gives σ  0 in accordance with the law of large numbers.)
0 through 9. … And in practical computers, for example, base 2 is almost always what is used. … Digit sequences of successive numbers written in base 2.
1 ... 12131415 ...