A friend pointed out to me that the statement that the final divide-and-conquer Fibonacci algorithm from the previous post could run in time was a bit misleading. The objection was that I had assumed that the matrix multiplication would not depend on , but that this in fact not the case at all. Namely, if the numbers being added get large, neither the addition nor the multiplication operations of the matrix multiplication cannot be assumed to be constant.

In fact, the earlier analysis of Fibonacci indicated that the value of could be bounded above and below by , so each of the roughly matrix multiplication amounts to 10 multiplication operations and 4 addition operations, which we can bound above as the addition or multiplication on order-of- -bit numbers. By contrast, the iterative algorithm, which I had claimed was linear-time , requires only one addition operation at each step, resulting in an order of addition operations on order-of- -bit numbers.

If we consider the complexity of the arithmetic operations, the addition of two bit numbers can be completed in time, so the revised complexity of the iterative algorithm becomes .

For the divide-and-conquer algorithm, we have to consider the complexity of both multiplication operations and addition operations. Suppose we opt for the Schönhage–Strassen algorithm, which has complexity . In this case, the multiplication operations dominate the addition ones, and the revised overall complexity of the algorithm becomes , which is still faster than the iterative algorithm asymptotically. However, I wonder if there is an intermediate region before that asymptotic behavior takes effect in which the iterative approach completes faster.

### Like this:

Like Loading...

*Related*