Search NKS | Online
11 - 20 of 165 for FromDigits
The patterns are produced by starting from a single black square and then running for 22 steps. In each case the base 2 digit sequence for the code number specifies the rule as follows. … And each earlier digit then specifies what should happen if progressively more neighbors are black.
Chaos Theory and Randomness from Initial Conditions…But in the second case, the sequence of digits is regular, and so the behavior is correspondingly regular.
… And indeed, the whole idea of the mechanism for randomness in this section is precisely that any randomness we see must come from randomness in the initial conditions for the system we are looking at.
… For what has happened is that from an implicit assumption made in the mathematics of chaos theory, the conclusion has been drawn that random digit sequences should be almost inevitable among the numbers that occur in practice.
Given two numbers x and y their product can be computed in base k by ( FromDigits does the carries)
FromDigits[ListConvolve[IntegerDigits[x, k], IntegerDigits[y, k], {1, -1}, 0], k]
For numbers with n digits direct evaluation of the convolution would take about n 2 steps. … One might think that a more efficient approach would be to start with the trivial length t digit sequence for c t in base c , then to find a particular base k digit just by converting to base k . … Note that even though one may only want to find a single digit in m t , I know of no way to do this without essentially computing all the other digits in m t as well.
Symmetric 5-neighbor [2D cellular automaton] rules
Among the 32 possible 5-cell neighborhoods shown for example on page 941 there are 12 classes related by symmetries, given by
s = {{1}, {2, 3, 9, 17}, {4, 10, 19, 25}, {5}, {6, 7, 13, 21}, {8, 14, 23, 29}, {11, 18}, {12, 20, 26, 27}, {15, 22}, {16, 24, 30, 31}, {28}, {32}}
Completely symmetric 5-neighbor rules can be numbered from 0 to 4095, with each digit specifying the new color of the cell for each of these symmetry classes of neighborhoods. Such rule numbers can be converted to general form using
FromDigits[Map[Last, Sort[Flatten[Map[Thread, Thread[{s, IntegerDigits[n, 2, 12]}]], 1]]], 2]
[No text on this page]
The same iterated maps as on the facing page , but now started from the initial condition π/4 —a number with a seemingly random digit sequence. After fairly few steps, cases (a) and (b) yield behavior that is almost indistinguishable from what was seen with simple initial conditions on the facing page . … But looking at digit sequences one realizes that this complexity is actually just a direct transcription of complexity introduced by giving an initial condition with a seemingly random digit sequence.
Hashing
Given data in the form of sequences of numbers between 0 and k - 1 , a very simple hashing scheme is just to compute FromDigits[Take[list, n], k] . … The slightly modified but still very simple scheme Mod[FromDigits[list, k], m] , where m is usually chosen to be a prime, is what is most often used in practice. For a fair fraction of values of m , the hash codes obtained from this scheme change whenever any element of list is changed.
number obtained has 48,554 (base 10) digits, there is still no sign of repetition or of any other significant regularity.
… The underlying rules for systems like cellular automata are however usually rather different from those for systems based on numbers. … One knows from hand calculation that even an operation such as addition can lead to "carry" digits which propagate arbitrarily far to the left.
Patterns of digits in various bases generated by successive multiplication by a fixed factor. … The value of the cell at position n from the end of row t is thus the n th digit of m t , or Mod[Quotient[m t , k n ], k] . … Cellular automaton rules equivalent to multiplication of digit sequences in various bases.
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. For k = 2 , a cell survives for s steps if these digits are all 0 (so that s IntegerExponent[n, k] ). … The solution is Fold[Mod[#1 + k, #2, 1]&, 0, Range[n]] , or FromDigits[RotateLeft[IntegerDigits[n, 2]], 2] for k = 2 .
Reversal-addition systems
The operation that is performed here is
n n + FromDigits[Reverse[IntegerDigits[n, 2]], 2]
After a few steps, the digit sequence obtained is typically reversal symmetric (a generalized palindrome) except for the interchange of 0 and 1, and for the presence of localized structures. The sequence expands by at least one digit every two steps; more rapid expansion is typically correlated with increased randomness. … If one always includes one new digit on the left at every step, even when it is 0, then a rather random pattern is produced.