Here two equivalent versions of the Karatsuba method ‘Divide and Conquer’ (‘Binary Splitting’) are presented. The first version is based on the formula.
the second one — on the formula
I. Since 4ab = (a + b)2 – (a – b)2, the multiplication of two numbers a and b is equivalent in the complexity of realization to the squaring. Assume that X is a n -digit integer, that is
where εj = 0 or 1, j = 0, 1, ..., n-1. Assume for simplicity that n = 2m, m ≥ 1; 2k = n. Representing X in the form
The integers X1 and X2 are k -digit ones. The integer X1 + X2 can have k+1 digits. In that case we represent it in the form 2X3 + X4, where X3 is a k -digit integer, X4 is a one-digit integer. Then
We denote by φ(n) the number of operations sufficient for the squaring of a n -digit integer by means of the formula (1). It follows from (1) that φ(n) satisfies the inequality
where c > 0 is an absolute constant. Indeed, taking into account (2), the right-hand side of (1) contains the sum of three squares of k -digit integers, k = n2–1, to calculate which we need 3φ(k) = 3φ(n2–1) operations. The number of operations, required by the remaining calculations in the right-hand side of (1), namely, the multiplication by 4, 2k, 2n, five additions and one subtraction of no more than 2n -digit integers, is of order at most  :n. This implies (3). Applying (3) successively to φ(n2–1), φ(n2–2) , ... , φ(n2–m+1) and taking into account that φ(n2–m) = φ(1) =1, we obtain
Hence, the total number φ(n) of operations sufficient for the squaring of a n -digit integer by means of the formula (1), satisfies the bound
If n is not a power of two, then determining an integer m by the inequalities 2m–1 < n ≤ 2m, we represent X as a 2m -digit integer, that is we set the last 2m–n digits to be equal to zero: εn = ... = ε2m–1 = 0. All the rest of the arguments work as they are and the resulting upper bound for φ(n) is the same, by order of n.
II. The second version is the direct multiplication of two n -digit integers. Assume, as before, that n = 2m, 2k = n; A and B are two n -digit integers. Representing A and B in the form
where A1, A2, B1, B2 are k -digit integers, we find:
Thus, in this case the formula (1) is replaced by the formula (5). If we denote by the symbol φ(n) the number of operations sufficient for the multiplication of two n-digit integers by means of the formula (5), then for φ(n) the inequality (3) holds, and therefore, the inequality (4) is true. Note that, the foregoing first way of multiplication can be treated as an algorithm of computation of the function y = x2 at the point x = x1 with the accuracy up to n digits. If one splits X into more than two summands, then it is possible to obtain asymptotically better bounds for the complexity of calculating the product (respectively, squaring). The method ‘Divide and Conquer’ (its other names are ‘The Dichotomy Principle’, ‘Binary Splitting’, etc.) is the fundamental and most general fast method. Hundreds of different algorithms are constructed on its basis.
For the history of creating the method, see: A. A. Karatsuba “The complexity of computations” Proc. Steklov Inst. Math., Vol. 211, pp. 169-183 (1995).
On the method ‘Divide and Conquer’ and how it is used one can read at the numerous web-pages, for example
Fast Algorithms and the FEE Method