Addition-chain exponentiation

Addition-chain exponentiation

In mathematics and computer science, optimal addition-chain exponentiation is a method of exponentiation by positive integer powers that requires a minimal number of multiplications. It works by creating a minimal-length addition chain that generates the desired exponent. Each exponentiation in the chain can be evaluated by multiplying two of the earlier exponentiation results. More generally, "addition-chain exponentiation" may also refer to exponentiation by sub-optimal addition chains constructed by a variety of algorithms (since an optimal addition chain is very difficult to find).

The optimal addition-chain algorithm requires fewer multiplications than binary exponentiation for large exponents. The first example of where it does better is for a^{15}, where the binary method needs six multiplies but an optimal addition chain requires only five:

:a^{15} = a imes (a imes [a imes a^2] ^2)^2 ! (binary, 6 multiplies):a^{15} = a^3 imes ( [a^3] ^2)^2 ! (optimal addition chain, 5 multiplies)

On the other hand, the addition-chain method is much more complicated, since the determination of an optimal addition chain seems quite difficult: no efficient optimal methods are currently known for arbitrary exponents, and the related problem of finding an optimal addition sequence has been proven NP-complete (Downey et al., 1981). Even given an optimal chain, addition-chain exponentiation requires more memory than the binary method, because it must potentially store many previous exponents from the chain simultaneously. In practice, therefore, optimal addition-chain exponentiation is primarily used for small fixed exponents for which the optimal chain can be precomputed and is not too large.

However, there are also several methods to "approximate" an optimal addition chain, and which often require fewer multiplications than binary exponentiation. Indeed, binary exponentiation itself is a suboptimal addition-chain algorithm. The best algorithm choice depends on the context (such as the relative cost of the multiplication and the number of times a given exponent is re-used). See Gordon (1998) for a survey.

Note that the problem of finding the optimal addition chain cannot be solved by dynamic programming, because it does not satisfy the assumption of optimal substructure. That is, it is not sufficient to decompose the power into smaller powers, each of which is computed optimally, since the addition chains for the smaller powers may be related (to share computations). For example, in the optimal addition chain for a^{15} above, the subproblem for a^6 must be computed as (a^3)^2 since a^3 is re-used (as opposed to, say, a^6 = a^2 (a^2)^2, which also requires three multiplies).

Addition-subtraction–chain exponentiation

If both multiplication and division are allowed, then an addition-subtraction chain may be used to obtain even fewer total multiplications+divisions (where subtraction corresponds to division). The slowness of division compared to multiplication makes this technique unattractive in general, however. For exponentiation to negative integer powers, on the other hand, since one division is required anyway, an addition-subtraction chain is often beneficial. One such example is a^{-31}, where computing 1/a^{31} by the optimal addition chain for a^{31} requires 7 multiplications and one division, whereas the optimal addition-subtraction chain requires 5 multiplications and one division:

:a^{-31} = a / ((((a^2)^2)^2)^2)^2 ! (addition-subtraction chain, 5 mults + 1 div)

For exponentiation on elliptic curves, the inverse of a point (x,y) is available at no cost, since it is simply (x,-y), and therefore addition-subtraction chains are optimal in this context even for positive integer exponents.

References

* Donald E. Knuth, "The Art of Computer Programming, Volume 2: Seminumerical Algorithms", 3rd edition, §4.6.3 (Addison-Wesley: San Francisco, 1998).
* Daniel M. Gordon, " [http://citeseer.ist.psu.edu/519252.html A survey of fast exponentiation methods] ," "J. Algorithms" 27, 129-146 (1998).
* Daniel J. Bernstein, " [http://cr.yp.to/papers/pippenger.pdf Pippenger's Algorithm] ," to be incorporated into author's "High-speed cryptography" book. (2002)
* Peter Downey, Benton Leong, and Ravi Sethi, "Computing sequences with addition chains," "SIAM J. Computing" 10 (3), 638-646 (1981).


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • Addition chain — In mathematics, an addition chain is a sequence a 0, a 1, a 2, a 3, ... that satisfies: a 0 = 1, and :for each k >0: a k = a i + a j for some i , j < k .As an example: 1, 2, 3, 6, 12, 24, 30, 31 is an addition chain for 31, of length 7, since:2 …   Wikipedia

  • Exponentiation — Exponent redirects here. For other uses, see Exponent (disambiguation). Exponentiation is a mathematical operation, written as an, involving two numbers, the base a and the exponent (or power) n. When n is a positive integer, exponentiation… …   Wikipedia

  • Exponentiation by squaring — Exponentiating by squaring is an algorithm used for the fast computation of large integer powers of a number. It is also known as the square and multiply algorithm or binary exponentiation. In additive groups the appropriate name is double and… …   Wikipedia

  • 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, ,: ext{for }k > 0, a k = a i pm a j ext{ for some }0 leq i,j < k.An addition subtraction… …   Wikipedia

  • List of mathematics articles (A) — NOTOC A A Beautiful Mind A Beautiful Mind (book) A Beautiful Mind (film) A Brief History of Time (film) A Course of Pure Mathematics A curious identity involving binomial coefficients A derivation of the discrete Fourier transform A equivalence A …   Wikipedia

  • List of numerical analysis topics — This is a list of numerical analysis topics, by Wikipedia page. Contents 1 General 2 Error 3 Elementary and special functions 4 Numerical linear algebra …   Wikipedia

  • Lucas–Lehmer test — This article is about the generalized Lucas–Lehmer test for primality. There is also a Lucas–Lehmer test that only applies to Mersenne numbers; see Lucas–Lehmer test for Mersenne numbers. In computational number theory, the Lucas–Lehmer test is a …   Wikipedia

  • List of algebraic structures — In universal algebra, a branch of pure mathematics, an algebraic structure is a variety or quasivariety. Abstract algebra is primarily the study of algebraic structures and their properties. Some axiomatic formal systems that are neither… …   Wikipedia

  • Outline of algebraic structures — In universal algebra, a branch of pure mathematics, an algebraic structure is a variety or quasivariety. Abstract algebra is primarily the study of algebraic structures and their properties. Some axiomatic formal systems that are neither… …   Wikipedia

  • Knuth's up-arrow notation — In mathematics, Knuth s up arrow notation is a method of notation of very large integers introduced by Donald Knuth in 1976. It is closely related to the Ackermann function. The idea is based on iterated exponentiation in much the same way that… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”