ArticleslgStudy

computer science

Addition-chain exponentiation

Addition-chain exponentiation is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Addition-chain exponentiation rather than just read about it. In short: 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 multiplication instead of addition, computes the desired exponent (instead of multiple) of the base.

Addition-chain exponentiation — main illustration
Addition-chain exponentiation — illustration

Key takeaways

  • Addition-chain exponentiation belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Addition-chain exponentiation to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Addition-chain exponentiation from memory before moving on to harder problems.

Reference excerpt

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 multiplication instead of addition, computes the desired exponent (instead of multiple) of the base. (This corresponds to OEIS sequence A003313 (Length of shortest addition chain for n).) 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 requires no more multiplications than binary exponentiation and usually less. The first example of where it does better is for a15, where the binary method needs six multiplications, but the shortest addition chain requires only five:

a15=a×(a×[a×a2]2)2 (binary, 6 multiplications) a15=([a2]2×a)3 (shortest addition chain, 5 multiplications). a15=a3×([a3]2)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, 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 a15 above, the subproblem for a6 must be computed as (a3)2, since a3 is re-used (as opposed to, say, a6 = a2(a2)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/a31 by a shortest addition chain for a31 requires 7 multiplications and 1 division, whereas the shortest addition-subtraction chain requires 5 multiplications and 1 division:

a−31=a/((((a2)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 J. Bernstein, "Pippenger's Algorithm", to be incorporated into author's High-speed cryptography book. (2002)

Illustrations

Addition-chain exponentiation: Minimum number of multiplications needed to obtain the nth power, for 1 ≤ n ≤ 100
Minimum number of multiplications needed to obtain the nth power, for 1 ≤ n ≤ 100

Worked examples

Example 1 — a first encounter with Addition-chain exponentiation

Start with the simplest possible case. Write down what Addition-chain exponentiation claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Addition-chain exponentiation before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Addition-chain exponentiation ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Addition-chain exponentiation

In research
Addition-chain exponentiation appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Addition-chain exponentiation in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Addition-chain exponentiation is common in secondary-school and first-year university syllabi. It links to neighbouring topics Addition chains, Computer arithmetic algorithms, Exponentials, so understanding it makes those chapters shorter.
In everyday life
Look for Addition-chain exponentiation outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Addition-chain exponentiation” →

How to study Addition-chain exponentiation in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Addition-chain exponentiation means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Addition-chain exponentiation out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Addition-chain exponentiation in simple terms?

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 multiplication instead of addition, computes the desired expone…

Why does Addition-chain exponentiation matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Addition-chain exponentiation?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Addition-chain exponentiation.

Tags

  • Addition chains
  • Computer arithmetic algorithms
  • Exponentials

Keep exploring