# Search NKS | Online

1 - 10 of 39 for Partition

The partitioning into identifiable structures is similar to what we saw in rule 110 on page 32 .

Recursive subdivision [encoding]
In one dimension, encoding can be done using
Subdivide[a_] := Flatten[ If[Length[a] 2, a, If[Apply[SameQ, a], {1,First[a]}, {0, Map[Subdivide, Partition[a, Length[a]/2]]}]]]
In n dimensions, it can be done using
Subdivide[a_, n_] := With[{s = Table[1, {n}]}, Flatten[ If[Dimensions[a] 2s, a, If[Apply[SameQ, Flatten[a]], {1, First[Flatten[a]]}, {0, Map[Subdivide[#, n] &, Partition[a, 1/2Length[a] s], {n}]}]]]]

Starting in the 1930s the idea of symbolic dynamics began to emerge, in which one partitions continuous values in a system into bins represented by discrete symbols, and then looks at the sequences of such symbols that can be produced by the evolution of the system. … But since—unlike in cellular automata—the symbol sequences being studied were obtained by rather arbitrary partitionings of continuous values, the question arose of what effect using different partitionings would have. One approach was to try to find invariants that would remain unchanged in different partitionings—and this is what led, for example, to the study of topological entropy in the 1960s.

Thus, for example, rule 30 can be given as
{{1, 1, 1} 0, {1, 1, 0} 0, {1, 0, 1} 0, {1, 0, 0} 1, {0, 1, 1} 1, {0, 1, 0} 1, {0, 0, 1} 1, {0, 0, 0} 0}
To use rules in this form, CAStep can be rewritten as
CAStep[rule_, a_List] := Transpose[{RotateRight[a], a, RotateLeft[a]}] /. rule
or
CAStep[rule_, a_List] := Partition[a, 3, 1, 2] /. rule
The rules that are given can now contain patterns, so that rule 90, for example, can be written as
{{1, _, 1} 0, {1, _, 0} 1, {0, _, 1} 1, {0, _, 0} 0}
But how can one set up a program that can handle rules in several different forms? … Then, for example, one can define
CAStep[ElementaryCARule[rule_List], a_List] := rule 〚 8 - (RotateLeft[a] + 2 (a + 2 RotateRight[a])) 〛
CAStep[GeneralCARule[rule_, r_Integer:1], a_List] := Partition[a, 2r + 1, 1, r + 1] /. rule
CAStep[FunctionCARule[f_, r_Integer:1], a_List] := Map[f, Partition[a, 2r + 1, 1, r + 1]]
Note that the second two definitions have been generalized to allow rules that involve r neighbors on each side. In each case, the use of Partition could be replaced by Transpose[Table[RotateLeft[a, i], {i, -r, r}]] .

Numbering scheme [for Turing machines]
One can number Turing machines and get their rules using
Flatten[MapIndexed[{1, -1} #2 + {0, k} {1, 1, 2} Mod[Quotient[#1, {2k, 2, 1}], {s, k, 2}] + {1, 0, -1} &, Partition[IntegerDigits[n, 2 s k, s k], k], {2}]]
The examples on page 79 have numbers 3024, 982, 925, 1971, 2506 and 1953.

To check whether an array list contains only arrangements of colors corresponding to allowed templates one can then use
SatisfiedQ[list_, allowed_] := Apply[And, Map[MatchQ[#, allowed] &, Partition[list, {3, 3}, {1, 1}], {2}], {0, 1}]

The system works by partitioning the sequence of cells that exists at each step into pairs, then replacing these pairs by other pairs according to the rule shown.

Neighbor-dependent [2D] substitution systems
Given a list of individual replacement rules such as {{_, 1}, {0, 1}} {{1, 0}, {1, 1}} , each step in the evolution shown corresponds to
Flatten2D[Partition[list, {2, 2}, 1, -1] /. rule]
One can consider rules in which some replacements lead to subdivision of elements but others do not.

The total number of commutative groups with k elements is just
Apply[Times, Map[PartitionsP[Last[#]] &, FactorInteger[k]]]
(Relabelling of elements makes the number of possible operator forms up to k!

EvenQ] := Partition[ Fold[Insert[#1, #2, Random[Integer, Length[#1]] + 1] &, {}, Floor[Range[1, n + 2/3, 1/3]]], 2]
Networks obtained in this way are usually connected, but will almost always contain self-loops and multiple edges.