/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Q1E Question: Use the divide-and-con... [FREE SOLUTION] | 91影视

91影视

Question: Use the divide-and-conquer integer multiplication algorithm to multiply the two binary integers 10011011and10111010 and .

Short Answer

Expert verified

Multiplication of 10011011and10111010is: 111000010011110

Step by step solution

01

Introduction

This keep dividing and conquering is different technique tackles an issue by:

1. This keep dividing and conquering is different technique tackles an issue by:

2. Solving these sub-problems in a recursive manner

3. Combining their responses in an appropriate manner.

The main work being composed of three parts: splitting issues into sub-problems, solving sub-problems outright at the very end of the recursion, and gluing together partial answers. The algorithm's basic recursive structure holds them all together and coordinates them.

02

Division of given binary numbers

Divide and conquer multiplication:

Apply and consider X=10011011Y=10111010

P1=multiply(X1,Y1)P2=multiply(Xr,Yr)P3=multiply(X1+Xr,Y1+Yr)X*Y=P1*(2n)+(P3-P2-P1)*(24)+P2

Here, given binary number divided into two ( N / 2 )

X1=1001,Y1=1011,Xr=1011,Yr=1010X1+Xr=1001+1011=10100Y1+Yr=1011+1010=10101X1*Y1=1100011callitisP1

03

Multiplication using Divide-and-Conquer

Find Xr * Yr recursively we get,

Xr * Yr = 1011 * 1010 = 1101110 calling it as P2

Find X1+XrxY1+Yrrecursively we are get,

X1+XrxY1+Yr=110100100

Counting of P3 - P2 - P1

P3 - P2 - P1 = 110100100 - 1101110 - 1100011

=11010011

Finally here we can get last answer:

P1*2n+P3-P2-P1*24+P2=1100011*100000000+11010011*00010000+1101110=110001100000000+110100110000+1101110=011100001001111010011011*10111010=111000010011110

This is the required answer.

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91影视!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

Section 2.2 describes a method for solving recurrence relations which is based on analyzing the recursion tree and deriving a formula for the work done at each level. Another (closely related) method is to expand out the recurrence a few times, until a pattern emerges. For instance, let鈥檚 start with the familiar T(n)=2T(n/2)+o(n). Think of o(n) as being role="math" localid="1658920245976" <cnfor some constant , so: T(n)<2T(n/2)+cn. By repeatedly applying this rule, we can bound T(n) in terms of T(n/2), then T(n/4), then T(n/8), and so on, at each step getting closer to the value of T(.) we do know, namely .

T(1)=0(1).

T(n)2T(n/2)+cn2[2Tn/4+cn/2]+cn=4T(n/4)+2cn4[2Tn/8+cn/4]+2cn=8T(n/8)+3cn8[2Tn/16+cn/8]+3cn=16T(n/16)+4cn

.

.

.

A pattern is emerging... the general term is

T(n)2kT(n/2k)+kcn

Plugging in k=log2n, we get T(n)nT(1)+cnlog2n=0(nlogn).

(a)Do the same thing for the recurrence T(n)=3T(n/2)+0(n). What is the general kth term in this case? And what value of should be plugged in to get the answer?(b) Now try the recurrence T(n)=T(n-1)+0(1), a case which is not covered by the master theorem. Can you solve this too?

Show that for any positive integers n and any base b , there must some power of b lying in the range [b,bn].

Consider the task of searching a sorted array A[1,,n] for a given element x: a task we usually perform by binary search in time O(logn) . Show that any algorithm that accesses the array only via comparisons (that is, by asking questions of the form 鈥渋s A[i]z 0?鈥), must take (logn) steps.

Practice with the fast Fourier transform.

(a) What is the FFT of (1,0,0,0)? What is the appropriate value of in this case? And of which sequence is (1,0,0,0)the FFT?

(b)Repeat for (1,0,1,-1).

Question: You are given an infinite array A[]in which the first n cells contain integers in sorted order and the rest of the cells are filled with . You are not given the value of n. Describe an algorithm that takes an integer x as input and finds a position in the array containing x, if such a position exists, in O(log n) time. (If you are disturbed by the fact that the array A has infinite length, assume instead that it is of length n, but that you don鈥檛 know this length, and that the implementation of the array data type in your programming language returns the error message whenever elements A[i]withi>n are accessed.)

See all solutions

Recommended explanations on Computer Science Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.