Multiplying Big Numbers Using FFT

AI Thread Summary
Multiplying large numbers using the Fast Fourier Transform (FFT) is a well-researched topic, with numerous papers available. The discussion centers on a simpler algorithm for multiplying two big numbers, which involves treating the numbers as polynomials and using FFT for efficient convolution. The algorithm consists of four main steps: representing the numbers as polynomials, converting them into padded vectors, applying FFT to compute their convolution, and finally recovering the product. The complexity analysis indicates that the algorithm operates in m log(m) time, where m is the degree of the polynomials, and suggests that this is efficient compared to the n log(n) complexity noted in standard texts like CLRS. The confusion arises from the frequent mention of polynomial interpolation using roots of unity in academic papers, which appears to be a specific description of the FFT process. The necessity of this terminology is questioned, as it may seem extraneous to the core algorithm.
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.
 
Thread 'Star maps using Blender'
Blender just recently dropped a new version, 4.5(with 5.0 on the horizon), and within it was a new feature for which I immediately thought of a use for. The new feature was a .csv importer for Geometry nodes. Geometry nodes are a method of modelling that uses a node tree to create 3D models which offers more flexibility than straight modeling does. The .csv importer node allows you to bring in a .csv file and use the data in it to control aspects of your model. So for example, if you...
I tried a web search "the loss of programming ", and found an article saying that all aspects of writing, developing, and testing software programs will one day all be handled through artificial intelligence. One must wonder then, who is responsible. WHO is responsible for any problems, bugs, deficiencies, or whatever malfunctions which the programs make their users endure? Things may work wrong however the "wrong" happens. AI needs to fix the problems for the users. Any way to...
Back
Top