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
-
Use the following information for Questions 1 and 2 : The Better Butter Corp. balance sheet as of December 3 1 , 2 0 x 0 is as follows: Assets $ 1 0 0 , 0 0 0 Common Stock $ 1 0 0 , 0 0 0 The company...
-
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...
-
A student's final exam grade depends on how close the student sits to the center of the classroom during lectures. If a student sits r feet from the center of the room, the grade is a Gaussian random...
-
Critics of malpractice suits claim that they have contributed significantly to the rise of medical costs and want legislation that would limit the size of awards and lawyers' fees, or otherwise...
-
On December 31, 2020, for GAAP purposes, Clubs Inc. reported a balance of \(\$ 70,000\) in Prepaid Maintenance Expense for services to be received over the following year. For tax purposes, however,...
-
The following data are monthly sales of jeans at a local department store. The buyer would like to forecast sales of jeans for the next month, July. (a) Forecast sales of jeans for March through June...
-
Using an EXCEL spreadsheet, calculate Residual Income for 2011, assuming Carmax's average cost of capital is 5%. Provide all of the work steps and highlight in yellow the cell containing the answer...
-
The set of mobile gaming apps in which the number of monthly users was greater than 12 million. Use the following table, which shows the number of monthly users, in millions, for the 10 most used...
-
2) For the scenarios below, identify an audit procedure that you would perform to address the audit risk within the scenario and which account/assertion the audit procedure is addressing. Scenario...
-
What was the firm's average tax bracket for each year? (Enter your answers as a percent rounded to 1 decimal places.) Total income before taxes = 1600 = 550/1600 = 0.34375
-
Directions: you must answer ONE the questions below by the deadline. Your post must be 8 sentences or more. Questions: What are the financial implications related to the key ideas that are discussed...
-
A company manufactures a single product. In the first year of operations, the company produced 3,200 units and sold 2,950 units. The variable costing net operating income was $146,100 and total fixed...
-
Mama Corporation is a distributor of sun umbrella used at resort hotel. The data are as follows: Selling Price Variable Expenses Fixed Expenses Unit sales Required: 25 per unit 15 per unit 8,500 per...
-
A company manufactures equipment and has identified the following ABC cost pools and associated information: Cost Pool Activity Measure Activity Rate Customer orders number of orders $ 3 8 / order...
-
An company that sells sunglasses is able to buy its sunglasses wholesale for $ 1 0 a pair and then resell them for $ 5 0 . The store\'s average fixed monthly costs ( rent , salaries, telephone, etc....
-
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?
-
3. An appraiser valued a subsidiary of Signal Co. at between $230 million and $260 million. Six months later, Burmah Oil offered to buy the subsidiary at $480 million, giving Signal only three days...
-
4. YOU BE THE JUDGE WRITING PROBLEM Asher Hyman and Stephen Stahl formed a corporation named Ampersand to produce plays. Both men were employed by the corporation. After producing one play, Stahl...
-
5. Angelica is planning to start a home security business in McGehee, Arkansas. She plans to start modestly but hopes to expand her business within 5 years to neighboring towns and, perhaps, within...
Study smarter with the SolutionInn App