fbpx
Wikipedia

Addition chain

In mathematics, an addition chain for computing a positive integer n can be given by a sequence of natural numbers starting with 1 and ending with n, 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 of the sequence of numbers.[1]

Examples edit

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. This method allows exponentiation 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 n using only seven multiplications, instead of the 30 multiplications that one would get from repeated multiplication, and eight multiplications with exponentiation by squaring:

n2 = n × n
n3 = n2 × n
n6 = n3 × n3
n12 = n6 × n6
n24 = n12 × n12
n30 = n24 × n6
n31 = n30 × n

Methods for computing addition chains edit

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.[2] 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.[3]

One very well known technique to calculate relatively short addition chains is the binary method, similar to exponentiation by squaring. In this method, an addition chain for the number   is obtained recursively, from an addition chain for  . If   is even, it can be obtained in a single additional sum, as  . If   is odd, this method uses two sums to obtain it, by computing   and then adding one.[3]

The factor method for finding addition chains is based on the prime factorization of the number   to be represented. If   has a number   as one of its prime factors, then an addition chain for   can be obtained by starting with a chain for  , and then concatenating onto it a chain for  , modified by multiplying each of its numbers by  . The ideas of the factor method and binary method can be combined into Brauer's m-ary method by choosing any number   (regardless of whether it divides  ), recursively constructing a chain for  , concatenating a chain for   (modified in the same way as above) to obtain  , and then adding the remainder. Additional refinements of these ideas lead to a family of methods called sliding window methods.[3]

Chain length edit

Let   denote the smallest   so that there exists an addition chain of length   which computes  . It is known that

 ,

where   is the Hamming weight (the number of ones) of the binary expansion of  .[4]

One can obtain an addition chain for   from an addition chain for   by including one additional sum  , from which follows the inequality   on the lengths of the chains for   and  . However, this is not always an equality, as in some cases   may have a shorter chain than the one obtained in this way. For instance,  , observed by Knuth.[5] It is even possible for   to have a shorter chain than  , so that  ; the smallest   for which this happens is  ,[6] which is followed by  ,  , and so on (sequence A230528 in the OEIS).

Brauer chain edit

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.[5]

Brauer proved that

l*(2n−1) ≤ n − 1 + l*(n)

where   is the length of the shortest star chain. For many values of n, and in particular for n < 12509, they are equal:[7] l(n) = l*(n). But Hansen showed that there are some values of n for which l(n) ≠ l*(n), such as n = 26106 + 23048 + 22032 + 22016 + 1 which has l*(n) = 6110, l(n) ≤ 6109. The smallest such n is 12509.

Scholz conjecture edit

The Scholz conjecture (sometimes called the Scholz–Brauer or Brauer–Scholz conjecture), named after Arnold Scholz and Alfred T. Brauer), is a conjecture from 1937 stating that

 

This inequality is known to hold for all Hansen numbers, a generalization of Brauer numbers; Neill Clift checked by computer that all   are Hansen (while 5784689 is not).[6] Clift further verified that in fact   for all  .[5]

See also edit

References edit

  1. ^ D. E. Knuth, The Art of Computer Programming, Vol 2, "Seminumerical Algorithms", Section 4.6.3, 3rd edition, 1997
  2. ^ Downey, Peter; Leong, Benton; Sethi, Ravi (1981), "Computing sequences with addition chains", SIAM Journal on Computing, 10 (3): 638–646, doi:10.1137/0210047. A number of other papers state that finding a shortest addition chain for a single number is NP-complete, citing this paper, but it does not claim or prove such a result.
  3. ^ a b c Otto, Martin (2001), (PDF), Diplomarbeit, University of Paderborn, archived from the original (PDF) on 2013-10-19, retrieved 2013-10-19.
  4. ^ Schönhage, Arnold (1975), "A Lower Bound for the Length of Addition Chains", Theoretical Computer Science, 1 (1): 1–12, doi:10.1016/0304-3975(75)90008-0
  5. ^ a b c Guy (2004) p.169
  6. ^ a b Clift, Neill Michael (2011). "Calculating optimal addition chains" (PDF). Computing. 91 (3): 265–284. doi:10.1007/s00607-010-0118-8.
  7. ^ Achim Flammenkamp, Shortest Addition Chains

External links edit

addition, chain, mathematics, addition, chain, computing, positive, integer, given, sequence, natural, numbers, starting, with, ending, with, such, that, each, number, sequence, previous, numbers, length, addition, chain, number, sums, needed, express, numbers. In mathematics an addition chain for computing a positive integer n can be given by a sequence of natural numbers starting with 1 and ending with n 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 of the sequence of numbers 1 Contents 1 Examples 2 Methods for computing addition chains 3 Chain length 4 Brauer chain 5 Scholz conjecture 6 See also 7 References 8 External linksExamples editAs 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 This method allows exponentiation 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 n using only seven multiplications instead of the 30 multiplications that one would get from repeated multiplication and eight multiplications with exponentiation by squaring n 2 n n n 3 n 2 n n 6 n 3 n 3 n 12 n 6 n 6 n 24 n 12 n 12 n 30 n 24 n 6 n 31 n 30 nMethods for computing addition chains editCalculating 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 2 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 3 One very well known technique to calculate relatively short addition chains is the binary method similar to exponentiation by squaring In this method an addition chain for the number n displaystyle n nbsp is obtained recursively from an addition chain for n n 2 displaystyle n lfloor n 2 rfloor nbsp If n displaystyle n nbsp is even it can be obtained in a single additional sum as n n n displaystyle n n n nbsp If n displaystyle n nbsp is odd this method uses two sums to obtain it by computing n 1 n n displaystyle n 1 n n nbsp and then adding one 3 The factor method for finding addition chains is based on the prime factorization of the number n displaystyle n nbsp to be represented If n displaystyle n nbsp has a number p displaystyle p nbsp as one of its prime factors then an addition chain for n displaystyle n nbsp can be obtained by starting with a chain for n p displaystyle n p nbsp and then concatenating onto it a chain for p displaystyle p nbsp modified by multiplying each of its numbers by n p displaystyle n p nbsp The ideas of the factor method and binary method can be combined into Brauer s m ary method by choosing any number m displaystyle m nbsp regardless of whether it divides n displaystyle n nbsp recursively constructing a chain for n m displaystyle lfloor n m rfloor nbsp concatenating a chain for m displaystyle m nbsp modified in the same way as above to obtain m n m displaystyle m lfloor n m rfloor nbsp and then adding the remainder Additional refinements of these ideas lead to a family of methods called sliding window methods 3 Chain length editLet l n displaystyle l n nbsp denote the smallest s displaystyle s nbsp so that there exists an addition chain of length s displaystyle s nbsp which computes n displaystyle n nbsp It is known that log 2 n log 2 n n 2 13 l n log 2 n log 2 n 1 o 1 log 2 log 2 n displaystyle 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 nbsp where n n displaystyle nu n nbsp is the Hamming weight the number of ones of the binary expansion of n displaystyle n nbsp 4 One can obtain an addition chain for 2 n displaystyle 2n nbsp from an addition chain for n displaystyle n nbsp by including one additional sum 2 n n n displaystyle 2n n n nbsp from which follows the inequality l 2 n l n 1 displaystyle l 2n leq l n 1 nbsp on the lengths of the chains for n displaystyle n nbsp and 2 n displaystyle 2n nbsp However this is not always an equality as in some cases 2 n displaystyle 2n nbsp may have a shorter chain than the one obtained in this way For instance l 382 l 191 11 displaystyle l 382 l 191 11 nbsp observed by Knuth 5 It is even possible for 2 n displaystyle 2n nbsp to have a shorter chain than n displaystyle n nbsp so that l 2 n lt l n displaystyle l 2n lt l n nbsp the smallest n displaystyle n nbsp for which this happens is n 375494703 displaystyle n 375494703 nbsp 6 which is followed by 602641031 displaystyle 602641031 nbsp 619418303 displaystyle 619418303 nbsp and so on sequence A230528 in the OEIS Brauer chain editA 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 5 Brauer proved that l 2n 1 n 1 l n where l displaystyle l nbsp is the length of the shortest star chain For many values of n and in particular for n lt 12509 they are equal 7 l n l n But Hansen showed that there are some values of n for which l n l n such as n 26106 23048 22032 22016 1 which has l n 6110 l n 6109 The smallest such n is 12509 Scholz conjecture editMain article Scholz conjecture The Scholz conjecture sometimes called the Scholz Brauer or Brauer Scholz conjecture named after Arnold Scholz and Alfred T Brauer is a conjecture from 1937 stating that l 2 n 1 n 1 l n displaystyle l 2 n 1 leq n 1 l n nbsp This inequality is known to hold for all Hansen numbers a generalization of Brauer numbers Neill Clift checked by computer that all n 5784688 displaystyle n leq 5784688 nbsp are Hansen while 5784689 is not 6 Clift further verified that in fact l 2 n 1 n 1 l n displaystyle l 2 n 1 n 1 l n nbsp for all n 64 displaystyle n leq 64 nbsp 5 See also editAddition subtraction chain Vectorial addition chain Lucas chainReferences edit D E Knuth The Art of Computer Programming Vol 2 Seminumerical Algorithms Section 4 6 3 3rd edition 1997 Downey Peter Leong Benton Sethi Ravi 1981 Computing sequences with addition chains SIAM Journal on Computing 10 3 638 646 doi 10 1137 0210047 A number of other papers state that finding a shortest addition chain for a single number is NP complete citing this paper but it does not claim or prove such a result a b c Otto Martin 2001 Brauer addition subtraction chains PDF Diplomarbeit University of Paderborn archived from the original PDF on 2013 10 19 retrieved 2013 10 19 Schonhage Arnold 1975 A Lower Bound for the Length of Addition Chains Theoretical Computer Science 1 1 1 12 doi 10 1016 0304 3975 75 90008 0 a b c Guy 2004 p 169 a b Clift Neill Michael 2011 Calculating optimal addition chains PDF Computing 91 3 265 284 doi 10 1007 s00607 010 0118 8 Achim Flammenkamp Shortest Addition Chains Brauer Alfred 1939 On addition chains Bulletin of the American Mathematical Society 45 10 736 739 doi 10 1090 S0002 9904 1939 07068 7 ISSN 0002 9904 MR 0000245 Richard K Guy 2004 Unsolved Problems in Number Theory Springer Verlag ISBN 978 0 387 20860 2 OCLC 54611248 Zbl 1058 11001 Section C6 External links edithttp wwwhomes uni bielefeld de achim addition chain html OEIS sequence A003313 Length of shortest addition chain for n 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 Retrieved from https en wikipedia org w index php title Addition chain amp oldid 1191752635, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.