Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
moi2388
40 days ago
|
parent
|
context
|
favorite
| on:
Mathematicians still don't know the fastest way to...
For large numbers, operations like addition don’t matter? Only multiplication? And now we want to find the fewest amount of multiplications?
Okay. No problem.
(ad + bc) = d + d .. + d + c + c .. + c
There we go, zero multiplications.
entrope
39 days ago
[–]
The article is explicit that addition is O(n), with n digits, which is cheaper than multiplication is believed to be. Naive multiplication is O(n*n) -- considerably less than your algorithm.
moi2388
39 days ago
|
parent
[–]
My algorithm is O(n+n+..n) which is O(n), since there we also ignore addition fortunately :D
AlotOfReading
39 days ago
|
root
|
parent
[–]
It would only be O(n) if the number of additions was constant. Here it varies with the size of the multiplier, giving us O(n*m).
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
Okay. No problem.
(ad + bc) = d + d .. + d + c + c .. + c
There we go, zero multiplications.