1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
irina1246 [14]
3 years ago
11

Show how the recursive multiplication algorithm computes XY, where X = 1234 and Y = 4321. Include all recursive computations.

Computers and Technology
1 answer:
lozanna [386]3 years ago
3 0

Answer:

The result of recursive multiplication algorithm is 5332114 . Here karatsuba algorithm with recursive approach is used to compute XY where X = 1234 and Y = 4321.

Explanation:

The steps for karatsuba algorithm with recursive approach:

base case:

if(X<10) or (Y<10) then multiply X with Y

For example if X is 1 and Y is 2. Then XY = 1*2 = 2

Recursive case:

Now when the above if condition is not true then follow these steps to compute XY

Compute the size of numbers.

Notice that there are 4 digits in X i.e. 1 2 3 4 and a 4 digits in Y i.e. 4 3 2 1

So n = 4

Now divide the numbers in 2 parts as:

n/2 = 4/2 = 2

Since these are decimal numbers so we can write it as:

10^n/2

Now split the digits

X = 1234 is divided into 2 parts as:

12 and 34

Let a represent the first part and b represent the second part of X. So,

a = 12

b = 34

Y = 4321 is divided into 2 parts as:

43 and 21

Let c represent the first part and d represent the second part of Y. So,

c = 43

d = 21

Let multiplication reprsents the karatsuba recursive multiplication algorithm

Now recursively compute products of inputs of size n/2  

   multiplication (a, c)

   multiplication (b, d)

   multiplication (add(a, b), add(c, d))  

  Combine the above 3 products to compute XY  

As we know these decimal numbers have base 10 and X and Y are divided into two parts So X can be written as:

X = 10^{\frac{n}{2} }  a+b

Y can be written as:

Y = 10^{\frac{n}{2} }  c+d

Now compute XY as:

XY = (10^{\frac{n}{2} }  a+b) ( 10^{\frac{n}{2} }  c+d)

XY = 10^{\frac{2n}{2} }  ac + 10^{\frac{n}{2} }  ad +  10^{\frac{n}{2} }  bc + bd

     =  10^{n}  ac + 10^{\frac{n}{2} } (ad + bc) + bd

Now put the values of n = 4, a = 12, b = 34 , c = 43 and d = 21

      = 10⁴ (12*43) + 10² (12*21 + 34*43) + (34*21)

      = 10⁴ (516) + 10² (252 + 1462) + 714

      = 10000*516 + 100*1714 + 714

      = 5160000 + 171400 + 714

XY  = 5332114

Hence the karatsuba multiplication algorithm with recursive appraoch computes XY = 5332114

You might be interested in
I’m trying to make the button change random colors every time you hover over it, yet I can’t seem to understand the procedure...
rewona [7]

Answer:9998

There are 28 chocolate-covered peanuts in 1 ounce (oz). Jay bought a 62 oz. jar of chocolate-covered peanuts.

Problem:

audio

How many chocolate-covered peanuts were there in the jar that Jay bought?

Enter your answer in the box.

Explanation:

3 0
3 years ago
Shut down and unplug the computer. Remove the CPU case lid. Locate the various fans, and then use compressed air to blow dirt ou
svlad2 [7]

Answer:

so kind of you! I'm sure it will help someone

7 0
4 years ago
Read 2 more answers
Why is it important to prepare the farm resources before you start working? explain​
motikmotik
The planning process helps to: Identify the goals of the farm business (what you want to accomplish); Identify the farm's inventory and resources (what you have to work with); Assess the farm business and the environment in which it operates (where you are and where you may want to go);

6 0
3 years ago
You don't have to answer them all, just give me 2 or 3. Thanks
frozen [14]

Answer:

5. iOS and Android are some popular OS’.

Explanation:

4 0
3 years ago
A computer connected to the Internet that asks for data is a(n) ________. Select one: A. server B. client C. aggregator D. surro
madreJ [45]

Answer:

client

Explanation:

The client makes a request for a service, and a server performs that service.

7 0
4 years ago
Other questions:
  • Waterpower was first harvested by ancient societies using
    5·1 answer
  • Data mining is defined as: a)Separating data and programs such that each can be changed without changing the other b)Allowing ma
    5·1 answer
  • A contractor is preparing a bid to install swimming pools at a new housing addition. The estimated time to build the first pool
    12·1 answer
  • TOPIC-PYTHON
    8·2 answers
  • There is an enormous amount of information on the Internet that is automatically separated into good content and not-so-good con
    15·1 answer
  • What is the grooming process as it relates to online predators?
    12·2 answers
  • Write a program that prompts the user to enter the center and a point on the circle. The program should then output the circle’s
    9·1 answer
  • Pressing the _____ key when entering title text in a placeholder creates a new paragraph. BACKSPACE SHIFT DELETE ENTER
    5·1 answer
  • Program: ASCII art (Python 3)1) Output this tree. 2) Below the tree (with two blank lines), output this cat. (3 pts) /\ /\ o o =
    8·1 answer
  • Who tryna trade in gta my psn is xMadOrNawx-_-
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!