Addition chain

From Wikipedia, the free encyclopedia
Jump to: navigation, search

In mathematics, an addition chain for computing a positive integer n can be given by a sequence of natural numbers v and a sequence of index pairs w such that each term in v is the sum of two previous terms, the indices of those terms being specified by w:

v =(v0,...,vs), with v0 = 1 and vs = n
for each 0< is holds: vi = vj + vk, with wi=(j,k) and 0 ≤ j,ki − 1

Often only v is given since it is easy to extract w from v, but sometimes w is not uniquely reconstructible. An introduction is given in [1].

Contents

[edit] Examples

As an example: v = (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: so for example we only need 7 multiplications to calculate 531:

52 = 51 × 51
53 = 52 × 51
56 = 53 × 53
512 = 56 × 56
524 = 512 × 512
530 = 524 × 56
531 = 530 × 51

[edit] 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.[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 to calculate relatively short chains exist. One very well known technique to calculate relatively short addition chains is the binary method, similar to exponentiation by squaring. Other well-known methods are the factor method and window method.[citation needed]

[edit] Notations

A Brauer chain or star addition chain is an addition chain in which one of the summands is always the previous chain: that is,

for each k>0: ak = ak-1 + aj for some j < k.

Brauer number is one for which the Brauer chain is minimal.

Let l(n) denote the smallest s so that there exists an addition chain of length s which computes n. It is known that [3]

\log(n)+ \log(\nu(n))-2.13\leq l(n) \leq \log(n) + \log(n)(1+o(1))/\log(\log(n)),

where \nu(n) is Hamming weight of binary expansion of n.

[edit] See also

[edit] Notes

  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 single addition chain is NP-complete, citing this paper, but it does not claim or prove such a result.
  3. ^ A. Schonhage A lower bound on the length of addition chains, Theoret. Comput. Sci. 1 (1975), 1–12.

[edit] References

[edit] External links

Personal tools
Namespaces

Variants
Actions
Navigation
Interaction
Toolbox
Print/export
Languages