How is it measured? A lookup table takes 1 step to find the answer of a multiplication.
because you're looking up a result not solving for it
Mathematicians still don't know the fastest way to multiply numbers
41–50 of 152 posts
Re: Mathematicians still don't know the fastest way to multiply numbers
#42Does the article just end after describing the problem for me only? I am left wanting for more.
Re: Mathematicians still don't know the fastest way to multiply numbers
#43I had a lot of fun hacking on this idea together with the maintainer of the NUMERIC data type, and after two months the patch finally was ready and got committed:
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit...
Re: Mathematicians still don't know the fastest way to multiply numbers
#44Back in 2024, I was trying to optimize PostgreSQL's NUMERIC data type, which is base-10000, using Karatsuba. The problem of finding the optimal threshold of when to switch to Karatsuba turned out to be really hard, since it depends on the size of both factors combined. After some hundreds of hours, I gave up, and started thinking about if there could be a simpler solution. I came to think about another idea I'd had b…
Re: Mathematicians still don't know the fastest way to multiply numbers
#45Earlier quoted context omitted.
1234567890 x 111111 ------------ 1234567890 12345678900 123456789000 1234567890000 12345678900000 + 123456789000000 ----------------- 137,174,072,825,790 ...looks like O(n^2).
Once the longer number starts repeating digits, then it's not n^2 anymore. Multiplies get replaced with lookups. And we're only counting the multiplies. That's all they counted in the article. Not the adds, not the shifts.
Memoizing number-by-digit multiplication doesn't make multiplication O(1) because one must still do an N-digit addition (which is O(N)) for each digit.
Re: Mathematicians still don't know the fastest way to multiply numbers
#46Re: Mathematicians still don't know the fastest way to multiply numbers
#47I don't think the article did a great job with their two digit illustration. They simply state: (ad + bc) = ((a + b) × (c + d)) – ac – bd. First note this equation is more clearly be written as: ad + bc = (a + b)(c + d) – ac – bd. To see why this is so first expand (a + b)(c + d). (a + b)(c + d) = ac + ad + bc + bd now (a + b)(c + d) − ac − bd = ac + ad + bc + bd − ac − bd Hence ad + bc = (a + b)(c + d) – ac – bd.
Erm, I'm not sure you clarified anything other than removing one pair of spurious round brackets that who knows why they're there in the source material. There are other weird formatting things in this article, which I blame on AI. I don't think the whole article was written by AI, but the copy-editing and formatting looks like an AI messed up things, such as those pointless round brackets or the inconsistency of mul…
Re: Mathematicians still don't know the fastest way to multiply numbers
#48Re: Mathematicians still don't know the fastest way to multiply numbers
#49Re: Mathematicians still don't know the fastest way to multiply numbers
#50How is it measured? A lookup table takes 1 step to find the answer of a multiplication.
Factorize big numbers, sort an array, beat stockfish at chess, create a SOTA microkernel OS from English description. All O(1) with lookup table!
It's not how complexity works.