Multiplying Big Numbers Using FFT

Click For Summary
SUMMARY

The discussion focuses on the algorithm for multiplying big numbers using the Fast Fourier Transform (FFT). It outlines a straightforward approach that involves representing two integers as polynomials, converting them into vectors, and applying the FFT for efficient convolution. The complexity of this method is analyzed, revealing a time complexity of m log(m) or log(D) log(log(D)), where D is the maximum of the two integers. The conversation also critiques the unnecessary complexity introduced by discussions of polynomial interpolation using roots of unity, which the author finds extraneous.

PREREQUISITES
  • Understanding of Fast Fourier Transform (FFT)
  • Familiarity with polynomial representation in mathematics
  • Knowledge of convolution operations
  • Basic complexity analysis techniques
NEXT STEPS
  • Study the implementation of FFT in Python using libraries like NumPy
  • Explore polynomial multiplication techniques in CLRS (Introduction to Algorithms, Chapter 32)
  • Research the concept of roots of unity and its applications in FFT
  • Investigate advanced algorithms for big number multiplication beyond FFT
USEFUL FOR

Mathematicians, computer scientists, and software engineers interested in efficient algorithms for big number arithmetic and those looking to deepen their understanding of FFT applications.

n+1
Messages
13
Reaction score
0
Multiplying big numbers is a very common application of the FFT, and as such, there are many papers on the subject available online.

However, these papers all use sophisticated algorithms where a simple one seems to work. My question is, what's wrong with the simple algorithm:

Multiplication of Two Big Numbers Algorithm:
Input: Two integers, a and b, stored in base B.
Step 1: Write a and b as polynomials in Z[B ], a(B) and b(B).Let m be the the larger of the two degrees.
Step 2: Rewrite a(B) and b(B) as 2m-dimensional vectors by padding with 0s. Denote these vectors by v_a and v_b.
Step 3: Use the FFT and Convolution Theorem to compute the Convolution of v_a and v_b quickly.
Step 4: Recover ab by reversing step 2 and 1.

Complexity Analysis
Let D = Max(a,b). Notice log(D) ~ m.
Step 1: 1. You're just reinterpreting what a list represents.
Step 2: m. You're at most adding 2m zeroes.
Step 3: m log(m).
Step 4: m. You're doing similar operations as in steps 1 and 2.
Conclusion: m log(m) or log(d) log(log(d)).
 
Technology news on Phys.org
CLRS discusses polynomial multiplication (Chapter 32). They verify that polynomial multiplication using the FFT has complexity n log(n).

I guess my confusion stemmed from talk about "the interpolation of polynomials using roots of unity." Every paper I read talks about this. As far as I can tell, this is just a problem-specific description of the FFT. I don't know why the authors are so eager about adding this extraneous information -- but again, they know way more about the subject than I do. Oh well.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
4K
Replies
9
Views
3K
Replies
25
Views
4K
Replies
41
Views
49K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
33
Views
4K
  • · Replies 4 ·
Replies
4
Views
4K
Replies
3
Views
2K
  • · Replies 65 ·
3
Replies
65
Views
8K
  • · Replies 1 ·
Replies
1
Views
2K