University of Auckland · FACULTY OF COMPUTER SCIENCE

COMPSCI320 Chap.7 Fast Multiplication and the Fast Fourier Transform

- one subject, every graph, every model, every mark
6 Chapters4-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 7 of 13 · COMPSCI320

Fast Multiplication and the Fast Fourier Transform

Grade-school multiplication of n-digit numbers costs quadratic time, and this chapter shows how divide and conquer beats it.

Karatsuba replaces four half-size products with three, Strassen replaces eight block products with seven, and the fast Fourier transform evaluates a polynomial at roots of unity by splitting it into even and odd parts, giving n log n polynomial multiplication.

Every number in the worked example is shown, from the half-size products to the recombined answer, and the even and odd split is evaluated at all four fourth roots of unity.

The analysis questions compare the recurrences of the slow and fast schemes, which is where the exponents come from.

The chapter also connects the arithmetic to the course's recurring theme: a design is judged by the Theta class of its running time.

Karatsuba, Strassen and the fast Fourier transform all keep the work outside the recursive calls linear or quadratic and save by making fewer calls, so the Master theorem from Chapter 6 explains each improvement in one line.

In this chapter

What this chapter covers

  • 01

    Why the four-product split gains nothing

  • 02

    The Karatsuba identity

  • 03

    Strassen's seven block products

  • 04

    Polynomial multiplication in value form

  • 05

    Even and odd splitting at roots of unity

  • 06

    Convolution and its applications

Worked example · free

Multiply with one level of Karatsuba

Q [4 marks]. Compute 2468 × 1357 by splitting each number into two-digit halves and using three products. The marks are an AskSia practice weighting, not a university marking scheme.
One Karatsuba level for 2468 × 1357 split into two-digit halves.One Karatsuba level for 2468 × 1357 split into two-digit halves. Three products, 312, 6440 and 3876, replace four, and the middle coefficient 2252 comes from subtraction instead of two more multiplications.2468 × 135724×13 = 31292×70 = 644068×57 = 3876middle = 6440 − 312 − 3876 = 2252
One Karatsuba level for 2468 × 1357 split into two-digit halves. Three products, 312, 6440 and 3876, replace four, and the middle coefficient 2252 comes from subtraction instead of two more multiplications.
  • 1Split into a = 24, b = 68 and c = 13, d = 57.
  • 1Compute ac = 312, bd = 3,876 and (a + b)(c + d) = 92 × 70 = 6,440.
  • 1The middle coefficient is 6,440 − 312 − 3,876 = 2,252.
  • 1Recombine 312 × 10,000 + 2,252 × 100 + 3,876 = 3,349,076.
This four-mark allocation is an AskSia practice weighting and not an official university scheme. The product is 3,349,076, obtained with three two-digit multiplications instead of four.
Sia tip — Check the middle coefficient against ad + bc on small numbers; here 1,368 + 884 also gives 2,252.
Glossary

Key terms

Karatsuba Multiplication
A divide and conquer method that multiplies two numbers with three half-size products instead of four.
Root of Unity
A complex number whose n-th power equals one, used as an evaluation point by the fast Fourier transform.
Fast Fourier Transform
A divide and conquer algorithm that evaluates a polynomial at all n-th roots of unity in n log n time.
Convolution Theorem
The rule that the transform of a convolution equals the pointwise product of the transforms.
Strassen Multiplication
A method that multiplies two matrices using seven products of half-size blocks instead of eight.
FAQ

Fast Multiplication and the Fast Fourier Transform FAQ

Why does saving one multiplication change the exponent?

The number of recursive calls sets the number of leaves in the recursion tree. Four half-size calls give four to the power log n leaves, which is n squared. Three calls give three to the power log n, which is n to about 1.585. The extra additions cost only linear time per level and cannot outweigh the smaller leaf count.

How does the fast Fourier transform halve the work?

A polynomial splits into its even and odd powers, A(x) = E(x squared) + x times O(x squared). Squaring the n-th roots of unity gives only the n/2-th roots, so E and O need evaluating at half as many points. That gives the recurrence T(n) = 2T(n/2) + O(n) and a total of n log n.

Where do convolutions appear in the course?

Multiplying polynomials is a convolution of their coefficient lists, and the sixth tutorial applies the same idea to forces between charged particles. Each force is a sum over all other particles, which looks quadratic, but written as a convolution it can be computed through the convolution theorem with the fast Fourier transform in n log n time.

Why does Strassen's method need care with signs?

Strassen forms seven products from sums and differences of the matrix blocks and then combines them with further additions and subtractions. Many of the intermediate values are negative even when every input entry is positive. The practice slides warn about negative entries because most hand-calculation errors come from a sign in the combining step.

Study strategy

Exam move

Carry out one full Karatsuba level on two new four-digit numbers and verify the product directly. Write the Strassen and Karatsuba recurrences side by side with their solutions. Then evaluate a cubic at the four fourth roots of unity using the even and odd split and check one value by direct substitution.

Also compare the three fast methods in a single table of recurrences and solutions, because exam questions often ask why one saved product changes the exponent.

Finish each Karatsuba practice by multiplying the original numbers the slow way to confirm the final product, and finish each evaluation question by substituting one root directly into the polynomial; both checks take a minute and catch the sign and carry slips that cost most marks in this topic.

Working through Fast Multiplication and the Fast Fourier Transform in COMPSCI320? Sia is AskSia’s AI Computer Science tutor — ask any COMPSCI320 Fast Multiplication and the Fast Fourier Transform question and get a clear, step-by-step explanation grounded in how COMPSCI320 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 34 of your University of Auckland subjects - and 1,000+ Bibles across every Australian university.
Sia - your COMPSCI320 tutor, unlimited, worked the way the exam marks it
The full 4-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works