Chapter 2: Q1E (page 83)
Question: Use the divide-and-conquer integer multiplication algorithm to multiply the two binary integers and .
Short Answer
Multiplication of is: 111000010011110
/*! 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}
Learning Materials
Features
Discover
Chapter 2: Q1E (page 83)
Question: Use the divide-and-conquer integer multiplication algorithm to multiply the two binary integers and .
Multiplication of is: 111000010011110
All the tools & learning materials you need for study success - in one app.
Get started for free
Thesquare of a matrix A is its product with itself, AA.
(a) Show that five multiplications are sufficient to compute the square of a 2 x 2 matrix.
(b) What is wrong with the following algorithm for computing the square of an n x n matrix?
鈥淯se a divide-and-conquer approach as in Strassen鈥檚 algorithm, except that instead of getting 7 subproblems of size , we now get 5 subproblems of size thanks to part (a). Using the same analysis as in Strassen鈥檚 algorithm, we can conclude that the algorithm runs in time O (nc) .鈥
(c) In fact, squaring matrices is no easier than matrix multiplication. In this part, you will show that if n x n matrices can be squared in time S(n) = O(nc), then any two n x n matrices can be multiplied in time O(nc) .
In Section 1.2.3, we studied Euclid鈥檚 algorithm for computing the greatest common divisor (gcd) of two positive integers: the largest integer which divides them both. Here we will look at an alternative algorithm based on divide-and-conquer.
(a) Show that the following rule is true.
(b) Give an efficient divide-and-conquer algorithm for greatest common divisor.
(c) How does the efficiency of your algorithm compare to Euclid鈥檚 algorithm if a and b are n-bit -bit integers? (In particular, since n might be large you cannot assume that basic arithmetic operations like addition take constant time.)
A binary tree is full if all of its vertices have either zero or two children. Let denote the number of full binary trees with n vertices. (a)By drawing out all full binary trees with 3, 5, or 7 vertices, determine the exact values of , , and . Why have we left out even numbers of vertices, like ?
(b) For general n, derive a recurrence relation for .
(c) Show by induction that is .
In our median-finding algorithm (Section 2.4), a basic primitive is the split operation, which takes as input an array S and a value V and then divides S into three sets: the elements less than V , the elements equal to V , and the elements greater than V . Show how to implement this split operation in place, that is, without allocating new memory.
You are given an array of elements, and you notice that some of the elements are duplicates; that is, they appear more than once in the array. Show how to remove all duplicates from the array in time .
What do you think about this solution?
We value your feedback to improve our textbook solutions.