Now we are going to see how the computational complexity scales with the size of our...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Now we are going to see how the computational complexity scales with the size of our Nx N matrix. Write a loop from N=1 to 100 that: creates matrix of size N with random entries, calls GE_count for each matrix, saves the number of operations in a vector count vector (one entry for each matrix) define a vector, Nvector from 1 to 100 You can generate random matrices of size Nx N by using the MATLAB command: rand (N). Make a plot of the size of the matrix (x-axis) by the number of scaling operations and number of subtraction/replacement operations (y-axis). Use the commands figure (1) %generates a new figure plot (Nvector, countvector) %Nvector and count vector need to be the same length xlabel ('Size of Matrix, N') ylabel('Number of operations') title('Computational complexity of GE') (c) Do the operations both grow like O(N)? Plot on a log-log scale to check. You can also plot (N vs N) to compare the slope. The command for plotting on log-log is loglog(x,y). (d) Find the number of necessary floating point operations required to com- pute the following operations (using the big-oh notation introduced in class). Explain your reasoning in each case. (a) Compute the sum A + B for A, B = Rmxn. (b) Compute the product Ax for x E Rn and A E Rnxn where A is upper triangular. Now we are going to see how the computational complexity scales with the size of our Nx N matrix. Write a loop from N=1 to 100 that: creates matrix of size N with random entries, calls GE_count for each matrix, saves the number of operations in a vector count vector (one entry for each matrix) define a vector, Nvector from 1 to 100 You can generate random matrices of size Nx N by using the MATLAB command: rand (N). Make a plot of the size of the matrix (x-axis) by the number of scaling operations and number of subtraction/replacement operations (y-axis). Use the commands figure (1) %generates a new figure plot (Nvector, countvector) %Nvector and count vector need to be the same length xlabel ('Size of Matrix, N') ylabel('Number of operations') title('Computational complexity of GE') (c) Do the operations both grow like O(N)? Plot on a log-log scale to check. You can also plot (N vs N) to compare the slope. The command for plotting on log-log is loglog(x,y). (d) Find the number of necessary floating point operations required to com- pute the following operations (using the big-oh notation introduced in class). Explain your reasoning in each case. (a) Compute the sum A + B for A, B = Rmxn. (b) Compute the product Ax for x E Rn and A E Rnxn where A is upper triangular.
Expert Answer:
Related Book For
Financial Accounting and Reporting a Global Perspective
ISBN: 978-1408076866
4th edition
Authors: Michel Lebas, Herve Stolowy, Yuan Ding
Posted Date:
Students also viewed these computer network questions
-
Estimating the Area Under a Curve with MatLab The first new idea here is how to use subscripts within MatLab. Outside of the MatLab environment, a row vector x with n components would look like x = [...
-
9. Let x = (1.11... 111000...) 26, in which the fractional part has 26 1's followed by O's. For the Marc-32, determine x, x+, f(x), x-xx-x, xx, and lx-fl(x)/x.
-
What should a short-term or long-term consequence make a difference in resolving an ethical dilemma?
-
Following is a diagram of the shirt-cleaning process used by the Floods of Suds One-Day Laundry Services, Inc. The shirts are soaked in an agitated tub containing Whizzo the Wonder Detergent, and are...
-
Bharti Investments Ltd. holds 8000 shares of Phonetel Corporation Ltd. It acquires 7000 shares of Subharti Ltd. from Idea Investments Ltd. in exchange for these shares. Determine the cost of shares...
-
Eagle River Plastics Company has a major branch located in Phoenix. The branch deposits cash receipts daily, and periodically transfers the receipts to the company's home office in Eagle River. The...
-
Study Problem 9-8 (algo) Table A below shows abbreviated balance sheets for the central bank in the country of Beckland and B shows tables for its whole" commercial banking system. The target reserve...
-
Arabian Gulf Corporation reports the following stockholders' equity section on December 31, 2020. - Common stock; $10 par value; 700,000 shares authorized; 300,000 shares issued and outstanding. -...
-
Distinguish between the terms unique class and connection point. [3 marks] (b) Explain exhaustively what happens when class GPS underneath is launched taking note of, specifically, any tasks that are...
-
A marketing firm is hiring 3 new employees. Their job duties entail developing new marketing plans and to appear at certain promotional events. After all the candidates are interviewed, the marketing...
-
This based off of Meta Company (Facebook) Identify how neuroscience might help you with the retention and motivation plan. Detailed suggestions on how to implement change, such as implementing the...
-
A Drug Identification Number (DIN) is: 1) An 8-digit number given by Service Canada that confirms the disinfectant or sanitizer product is approved and safe for use in Canada 2) A 10-digit number...
-
Explain legislation and industry best practice applicable to inspections and appraisals. Apply supervision skills to ensure licensees complete inspections and appraisals using best practice,...
-
Write assembly program that compare two numbers, allow user to enter two numbers. Assume the numbers are one digit (0-9). The output should print the * result of comparison on console. (8 Marks)
-
If you want to solve a minimization problem by applying the geometric method to the dual problem, how many variables and problem constraints must be in the original problem?
-
Multiple Choice Question Select the right answer (only one possible answer unless otherwise stated). 1 Which category (ies) of transactions and events is (are) specified in IAS 18 rules guiding the...
-
The Company Lalo Company, headquartered in Vaduz, is a company listed in Amsterdam, Paris and Zurich. It is the third largest small home appliance manufacturer in Europe. The company was founded in...
-
Wipro Limited, together with its subsidiaries and equity accounted investees (collectively, Wipro) is a leading India-based provider of IT Services, including Business Process Outsourcing (BPO)...
-
Renkas Heaters selected data for October 2017 are presented here (in millions): Calculate the following costs: 1. Direct materials inventory 10/31/2017 2. Fixed manufacturing overhead costs for...
-
The following data are for Huang Wong Ping Retail Outlet Stores. The account balances (in thousands) are for 2017. 1. Compute (a) the cost of goods purchased and (b) the cost of goods sold. 2....
-
The Howell Corporation has the following account balances (in millions): Prepare an income statement and a supporting schedule of cost of goods manufactured for the year ended December 31, 2017. (For...
Study smarter with the SolutionInn App