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...
-
The probability model for random variable A is The conditional probability model for random variable B given A is: (a) What is the probability model for random variables A and B? Write the joint PMF...
-
The most recent financial statements for Camryn, Inc., are shown here (assuming no income taxes): Assets and costs are proportional to sales. Debt and equity are not. No dividends are paid. Next...
-
Some of the prior interviews suggest that the company is so cheap that they wont pay people what they are worth. Have you had similar experiences?
-
Woolford Inc. declared a cash dividend of $1.00 per share on its 2 million outstanding shares. The dividend was declared on August 1, payable on September 9 to all stockholders of record on August...
-
Complete a detailed Income Statement using the information from the Trial Balance. Make sure to list out all accounts you use to complete the Income Statement. TRIAL BALANCE AS OF DECEMBER 31, 20XX...
-
Janice Morgan, age 24, is single and has no dependents. She is a freelance writer. In January 2021, Janice opened her own office located at 2751 Waldham Road, Pleasant Hill, NM 88135. She called her...
-
Search and identify the five words related to documents for supply requirements: 1. A document that records the amount that has been paid out or as a debt. 2. A piece of document that is given in...
-
Consider a failing bank. How much is a deposit of \($290\),000 worth to the depositor. if the FDIC uses the payoff method? The purchase-and-assumption method? Which method is more costly to taxpayers?
-
The Financial Crisis Inquiry Commission was set up in the aftermath of the Great Recession as an independent group tasked with investigating the causes of the financial crisis of 20072009. Go to...
-
Suppose you are manager of a bank whose \($200\) million of assets have an average duration of five years and whose \($160\) million liabilities have an average duration of seven years. Conduct a...
-
Everyone loves mickey mouse and Donald Duck. Walt Disneys two largest segments are media networks and Parks and recreation. media networks consists of aBC, eSPn, Disney films, newly acquired...
-
All happy families are the same, to paraphrase Leo Tolstoy. But even unhappy ones are not bad for business. A family index produced by Credit Suisse shows that companies in which the founding family...
-
Brifly answer the following after reading; Jakadas (2014) article, Building Global Strategic Alliances and Coalitions for Foreign Investment Opportunities on building global strategic alliances. 1)-...
-
A. Select a recent issue (paper or online) of Report on Business Magazine, Canadian Business Magazine (online only), Bloomberg Businessweek, Fast Company, The Economist, or another business magazine....
-
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?
-
In the absence of limits on the behavior of large intermediaries, how might the perception of institutions being too-big-to-fail lead to increased concentration in the banking industry?
-
One goal of the regulatory reforms that followed the 2007-2009 financial crisis was to address the too-big-to-fail problem associated with large institutions. How did the reforms try to address this...
-
Analyze how a government regulates and supervises the financial system to contain risk.
Study smarter with the SolutionInn App