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 Donnie Corporation and the Thea Corporation manufacture fairly similar remote-controlled toy cars. The Tristan Corporation, a retailer of children's toys, expects to buy and sell 4,000 of these...
-
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...
-
David Barnes and his fiancée Valerie Shah are visiting Hawaii. At the Hawaiian Cultural Center in Honolulu, they are told that 2 out of a group of 8 people will be randomly picked for a free...
-
By using blue paint, determine which of the following FAs accept any words: a. b (1 a. h h
-
On April 1, 2006, US Ultracom issued 7\%, 10-year bonds payable with maturity value of \(\$ 400,000\). The bonds pay interest on March 31 and September 30, and US Ultracom amortizes premium and...
-
Assume the same facts as for Question 1 above. The fair value of the investment in Company E is $220,000 on December 31, 2011. Answer the following questions assuming the investment is recorded using...
-
Ingrid plans to live for two periods and only cares about consumption in the second period. She is considering studying towards a postgraduate degree in the first period. If she does it, it's going...
-
Find the simple interest for each of the following. Round to the nearest cent. 1. $27,850 at 7.75% for 100 days 2. $7800 at 9.25% for 4 months 3. A loan of $5800 at 9% made on May 22 and due July 5...
-
Cherise Ortega, marketing manager for Romer Company, was puzzled by the outcome of two recent bids. The company's policy was to bid 150 percent of the full manufacturing cost. One job (labeled Job...
-
What does ROE measure?
-
How does the federal income tax system treat dividends received by a corporation versus those received by an individual?
-
What is the difference in the tax treatment of interest and dividends paid by a corporation? Does this factor favor debt or equity financing?
-
Explain how the extended, or modified, DuPont equation can be used to reveal the basic determinants of ROE.
-
Indicate whether each of the following statements is true or false by writing T or F in the answer c olumn. A contract in which an employee agrees not to work for a competitor for a reasonable period...
-
What is the focal length of the lens if it is immersed in water(nwater=1.3)? A "biconvex" lens is one in which both surfaces of the lens bulge outwards. Suppose you had a biconvex lens with radii of...
-
Why is a help desk and production support critical to system implementations? Discuss its interrelationship with the problem management and reporting system.
-
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;...
-
Consider the MOSFET class-AB output stage in Figure 8.26. The parameters are: \(V_{D D}=10 \mathrm{~V}\) and \(R_{L}=100 \Omega\). For transistors \(M_{n}\) and \(M_{p}, V_{T N}=\) \(-V_{T P}=1...
-
An enhancement-mode MOSFET class-AB output stage is shown in Figure P8.29. The threshold voltage of each transistor is \(V_{T N}=-V_{T P}=1 \mathrm{~V}\) and the conduction parameters of the output...
-
For the inductively coupled amplifier in Figure 8.28(a), the parameters are: \(V_{C C}=15 \mathrm{~V}, R_{E}=0.1 \mathrm{k} \Omega\), and \(R_{L}=1 \mathrm{k} \Omega\). The transistor parameters are...
Study smarter with the SolutionInn App