DOC PREVIEW
UCF COT 4810 - Fast Multiplication

This preview shows page 1-2-3-24-25-26 out of 26 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 26 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Fast MultiplicationObjectivesDivide et impera (Divide and Conquer)About the AlgorithmHow It WorksHow It Works (cont.)Slide 7Slide 8The “Old” WayNew WaySlide 11Slide 12Slide 13Slide 14Slide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23ObservationsSourcesQuestionsFast MultiplicationThe Divide and Conquer MethodOmar HemmaliObjectivesDefine Divide and ConquerExplain the Karatsuba Multiplication Method (Fast Multiplication)Work an example using the Karatsuba MethodDivide et impera(Divide and Conquer)A Divide and Conquer algorithm works by recursively breaking down a problem into two or more sub-problems of the same (or related) type, until these become simple enough to be solved directly.The solutions to the sub-problems are then combined to give a solution to the original problem. [taken from wikipedia]About the AlgorithmDiscovered by Anatolii Karatsuba in 1960.Published in a joint paper with Yu. Ofman in 1962.O ( )Disproved Andrey Kolmogorov's 1956 conjecture that the fastest multiplication algorithm was O( )First Divide and Conquer AlgorithmHow It WorksAssume two numbers A, B in base 10A = B = m = half the number of digits in A,BHow It Works (cont.)Multiplying the four subproducts separately gives O( )Example: 25 * 16We can do better12 3 4How It Works (cont.)Let LetLetWhat? How?How It Works (cont.)Let LetLetNow only 3 multiplicationsSo123The “Old” WayMultiplyingNew Way1962 * 1960 = (19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = X0 Y0Z0New Way1962 * 1960 =X0 Y019 * 19 = (1 * 1) * 100 + (10 * 10 – X1 – Z1 ) * 10 + (9 * 9) =1X1 Y1 Z11 8181(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = Z0New Way1962 * 1960 =X0 Y019 * 19 = (1 * 1) * 100 + (10 * 10 – X1 – Z1 ) * 10 + (9 * 9) =1X1 Y1 Z11 818110 * 10 =(1 * 1) * 100 + (1 * 1 – X2 – Z2 ) * 10 + (0 * 0) =11001X2 Y2Z20100(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = Z0(1 * 1) * 100 + (10 * 10 – X1 – Z1 ) * 10 + (9 * 9) =New Way1962 * 1960 =X0 Y019 * 19 = 1X1 Y1 Z11 818110 * 10 =(1 * 1) * 100 + (1 * 1 – X2 – Z2 ) * 10 + (0 * 0) =11001X2 Y2Z20100100(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = Z018New Way1962 * 1960 =X0 Y019 * 19 = (1 * 1) * 100 + (10 * 10 – X1 – Z1 ) * 10 + (9 * 9) =1X1 Y1 Z11 8181100 18361(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = Z0(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = New Way1962 * 1960 =19 * 19 = (1 * 1) * 100 + (10 * 10 – X1 – Z1 ) * 10 + (9 * 9) =1X1 Y1 Z11 8181100 18361361X0361Y0Z0(6 * 6) * 100 + (8 * 6 – X1 – Z1 ) * 10 + (2 * 0) =0(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = New Way1962 * 1960 =361X0361Y0Z062 * 60 =X1 Y1 Z13636 048 12 3720(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = New Way1962 * 1960 =361X0361Y0Z062 * 60 = (6 * 6) * 100 + (8 * 6 – X1 – Z1 ) * 10 + (0 * 2) =X1 Y1 Z136120372037203720)(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = New Way1962 * 1960 =361X0361Y0Z03720372091 * 79 = (9 * 7) * 100 + (10 * 16 – X1 – Z1 ) * 10 + (1 * 9) =X1 Y1 Z16363993720)(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = New Way1962 * 1960 =361X0361Y0Z0372091 * 79 = (9 * 7) * 100 + (10 * 16 – X1 – Z1 ) * 10 + (1 * 9) =X1 Y1 Z163639910 * 16 =(1 * 1) * 100 + (1 * 7 – X2 – Z2 ) * 10 + (0 * 6) =X2 Y2Z21 1 00761603720)(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = New Way1962 * 1960 =361X0361Y0Z0372091 * 79 = (9 * 7) * 100 + (10 * 16 – X1 – Z1 ) * 10 + (1 * 9) =X1 Y1 Z163639910 * 16 =(1 * 1) * 100 + (1 * 7 – X2 – Z2 ) * 10 + (0 * 6) =X2 Y2Z21 1 00761601603720)(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = New Way1962 * 1960 =361X0361Y0Z0372091 * 79 = (9 * 7) * 100 + (10 * 16 – X1 – Z1 ) * 10 + (1 * 9) =X1 Y1 Z163639916088 71893720)(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = New Way1962 * 1960 =361X0361Y0Z0372091 * 79 = (9 * 7) * 100 + (10 * 16 – X1 – Z1 ) * 10 + (1 * 9) =X1 Y1 Z163639916088 71897189 3720)(19 * 19) * 10000 + (91 * 79 – X0 – Z0) * 100 + (62 * 60) = New Way1962 * 1960 =361X0361Z037207189Y038455203720)3108Observations13 Multiplications in the exampleTime Complexity = O( )Sourceshttp://en.wikipedia.org/wiki/Karatsuba_algorithmhttp://en.wikipedia.org/wiki/Divide_and_conquer_algorithmQuestions1. Who discovered the Karatsuba Multiplication Method?2. What is the significance of the numbers in the


View Full Document

UCF COT 4810 - Fast Multiplication

Documents in this Course
Spoofing

Spoofing

25 pages

CAPTCHA

CAPTCHA

18 pages

Load more
Download Fast Multiplication
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Fast Multiplication and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Fast Multiplication 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?