Course Hero Logo

Karatsuba Algorithm for Fast Multiplications Part 2.txt -...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 out of 1 page.

It is very easy to multiply numbers with two digits or less. If one number has ndigits and another number also has n digits, you need n × n multiplications.W = (a + c) × (b + d) – Z – V (one multiplication)Notice that you only need three multiplications in this algorithm. You do not seethat much of a difference because there are only four total digits in 77 × 54.However, if there are 16 or more total digits, reducing the number ofmultiplications has a greater effect.Note that the Karatsuba algorithm has one limitation: it only works with even-numbered total digits. However, this limitation can be easily countered by addingzeros ahead of a number with odd-numbered total digits. For example, the number 354(three digits, odd) can be changed to 0354 (four digits, even).Runtime AnalysisThe conventional multiplication algorithm's complexity is n2, and the Karatsubaalgorithm's complexity is n1.584. The Karatsuba algorithm has a lower complexitydue to the lower number of multiplications needed to calculate the output.
End of preview. Want to read the entire page?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
NoProfessor

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture