Content deleted Content added
No edit summary |
Dokidaki-ylc (talk | contribs) m Minor fix of text format; change "efficiency analysis" to "time complexity analysis" |
||
Line 30:
The standard procedure for multiplication of two ''n''-digit numbers requires a number of elementary operations proportional to <math>n^2\,\!</math>, or <math>O(n^2)\,\!</math> in [[big-O notation]]. [[Andrey Kolmogorov]] conjectured that the traditional algorithm was ''[[asymptotically optimal]],'' meaning that any algorithm for that task would require <math>\Omega(n^2)\,\!</math> elementary operations.
In 1960, Kolmogorov organized a seminar on mathematical problems in [[cybernetics]] at the [[Moscow State University]], where he stated the <math>\Omega(n^2)\,\!</math> conjecture and other problems in the [[Computational complexity theory|complexity of computation]]. Within a week, Karatsuba, then a 23-year-old student, found an algorithm (later it was called "divide and conquer") that multiplies two ''n''-digit numbers in <math>O(n^{\log_2 3})</math> elementary steps, thus disproving the conjecture. Kolmogorov was very excited about the discovery; he communicated it at the next meeting of the seminar, which was then terminated. Kolmogorov gave some lectures on the Karatsuba result at conferences all over the world (see, for example, "Proceedings of the International Congress of Mathematicians 1962", pp.
==Algorithm==
Line 90 ⟶ 89:
===Asymmetric Karatsuba-like formulae===
Karatsuba's original formula and other generalizations are themselves symmetric. For example, the following formula computes
:<math>c(x)=c_4x^4+c_3x^3+c_2x^2+c_1x+c_0=a(x)b(x)=(a_2x^2+a_1x+a_0)(b_2x^2+b_1x+b_0)</math>
with 6 multiplications in <math>{\text{GF}}(2)[x]</math>, where <math>{\text{GF}}(2)</math> is the Galois field with two elements 0 and 1.
Line 111 ⟶ 109:
This formula is symmetrical, namely, it does not change if we exchange <math>a</math> and <math>b</math> in <math>p_i, \ \ p_{ij}</math> and <math>p_{ijk}</math>.
Based on the second [[Euclidean division|Generalized division algorithms]],<ref>Haining Fan, Ming Gu, Jiaguang Sun, Kwok-Yan Lam,"Obtaining More Karatsuba-Like Formulae over the Binary
Field", IET Information security Vol. 6 No. 1 pp. 14-19, 2012.</ref> Fan et al. found the following asymmetric formula:
Line 126 ⟶ 123:
}\right.
\end{align}</math>
where <math>m_{3}=(a_{
It is asymmetric because we can obtain the following new formula by exchanging <math>a</math> and <math>b</math> in
Line 144 ⟶ 139:
}\right.
\end{align}</math>
▲where <math>m_{3}=(a_{
▲<math>m_{3}=(a_{0}+a_{2})(b_{1}+b_{2}), \ \ m_{4}=(a_{1}+a_{2})(b_{0}+b_{1})</math> and <math>m_{5}=(a_{0}+a_{1})(b_{0}+b_{2})</math>.
==
Karatsuba's basic step works for any base ''B'' and any ''m'', but the recursive algorithm is most efficient when ''m'' is equal to ''n''/2, rounded up. In particular, if ''n'' is 2<sup>''k''</sup>, for some integer ''k'', and the recursion stops only when ''n'' is 1, then the number of single-digit multiplications is 3<sup>''k''</sup>, which is ''n''<sup>''c''</sup> where ''c'' = log<sub>2</sub>3.
|