Multiplication
How do we multiply numbers?
Assume that we the input representation of a number is in decimals. How can we compute the product of two numbers?
1) Grid Method: Split both the factors into units, tens, hundreds etc, multiply all of these parts separately and then add them together.
2) Long Multiplication: Multiply the first number with each digit of the second number and take the sum of the resulting numbers with appropriate shifts. Multiplying each digit is carried by looping for all the digits of the first number, multiplying and using “carries” for previous computations.
3) Karatsuba algorithm:
We can save one of 4 multiplications needed by using the following formulae:
4) Toom-Cook multiplication:
Toom-: Input : Two non-negative integers
and
of length at most
- Splitting:
Writeand integers
of length at most
- Evaluation
Computefor
distinct points
- Pointwise Multiplication
Computerecursively!
- Interpolation
Interpolateto find the polynomial
This can be done by inverting the vandermonde determinant.
- Recomposition
5) FFT Methods:
Interpolation, Evaluation steps are costly. Similar to the Tim-Cook but we evaluate the polynomials at , where
is the
-th principal root of unity. This choice reduces the cost of the interpolation, evaluation. This computation can be happen over any ring with
-th principal root of unity.
Over complex numbers, over finite fields or over for
of a special forms like Fermat’s number
or Mersenne Number
6) Schonhage- Strassen algorithm: FFT over the ring , and
Allows for negativecyclic convolution (Weighted FFT): Compute
7) Furer’s algorithm: He works in the ring for a faster FFT.
Question: What is the true “complexity” of the problem? Can we find algorithms?