Search NKS | Online
131 - 140 of 272 for Length
LFSR cryptanalysis
Given a sequence obtained from a length n LFSR (see page 975 )
Nest[Mod[Append[#, Take[#, -n] . vec], 2] &, list, t]
the vector of taps vec can be deduced from
LinearSolve[Table[Take[seq, {i, i + n - 1}], {i, n}], Take[seq, {n + 1, 2n}], Modulus 2]
(An iterative algorithm in n taking about n 2 rather than n 3 steps was given by Elwyn Berlekamp and James Massey in 1968.)
Entropy estimates [for sequences]
Fitting the number of distinct blocks of length b to the form k h b for large b the quantity h gives the so-called topological entropy of the system.
Somewhat related to the curves shown here is the function MoebiusMu[n] , equal to 0 if n has a repeated prime factor and otherwise (-1)^Length[FactorInteger[n]] .
Surprisingly enough, this simple procedure, which can be represented by the function
s[list_] := Flatten[ Transpose[Reverse[Partition[list, Length[list]/2]]]]
with or without the Reverse , is able to produce orderings which at least in some respects seem quite random.
Testing all 11,019,960,576 possible programs of length eight revealed just this and 125 similar cases of complex behavior.
In the first part of each step, the material is stretched to twice its original length.
The rule is set up so that if the value of n is written in the form i + 5 , 2 a , 3 b then the values of i , a and b on successive steps correspond respectively to the position of the register machine in its program, and to the values of the two registers (2 and 3 appear because they are the first two primes; 5 appears because it is the length of the register machine program).
Specifying an operator f (taken in general to have n arguments with k possible values) by giving the rule number u for f[p, q, …] , the rule number for an expression with variables vars can be obtained from
With[{m = Length[vars]}, FromDigits[ Block[{f = Reverse[IntegerDigits[u, k, k n ]] 〚 FromDigits[ {##}, k] + 1 〛 &}, Apply[Function[Evaluate[vars], expr], Reverse[Array[IntegerDigits[# - 1, k, m] &, k m ]], {1}]], k]]
Note that the rules can be thought of as replacements such as "A>" for blocks of length 4 with 4 colors.
For strings the analogous problem is straightforward, since in a string of length n one can ultimately just try each of the n possible starting points for the substring and see for which of them a match occurs.