Search NKS | Online
11 - 20 of 34 for Floor
The number which appears at position i is given by BitXor[i, Floor[i/2]] .
The color of the element at position n is given by 2 - (Floor[(n + 1) GoldenRatio] - Floor[n GoldenRatio]) (see page 904 ), while the position of the k th white element is given by the so-called Beatty sequence Floor[k GoldenRatio] .
The result turns out to be given by 2 IntegerExponent[x + 1, 2] + 3 , which has a maximum of 2n+3 , where n is the length of the digit sequence of x , or Floor[Log[2, x]] .
Non-periodic pattern [forced by 2D constraint]
The color at position x, y in the pattern is given by
a[x_, y_] := Mod[y + 1, 2] /; x + y > 0
a[x_, y_] := 0 /; Mod[x + y, 2] 1
a[x_, y_] := Mod[Floor[(x - y) 2 (x + y - 6)/4 ], 2] /; Mod[x + y, 4] 2
a[x_, y_] := 1 - Sign[Mod[x - y + 2, 2 (-x - y + 8)/4 ]]
The origin of the x, y coordinates is the only freedom in this pattern.
Following work by Kirill Sitnikov in 1960 and by Vladimir Alekseev in 1968, it was established that with suitably chosen initial conditions, the equation yields any sequence Floor[t[i + 1] - t[i]] of successive zero-crossing times t[i] .
For any sequence s this can be done using
Module[{c, m = 0}, Map[c[#] = {m, m += Count[s, #]/Length[s]} &, Union[s]]; Function[x, (First[RealDigits[2 # Ceiling[2 -# Min[x]], 2, -#, -1]] &)[Floor[Log[2, Max[x] - Min[x]]]]][ Fold[(Max[#1] - Min[#1]) c[#2] + Min[#1] &, {0, 1}, s]]]
Huffman coding of a sequence containing a single 0 block together with n 1 blocks will yield output of length about n ; arithmetic coding will yield length about Log[n] .
From the result on page 890 , the number whose digits are obtained from {1 {1, 0}, 0 {1}} is given by Sum[2^(-Floor[n GoldenRatio]), {n, ∞ }] .
Note that if one uses base 6 rather than base 2, then as shown on page 614 powers of 3 still yield a complicated pattern, but all operations are strictly local, and the system corresponds to a cellular automaton with 6 possible colors for each cell and rule {a_, b_, c_} 3 Mod[b, 2] + Floor[c/2] (see page 1093 ).
If the codewords are chosen so that every pair differs by at least r elements (or equivalently, have so-called Hamming distance at least r ), then this means that errors in up to Floor[(r - 1)/2] elements can be corrected, and finding suitable codewords is like finding packings of spheres in n -dimensional space.
(In Mathematica 4 and above PadLeft[{1}, n, 0, Floor[n/2]] can be used instead.)