Questions tagged [multiplication]

88 questions
14
votes
1 answer

Why doesn't Knuth's linear-time multiplication algorithm "count"?

The wikipedia page on multiplication algorithms mentions an interesting one by Donald Knuth. Basically, it involves combining fourier-transform multiplication with a precomputed table of logarithmically-sized multiplications. It runs in linear…
Craig Gidney
  • 5,992
  • 1
  • 26
  • 51
11
votes
3 answers

Proof that no O(n) multiplication algorithm exists

For the multiplication of two $n$ digit numbers, the best known algorithm has complexity $O(n \log n)$. Has it been proven that this is the best possible, or that an algorithm $O(n)$ is not possible?
Matthew Matic
  • 441
  • 4
  • 9
9
votes
1 answer

Algorithm for multiplying multivariate polynomials

Let $R$ be a commutative ring. Let $f(x_1, \dots, x_n), g(x_1, \dots, x_n)$ be two multidimensional polynomials in $R$ with maximal total degree $\delta$. How fast can we compute the product of $f$ and $g$, i.e. the resulting coefficients of each…
chtenb
  • 271
  • 2
  • 10
8
votes
2 answers

Why is the transform in Schönhage–Strassen's multiplication algorithm cheap?

The Schönhage–Strassen multiplication algorithm works by turning multiplications of size $N$ into many multiplications of size $lg(N)$ with a number-theoretic transform, and recursing. At least I think that's what it does because there's some other…
Craig Gidney
  • 5,992
  • 1
  • 26
  • 51
8
votes
2 answers

Understanding Intel's algorithm for reducing a polynomial modulo an irreducible polynomial

I'm reading this Intel white paper on carry-less multiplication. It describes multiplication of polynomials in $\text{GF}(2^n)$. On a high level, this is performed in two steps: (1) multiplication of polynomials over $\text{GF}(2)$, and (2) reducing…
Gideon
  • 487
  • 2
  • 9
8
votes
5 answers

In algorithms for matrix multiplication (eg Strassen), why do we say n is equal to the number of rows and not the number of elements in both matrices?

In Strassen's algorithm, we calculate the time complexity based on n being the number of rows of the square matrix. Why don't we take n to be the total number of entries in the matrices (so if we were multiplying two 2x2 matrices, we would have n =…
6
votes
2 answers

Where does the lg(lg(N)) factor come from in Schönhage–Strassen's run time?

According to page 53 of Modern Computer Arithmetic (pdf), all of the steps in the Schönhage–Strassen Algorithm cost $O(N \cdot \lg(N))$ except for the recursion step which ends up costing $O(N\cdot \lg(N) \cdot \lg(\lg(N)))$. I don't understand why…
Craig Gidney
  • 5,992
  • 1
  • 26
  • 51
5
votes
2 answers

Karatsuba multiplication on numbers with odd length

I am learning about Karatsuba-Ofman multiplication. I don't quite understand how to multiply two numbers with odd length. Let's take two 3-digit numbers $a = 234; b = 857$ with base $B = 10$ and length $n=3$. The first step is to split split $a$ and…
Bobface
  • 333
  • 3
  • 9
5
votes
1 answer

Is matrix "adjoint-squaring" faster than general matrix multiplication?

The best known algorithm(s) for matrix multiplication of $n$-dimensional matrices take $O(n^{2.37})$ time. However, that's for matrices with totally independent contents. When the two matrices are related to each other in some known way, it's…
Craig Gidney
  • 5,992
  • 1
  • 26
  • 51
5
votes
1 answer

In fast multiplier circuits, what is the difference between a Counter and a Compressor?

When working on fast parallel multiplier circuit designs, like Wallace tree multipliers or Dada tree multipliers I found many papers and books refer to different components used in the tree to reduce the partial products called things like (4:2)…
5
votes
1 answer

Fixed base exponentiation with precomputations

I'm trying to compute $g^m$ mod $n$ where $m,n$ are 1024-bit numbers. The method I want to use is fixed base exponentiation with precomputations, also known as fixed-base windowing.The paper I'm following is Brickell et. al. "Fast Exponentiation…
nullgraph
  • 194
  • 1
  • 7
5
votes
3 answers

Does the performance of matrix multiplication depend on the storage of the array?

Two matrices can be stored in either row major or column major order in contiguous memory. Does the time complexity of computing their multiplication vary depending on the storage scheme? That is, I want to know whether it will work faster if stored…
Kapes
  • 163
  • 1
  • 3
  • 7
5
votes
3 answers

Multiplying 2 positive integers using FFT and convolutions

I was trying to figure out how I can perform multiplication of 2 big integers using FFT and convolutions, I ran into the following article: http://numbers.computation.free.fr/Constants/Algorithms/fft.html I understand the main points behind the…
Yarin
  • 285
  • 1
  • 8
5
votes
4 answers

Is order of matrix multiplication affecting numerical accuracy of the result?

I have to multiply three matrices of floats: A (100x8000), B (8000x27) and C (27x1). Is there any difference in accuracy between A(BC) and (AB)C? If yes - how may I determine the more accurate multiplication order? Speed is not a factor…
4
votes
1 answer

Difficulty understanding the faster multiplication hardware

This is a picture of faster multiplication hardware taken from Computer Organization and Design (5th Edition). I'm having some difficulty understanding it. I was trying to simulate this for a test multiplication of : 1011 x 101. Firstly, P0 is…
Robur_131
  • 227
  • 3
  • 10
1
2 3 4 5 6