Search NKS | Online
251 - 260 of 681 for Novo Curso De Direito Civil - Vol. 1 - Parte Geral - 26ª EdGagliano, Pablo StolzeSaraiva Jur
At each step there is a number x between 0 and 1 that is updated by applying a fixed mapping. … In all cases, the initial conditions consist of the number 1/2—which has a very simple digit sequence.
So as an example the picture below shows a rule that determines the new gray level for a cell by just adding the constant 1/4 to the average gray level for the cell and its immediate neighbors, and then taking the fractional part of the result.
… A continuous cellular automaton whose rule adds the constant 1/4 to the average gray level for a cell and its immediate neighbors, and takes the fractional part of the result.
[Turing] machine 596440
For any list of initial colors init , it turns out that successive rows in the first t steps of the compressed evolution pattern turn out to be given by
NestList[Join[{0}, Mod[1 + Rest[FoldList[Plus, 0, #]], 2], {{0}, {1, 1, 0}} 〚 Mod[Apply[Plus, #], 2] + 1] 〛 &, init, t]
Inside the right-hand part of this pattern the cell values can then be obtained from an upside-down version of the rule 60 additive cellular automaton, and starting from a sequence of 1 's the picture below shows that a typical rule 60 nested pattern can be produced, at least in a limited region.
The number of steps for which a cell at position n will survive can be computed as
Module[{q = n + k - 1, s = 1}, While[Mod[q, k] ≠ 0, q = Ceiling[(k - 1)q/k]; s++]; s]
If a cell is going to survive for s steps, then it turns out that this can be determined by looking at the last s digits in the base k representation of its position. … The solution is Fold[Mod[#1 + k, #2, 1]&, 0, Range[n]] , or FromDigits[RotateLeft[IntegerDigits[n, 2]], 2] for k = 2 .
Implementing cellular automata
It is convenient to represent the state of a cellular automaton at each step by a list such as {0, 0, 1, 0, 0} , where 0 corresponds to a white cell and 1 to a black cell. … Thus, for example, rule 30 on page 27 corresponds to the list {0, 0, 0, 1, 1, 1, 1, 0} . … In some earlier versions of Mathematica a considerably faster version of the program can be created by using the definition
CAStep = Compile[{{rule, _Integer, 1}, {a, _Integer, 1}}, rule 〚 8 - (RotateLeft[a] + 2 (a + 2 RotateRight[a])) 〛 ]
In addition, in Mathematica 4 and above, one can use
CAStep[rule_, a_]:=rule 〚 8 - ListConvolve[{1, 2, 4}, a, 2]]] 〛
or directly in terms of the rule number num
Sign[BitAnd[2^ListConvolve[{1, 2, 4}, a, 2], num]]
(In versions of Mathematica subsequent to the release of this book the built-in CellularAutomaton function can be used, as discussed on page 867 .)
Exact iterates [in iterated maps]
For any integer a the n th iterate of x FractionalPart[a x] can be written as FractionalPart[a n x] , or equivalently 1/2 - ArcTan[Cot[a n π x]]/ π . In the specific case a = 2 the iterates of If[x < 1/2, a x, a (1 - x)] have the form ArcCos[Cos[2 n π x]]/ π .
Rule 30 inversion
The total numbers of sequences for t from 1 to 15 not yielding stripes of heights 1 and 2 are respectively
{1, 2, 2, 3, 3, 6, 6, 10, 16, 31, 52, 99, 165, 260}
{2, 5, 8, 14, 23, 40, 66, 111, 182, 316, 540, 921, 1530, 2543, 4122}
The sideways evolution of rule 30 discussed on page 601 implies that if one fills cells from the left rather than the right then some sequence of length t + 1 will always yield any given stripe of height t .
Properties [of example multiway systems]
The second rule shown has the property that black elements always appear before white, so that strings can be specified just by the number of elements of each color that they contain—making the rule one of the sorted type discussed on page 937 , based on the difference vector {{2,-1}, {-1,3}, {-4,-1}} .
Implementation of general cellular automata
With k colors and r neighbors on each side, a single step in the evolution of a general cellular automaton is given by
CAStep[CARule[rule_List, k_, r_], a_List] := rule 〚 -1 - ListConvolve[k^Range[0, 2r], a, r + 1] 〛
where rule is obtained from a rule number num by IntegerDigits[num, k, k 2r + 1 ] .
Projections from 3D [cellular automata]
Looking from above, with closer cells shown darker, the following show patterns generated after 30 steps, by (a) the rule at the top of page 183 , (b) the rule at the bottom of page 183 , (c) the rule where a cell becomes black if exactly 3 out of 26 neighbors were black and (d) the same as (c), but with a 3×3×1 rather than a 3×1×1 initial block of black cells: