4. Create a function, which, given an input of a positive integer n, produces an n...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4. Create a function, which, given an input of a positive integer n, produces an n x n matrix A = (Aij) such that Aij=i+j-1. For example, the function should return a matrix below with an input n = 5. 1234 1 3 4 5 456 4 5 6 7 5 6 7 8 9 2 3 5 6 7 8 Hint: Using rep() and seq() as needed, create the vector 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 and vector 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 first. 1. (a) Learn function plot () by running commands x < 1:100 plot (x, 1/x, type='1') (b) Calculate the sum for all n between 1 and 100. Plot the sum versus n. =112 (c) Calculate the sum Σfor all n between 1 and 100. Plot the sum versus n. (d) (*) If you increase n, what can you say from the graphs about convergence of the series? (This is an optional question. No credit.) 4. Create a function, which, given an input of a positive integer n, produces an n x n matrix A = (Aij) such that Aij=i+j-1. For example, the function should return a matrix below with an input n = 5. 1234 1 3 4 5 456 4 5 6 7 5 6 7 8 9 2 3 5 6 7 8 Hint: Using rep() and seq() as needed, create the vector 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 3 4 4 4 4 4 and vector 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5 first. 1. (a) Learn function plot () by running commands x < 1:100 plot (x, 1/x, type='1') (b) Calculate the sum for all n between 1 and 100. Plot the sum versus n. =112 (c) Calculate the sum Σfor all n between 1 and 100. Plot the sum versus n. (d) (*) If you increase n, what can you say from the graphs about convergence of the series? (This is an optional question. No credit.)
Expert Answer:
Answer rating: 100% (QA)
Objective To create a function which given an input of a positive integer n prod... View the full answer
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these databases questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
A compare-exchange operation on two array elements A[i] and A[j], where i < j, has the form COMPARE-EXCHANGE (A, i, j) 1 If A[i] > A[j] 2 exchange A[i] with A[j] After the compare-exchange operation,...
-
Court Casuals has 100,000 shares of common stock outstanding as of the beginning of the year and has the following transactions affecting stockholders' equity during the year. May 18 Issues 25,000...
-
According to U.S. News & World Report's Business School Rankings, the median earnings for graduates of full-time, highly ranked MBA programs 4 years after graduating is $125,000. A random sample of...
-
Messi Company is considering an investment that will return a lump sum of $900,000 6 years from now. What amount should Messi Company pay for this investment to earn an 8% return?
-
Repeat the calculations of Example 6.3, but for \(80 \mathrm{~mol} \%\) of the liquid distilled. Data From Example 6.3:- Suppose the liquid of Example 6.1 [50 mol% n-heptane (A), 50 mol% n-octane...
-
The marketing department of Metroline Manufacturing estimates that its sales in 2013 will be $1.5 million. Interest expense is expected to remain unchanged at $35,000, and the firm plans to pay...
-
Simplify the expression to a form in which 2 is raised to a single integer power. (25)32-7 2-6
-
You want to park your bicycle in a bicycle parking area where bike racks are aligned in a row. There are already N bikes parked there (each bike is attached to exactly one rack, but a rack can have...
-
Fine Furniture Factory receives a daily shipment of 50 boards of pine and 60 boards of mahogany, which they use to make cabinets and tables. Each cabinet uses two pine boards and two mahogany boards,...
-
Your firm is planning to invest in an automated packaging plant. Harburtin Industries is an all-equity firm that specializes in this business. Suppose Harburtins equity beta is 0.84, the risk-free...
-
Pelamed Pharmaceuticals had EBIT of $354 million in 2018. In addition, Pelamed had interest expenses of $128.34 million and a corporate tax rate of 25%. a. What was Pelameds 2018 net income? b. What...
-
Dina El-Tohamy, a local resident of Cairo, Egypt, has always had a passion for baking. After graduating with a degree in business administration, she decided to attend several cooking classes to...
-
A retail coffee company is planning to open 110 new coffee outlets that are expected to generate $15.2 million in free cash flows per year, with a growth rate of 2.9% in perpetuity. If the coffee...
-
Rogot Instruments makes fine violins, violas, and cellos. It has $1.9 million in debt outstanding, equity valued at $2.8 million, and pays corporate income tax at a rate of 40%. Its cost of equity is...
-
What kind of support do you think the wholesale distributors should expect from master lock
-
Assume today is the 21st of February. Using the information below, FT Extract, answer the following questions (parts i and ii). You work for a US company that is due to receive 250 million in June...
-
Do one iteration of successive relaxation with w = 3/2 using the system in Problem 2.58 and an initial guess x = [0.9 0.1 2.2 1.1]. Data from Problem 2.58 Perform the first two iterations of Jacobis...
-
An important time parameter in reaction engineering is the reactor space time , the time needed to process one reactor volume of fluid. For an ideal plug-flow reactor (PFR), a mass balance gives a...
-
What ODE is solved by the following MATLAB code and what method is used? Include the initial condition in your answer. 1 function problem4_23 2 3 4 nsteps = 100; y = 1; t = 0; h = 0.01; 5 6 g=figure;...
-
The following are some costs incurred by a shoe manufacturer. Decide whether each one is a fixed cost or a variable cost or has some element of both. (a) The cost of leather; (b) The fee paid to an...
-
Why does the marginal cost curve pass through the bottom of the average cost curve and the average variable cost curve?
-
Outline the main factors that might influence the size of the profit mark-up set by a business.
Study smarter with the SolutionInn App