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 ...
and
computer science Computer science is the study of computation, automation, and information. Computer science spans theoretical disciplines (such as algorithms, theory of computation, information theory, and automation) to Applied science, practical discipli ...
, optimal addition-chain exponentiation is a method of
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 ...
by a positive
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
power that requires a minimal number of multiplications. Using ''the form of'' the shortest addition chain, with multiplication instead of addition, computes the desired exponent (instead of multiple) of the base. (This corresponds to .) 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 non-minimal addition chains constructed by a variety of algorithms (since a shortest addition chain is very difficult to find). The shortest addition-chain
algorithm In mathematics and computer science, an algorithm () is a finite sequence of rigorous instructions, typically used to solve a class of specific problems or to perform a computation. Algorithms are used as specifications for performing ...
requires no more multiplications than binary exponentiation and usually less. The first example of where it does better is for ''a''15, where the binary method needs six multiplications but the shortest addition chain requires only five: :a^ = a \times (a \times \times a^22)^2 \! (binary, 6 multiplications) :a^ = ( ^22 \times a)^3 \! (shortest addition chain, 5 multiplications). :a^ = a^3 \times ( ^32)^2 \! (also shortest addition chain, 5 multiplications). On the other hand, the determination of a shortest addition chain is hard: no efficient optimal methods are currently known for arbitrary exponents, and the related problem of finding a shortest addition chain for a given set of exponents has been proven NP-complete. Even given a shortest chain, addition-chain exponentiation requires more memory than the binary method, because it must potentially store many previous exponents from the chain. So in practice, shortest addition-chain exponentiation is primarily used for small fixed exponents for which a shortest chain can be pre-computed and is not too large. There are also several methods to ''approximate'' a shortest addition chain, and which often require fewer multiplications than binary exponentiation; binary exponentiation itself is a suboptimal addition-chain algorithm. The optimal 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). The problem of finding the shortest addition chain cannot be solved by
dynamic programming Dynamic programming is both a mathematical optimization method and a computer programming method. The method was developed by Richard Bellman in the 1950s and has found applications in numerous fields, from aerospace engineering to economics. ...
, 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 minimally, since the addition chains for the smaller powers may be related (to share computations). For example, in the shortest 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). However, the slowness of division compared to multiplication makes this technique unattractive in general. 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 a shortest addition chain for ''a''31 requires 7 multiplications and one division, whereas the shortest addition-subtraction chain requires 5 multiplications and one division: :a^ = a / ((((a^2)^2)^2)^2)^2 \! (addition-subtraction chain, 5 mults + 1 div). For exponentiation on
elliptic curve In mathematics, an elliptic curve is a smooth, projective, algebraic curve of genus one, on which there is a specified point . An elliptic curve is defined over a field and describes points in , the Cartesian product of with itself. I ...
s, 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.François Morain and Jorge Olivos,
Speeding up the computations on an elliptic curve using addition-subtraction chains
, ''RAIRO Informatique théoretique et application'' 24, pp. 531-543 (1990).


References

{{Reflist * Donald E. Knuth, ''The Art of Computer Programming, Volume 2: Seminumerical Algorithms'', 3rd edition, §4.6.3 (Addison-Wesley: San Francisco, 1998). * Daniel J. Bernstein,
Pippenger's Algorithm
, to be incorporated into author's ''High-speed cryptography'' book. (2002) Addition chains Computer arithmetic algorithms Exponentials