Addition Chain
   HOME

TheInfoList



OR:

In
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, an addition chain for computing a positive integer can be given by a
sequence In mathematics, a sequence is an enumerated collection of objects in which repetitions are allowed and order matters. Like a set, it contains members (also called ''elements'', or ''terms''). The number of elements (possibly infinite) is calle ...
of
natural number In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country"). Numbers used for counting are called ''Cardinal n ...
s starting with 1 and ending with , such that each number in the sequence is the sum of two previous numbers. The ''length'' of an addition chain is the number of sums needed to express all its numbers, which is one less than the
cardinality In mathematics, the cardinality of a set is a measure of the number of elements of the set. For example, the set A = \ contains 3 elements, and therefore A has a cardinality of 3. Beginning in the late 19th century, this concept was generalized ...
of the sequence of numbers.


Examples

As an example: (1,2,3,6,12,24,30,31) is an addition chain for 31 of length 7, since :2 = 1 + 1 :3 = 2 + 1 :6 = 3 + 3 :12 = 6 + 6 :24 = 12 + 12 :30 = 24 + 6 :31 = 30 + 1 Addition chains can be used for
addition-chain exponentiation In mathematics and computer science, optimal addition-chain exponentiation is a method of exponentiation by a positive integer power that requires a minimal number of multiplications. Using ''the form of'' the shortest addition chain, with multipl ...
. This method allows
exponentiation Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to re ...
with integer exponents to be performed using a number of multiplications equal to the length of an addition chain for the exponent. For instance, the addition chain for 31 leads to a method for computing the 31st power of any number using only seven multiplications, instead of the 30 multiplications that one would get from repeated multiplication, and eight multiplications with
exponentiation by squaring Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to re ...
: :2 = × :3 = 2 × :6 = 3 × 3 :12 = 6 × 6 :24 = 12 × 12 :30 = 24 × 6 :31 = 30 ×


Methods for computing addition chains

Calculating an addition chain of minimal length is not easy; a generalized version of the problem, in which one must find a chain that simultaneously forms each of a sequence of values, is NP-complete. There is no known algorithm which can calculate a minimal addition chain for a given number with any guarantees of reasonable timing or small memory usage. However, several techniques are known to calculate relatively short chains that are not always optimal.. One very well known technique to calculate relatively short addition chains is the ''binary method'', similar to
exponentiation by squaring Exponentiation is a mathematical operation, written as , involving two numbers, the '' base'' and the ''exponent'' or ''power'' , and pronounced as " (raised) to the (power of) ". When is a positive integer, exponentiation corresponds to re ...
. In this method, an addition chain for the number n is obtained recursively, from an addition chain for n'=\lfloor n/2\rfloor. If n is even, it can be obtained in a single additional sum, as n=n'+n'. If n is odd, this method uses two sums to obtain it, by computing n-1=n'+n' and then adding one. The ''factor method'' for finding addition chains is based on the prime factorization of the number n to be represented. If n has a number p as one of its prime factors, then an addition chain for n can be obtained by starting with a chain for n/p, and then concatenating onto it a chain for p, modified by multiplying each of its numbers by n/p. The ideas of the factor method and binary method can be combined into ''Brauer's m-ary method'' by choosing any number m (regardless of whether it divides n), recursively constructing a chain for \lfloor n/m\rfloor, concatenating a chain for m (modified in the same way as above) to obtain m\lfloor n/m\rfloor, and then adding the remainder. Additional refinements of these ideas lead to a family of methods called ''sliding window methods''.


Chain length

Let l(n) denote the smallest s so that there exists an addition chain of length s which computes n. It is known that :\log_2(n)+ \log_2(\nu(n))-2.13\leq l(n) \leq \log_2(n) + \log_2(n)(1+o(1))/\log_2(\log_2(n)), where \nu(n) is the
Hamming weight The Hamming weight of a string is the number of symbols that are different from the zero-symbol of the alphabet used. It is thus equivalent to the Hamming distance from the all-zero string of the same length. For the most typical case, a string o ...
(the number of ones) of the binary expansion of n. One can obtain an addition chain for 2n from an addition chain for n by including one additional sum 2n=n+n, from which follows the inequality l(2n)\le l(n)+1 on the lengths of the chains for n and 2n. However, this is not always an equality, as in some cases 2n may have a shorter chain than the one obtained in this way. For instance, l(382)=l(191)=11, observed by Knuth. It is even possible for 2n to have a shorter chain than n, so that l(2n)< l(n); the smallest n for which this happens is n=375494703, which is followed by 602641031, 619418303, and so on .


Brauer chain

A Brauer chain or star addition chain is an addition chain in which each of the sums used to calculate its numbers uses the immediately previous number. A Brauer number is a number for which a Brauer chain is optimal. Brauer proved that : where is the length of the shortest star chain. For many values of ''n'', and in particular for , they are equal:Achim Flammenkamp
Shortest Addition Chains
/ref> . But Hansen showed that there are some values of ''n'' for which , such as which has . The smallest such ''n'' is 12509.


Scholz conjecture

The
Scholz conjecture In mathematics, the Scholz conjecture is a conjecture on the length of certain addition chains. It is sometimes also called the Scholz–Brauer conjecture or the Brauer–Scholz conjecture, after Arnold Scholz who formulated it in 1937 and Alfre ...
(sometimes called the ''Scholz–Brauer'' or ''Brauer–Scholz conjecture''), named after
Arnold Scholz Arnold Scholz (24 December 1904 in Berlin – 1 February 1942 in Flensburg) was a German mathematician who proved Scholz's reciprocity law and introduced the Scholz conjecture. Scholz participated in the Second Conference on the Epistemology ...
and Alfred T. Brauer), is a
conjecture In mathematics, a conjecture is a conclusion or a proposition that is proffered on a tentative basis without proof. Some conjectures, such as the Riemann hypothesis (still a conjecture) or Fermat's Last Theorem (a conjecture until proven in 19 ...
from 1937 stating that : l(2^n-1) \le n - 1 + l(n). This inequality is known to hold for all Hansen numbers, a generalization of Brauer numbers; Neill Clift checked by computer that all n \le 5784688 are Hansen (while 5784689 is not). Clift further verified that in fact l(2^n-1) = n - 1 + l(n) for all n \le 64.Guy (2004) p.169


See also

*
Addition-subtraction chain An addition-subtraction chain, a generalization of addition chains to include subtraction, is a sequence ''a''0, ''a''1, ''a''2, ''a''3, ... that satisfies :a_0 = 1, \, :\textk > 0,\ a_k = a_i \pm a_j\text0 \leq i,j < k. An addition-subtrac ...
*
Vectorial addition chain In mathematics, for positive integers ''k'' and ''s'', a vectorial addition chain is a sequence ''V'' of ''k''-dimensional vectors of nonnegative integers ''v'i'' for −''k'' + 1 ≤ ''i'' ≤ ''s'' together with a sequence ''w'', such that ...
*
Lucas chain In mathematics, a Lucas chain is a restricted type of addition chain, named for the French mathematician Édouard Lucas. It is a sequence :''a''0, ''a''1, ''a''2, ''a''3, ... that satisfies :''a''0=1, and :for each ''k'' > 0: ''a'k'' = '' ...


References

* * Section C6.


External links

* http://wwwhomes.uni-bielefeld.de/achim/addition_chain.html * . Note that the initial "1" is not counted (so element #1 in the sequence is 0).
F. Bergeron, J. Berstel. S. Brlek "Efficient computation of addition chains"
{{DEFAULTSORT:Addition Chain *