Search NKS | Online
    31 - 40 of 121 for     Table
    
[History of] truth tables
The method of finding results in logic by enumerating all possible combinations of truth values seems to have been rediscovered many times since antiquity. 
      
            
            An example is {"Ax"  "AAxx", "xA"  "BAA", "xB"  "Bx"} starting with "AAxBA" , which generates expressions of the form Table["A", {n}] <> Table["B", {n}] <> Table["A", {n}] .
      
            
            Boolean formulas
A Boolean function of n variables can always be specified by an explicit table giving values for all 2 n possible inputs. (Any cellular automaton rule with an n -cell neighborhood corresponds to such a function; digit sequences in rule numbers correspond to explicit tables of values.) 
      
            
            Digit reversal
Sequences of the form
Table[FromDigits[ Reverse[IntegerDigits[n, k, m]], k], {n, 0, k m - 1}]
shown below appear in algorithms such as the fast Fourier transform and, with different values of k for different coordinates, in certain quasi-Monte Carlo schemes. 
      
            
            Billiards
A somewhat related system is formed by a billiard ball bouncing around on a table. 
      
            
            If the rules for a one-element-dependence tag system are given in the form {2, {{0, 1}, {0, 1, 1}}} (compare page 1114 ), the initial conditions for the Turing machine are
TagToMTM[{2, rule_}, init_] := With[{b = FoldList[Plus, 1, Map[Length, rule] + 1]}, Drop[Flatten[{Reverse[Flatten[{1, Map[{Map[ {1, 0, Table[0, {b 〚 # + 1 〛 }]} &, #], 1} &, rule], 1}]], 0, 0, Map[{Table[2, {b 〚 # + 1 〛 }], 3} &, init]}], -1]]
surrounded by 0 's, with the head on the leftmost 2 , in state 1 . 
      
            
            Finding layouts [for networks]
One way to lay out a network g so that network distances in it come as close as possible to ordinary distances in d -dimensional space, is just to search for values of the x[i, k] which minimize a quantity such as
With[{n = Length[g]}, Apply[Plus, Flatten[(Table[Distance[g, {i, j}], {i, n}, {j, n}] 2 - Table[ Sum[(x[i, k] - x[j, k]) 2 , {k, d}], {i, n}, {j, n}]) 2 ]]]
using for example FindMinimum starting say with x[1, _]  0 and all the other x[_, _]  Random[] . 
      
            
            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}]}]]]]
      
            
            As an example, the table on the next page gives the digit sequences for some cube roots and fourth roots, as well as for some logarithms and exponentials. 
      
            
            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. … (The presence of nested structure is particularly evident in FoldList[Plus, 0, Table[Mod[h n, 1] - 1/2, {n, max}]] .)