4. (20 points total - Matlab coding) In this problem you will design and analyze a...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4. (20 points total - Matlab coding) In this problem you will design and analyze a divide and conquer algorithm that uses similar ideas to the fast Fourier transform (look up the fast Fourier transform algorithm in the textbook, and in particular "matrix block multiplication" in Section 2.5, if you need more ideas to get started). Consider the family of matrices recursively defined as follows: matrix Mo= 1, namely, the 1-by-1 matrix consisting of the number 1; and for each positive integer k the matrix M is a 2*-by-2* matrix defined by combining 4 copies of the smaller matrix Mk-1 as Mk Mk-1 [3-flip(x-1)] where the function "flip" flips a matrix vertically. Your goal is to construct an O(nlogn) algorithm so that given a column vector v of length n = 2*, you return the product Mxv. (a) (15 points) Fill in the provided stencil weirdmultiply.m. You might find the Matlab function flip useful: it flips the order of elements of a vector. (b) (5 points) As in the previous problem, add a few lines of comments explaining as clearly as possible why your code is correct; and explain its runtime. (As a warning and hint, your algorithm cannot construct Mx, since this would take time n, which is more than you are allowed. Instead, taking inspiration from the fast Fourier transform algorithm, try to design a divide-and-conquer algorithm for multiplying by these matrices Mk that, on input of size n = 2k, makes 2 recursive calls of size = 2*-1, and then does O(n) additional work to manipulate the results into the correct answer. Note that the obvious recursive algorithm would make 4 recursive calls of size to deal with each of the 4 submatrices in the definition of Mk, but 4 is too slow for us and we can only afford 2 recursive calls if we want to run in O(nlogn) time.) 4. (20 points total - Matlab coding) In this problem you will design and analyze a divide and conquer algorithm that uses similar ideas to the fast Fourier transform (look up the fast Fourier transform algorithm in the textbook, and in particular "matrix block multiplication" in Section 2.5, if you need more ideas to get started). Consider the family of matrices recursively defined as follows: matrix Mo= 1, namely, the 1-by-1 matrix consisting of the number 1; and for each positive integer k the matrix M is a 2*-by-2* matrix defined by combining 4 copies of the smaller matrix Mk-1 as Mk Mk-1 [3-flip(x-1)] where the function "flip" flips a matrix vertically. Your goal is to construct an O(nlogn) algorithm so that given a column vector v of length n = 2*, you return the product Mxv. (a) (15 points) Fill in the provided stencil weirdmultiply.m. You might find the Matlab function flip useful: it flips the order of elements of a vector. (b) (5 points) As in the previous problem, add a few lines of comments explaining as clearly as possible why your code is correct; and explain its runtime. (As a warning and hint, your algorithm cannot construct Mx, since this would take time n, which is more than you are allowed. Instead, taking inspiration from the fast Fourier transform algorithm, try to design a divide-and-conquer algorithm for multiplying by these matrices Mk that, on input of size n = 2k, makes 2 recursive calls of size = 2*-1, and then does O(n) additional work to manipulate the results into the correct answer. Note that the obvious recursive algorithm would make 4 recursive calls of size to deal with each of the 4 submatrices in the definition of Mk, but 4 is too slow for us and we can only afford 2 recursive calls if we want to run in O(nlogn) time.)
Expert Answer:
Related Book For
Introduction to Corporate Finance
ISBN: 978-0324657937
2nd edition
Authors: Scott B. Smart, William L Megginson
Posted Date:
Students also viewed these mathematics questions
-
Briefly describe ASCII and Unicode and draw attention to any relationship between them. [3 marks] (b) Briefly explain what a Reader is in the context of reading characters from data. [3 marks] A...
-
s sf Define the terms opaque type and concrete type. [5 marks] The following is a shortened version of one of the definition modules described in the Modula-2 user manual: Provide a suitable...
-
This section contains 6 questions. Questions 83 to 88 have four statements (A, B C and D) given in Column I and four statements (p, q, r and s) in Column II. Any given statement in Column I can have...
-
X and Y have joint PDF Find the PDF fy(y), the conditional PDF fX|Y(x|y), and the conditional expected value E[X|Y = y]. 0 otherwise.
-
The Editions Sorbonne is wholly owned by the university. It performs the bulk of its work for other university departments, which pay as though the Editions Sorbonne were an outside business...
-
Vince Smith opened a law office on March 2, 2010. During the first month of operations, the business completed the following transactions: Requirements 1. Open the following T-accounts: Cash,...
-
Use the information in RES-7. Calculate Uncle Butchs Hunting Supply Shops ending inventory' using the retail inventory method under the lower of average cost or market assumption. Round the...
-
In this assignment, you are to create a database design for a software system that will be used to manage a marina. A marina is a place where boat owners can keep their boats "parked" in berths. Each...
-
You are called by the daughter of an elderly woman who lives alone. The daughter lives in another city and is concerned because her mother does not drive and has seemed unhappy and listless on the...
-
Suppose you have a sample that has a low pH (acidic). What would be the [H3O+]? A. 0.0M B. <1.0x107 M OC.1.0x 10-14 M OD.>1.0x107 M E. 1.0x107 M Reset Selection
-
Compare and contrast the responsibilities of the auditor general and public protector in South Africa.
-
Briefly discuss the role of the South African Reserve Bank (SARB) in the countrys economy.
-
Discuss the role of the minister of finance as a key role player in public financial management in South Africa.
-
Discuss the National Prosecuting Authority with specific reference to its role in combating corruption in South Africa.
-
Briefly discuss the processes involved in performance budgeting, as well as its advantages and disadvantages.
-
The volume of chlorine at 20 C and 1 atm of pressure is 150 L. What volume will it occupy at 60 C and 2770 mmHg of pressure?
-
Explain five different cases of income exempt from tax with clear examples.
-
A German company manufactures a specialized piece of manufacturing equipment and leases it to a U.K. enterprise. The lease calls for five end-of-year payments of 1 million. The German firm spent 3.5...
-
An investor who notices that interest rates are much lower in Japan than in the United States borrows in Japan and invests the proceeds in the United States. This is called uncovered interest...
-
Who wins and who loses in corporate takeovers? Why does acquiring firm shareholders generally lose in stock- swap mergers but either benefit or at least break even in acquisitions paid for with cash?
-
(a) Complete a steady-state simulation of the vinyl-chloride process in Figure 2.6. First, create a simulation flowsheet. Assume that: Cooling water is heated from 30 to \(50^{\circ} \mathrm{C}\)...
-
Complete a simulation of the entire process for the hydrodealkylation of toluene in Figure 6.14. Initially, let the purge/recycle ratio be 0.25 ; then, vary this ratio and determine its effect on the...
-
For the monochlorobenzene separation process in Figure 7.14, the results of an ASPEN PLUS simulation are provided in the multimedia modules under ASPEN \( ightarrow\) Principles of Flowsheet...
Study smarter with the SolutionInn App