Question

In: Computer Science

4. For n = 50, 100, 200, 300, 400, do the following. Let A be the...

4. For n = 50, 100, 200, 300, 400, do the following. Let A be the n × n matrix with entries Aij = p 2(i − j) 2 + n/5. Define xexact = [1, 1, . . . , 1]T , and then compute b = Axexact. Using Matlab’s backslash, numerically solve the equation

Ax = b,

thereby producing a computed solution xc. In exact arithmetic xc = xexact of course, but in IEEE double precision xc will not equal xexact. The quantity kxc − xexactk∞ is the forward error. Construct a table which, for each n, collects the relative forward error, relative backward error, magnification factor, and (infinity-norm) condition number of A. Discuss your results.

Solutions

Expert Solution

ANSWER :

format long
n=input('Enter the size of matrix: ')
A=zeros(n,n)
for i=l:n
    for j=l:n
        A(i,j)=(2*(i-j)^2+n/5)^(1/2)
    end
end
x_exact=ones(n,l)
b=A*x_exact
x=A/b
bl=A*x
REF=norm((x-x_exact),inf)/norm(x_exact,inf)    %Relative forward Error
RBE=norm((b-bl),inf)/norm(b,inf)               %Relative Backward Error
MF=REF/RBE                                     %Magnification Factor
k=cond(A,inf)                                  %Condition number with infinity norm
N Relative forward Error Relative Backward Error Magnification Factor Condition number with infinity norm
50 6.0513*10^-11 6.499*10^-16 9311*10^4 9.82*10^5
100 3.549*10^-9 6.463*10^-16 549*10^6 6.184*10^7
200 9.3077*10^-7 5.157*10^-16 1.804*10^9 1.29*10^10
300 4.639*10^-5 1.259*10^-15 3.683*10^10 6.2039*10^11
400 8.5488*10^-4 1.2876*10^-15 6063*10^11 1.475*10^13
  • Relative Farword Error is increasing as n increases.
  • Relative backward Error lies between 10^-16 and 10^-15 range as n increases.
  • The magnification Factor increases with increase in the value of n.
  • The condition number also increases with n which means the matrix is getting more all conditioned as n increases.

( PLEASE VOTE FOR THIS ANSWER )

I THINK IT WILL BE USEFULL TO YOU .......

PLZZZZZ COMMENT IF YOU HAVE ANY PROBLEM I WILL TRY TO SOLVE IT .............

THANK YOU ..............


Related Solutions

4. For n = 50, 100, 200, 300, 400, do the following. Let A be the...
4. For n = 50, 100, 200, 300, 400, do the following. Let A be the n × n matrix with entacries Aij = p 2(i − j) 2 + n/5. Define xexact = [1, 1, . . . , 1]T , and then compute b = Axexact. Using Matlab’s backslash, numerically solve the equation Ax = b, thereby producing a computed solution xc. In exact arithmetic xc = xexact of course, but in IEEE double precision xc will not...
b) Given fixed memory partitions of 200 KB, 100 KB, 400 KB, 300 KB, and 400...
b) Given fixed memory partitions of 200 KB, 100 KB, 400 KB, 300 KB, and 400 KB (in order), how would each of the algorithms from (a) place processes in memory if they required 187 KB, 228 KB, 126 KB, 306 KB (in order)? c) A system has five page frames. The time of loading, time of last access, and the Referenced and Modified bit for each page are shown in the following table (with time in clock ticks). Frame...
Period Forecast 1 200 2 500 3 300 4 400 5 200 6 200 Regular time:...
Period Forecast 1 200 2 500 3 300 4 400 5 200 6 200 Regular time: $20 per unit (maximum of 280 units per period) Overtime:    $30 per unit (maximum of 40 units per period) Subcontracting:    Not available Beginning inventory:   None Carrying cost: $10 per unit per period Backorder cost: $50 per unit per period What is the total regular time cost for the plan which minimizes total cost? Round answer to nearest dollar. Do not use a...
What are alpha and Beta for a sampling plan A ( n=200 c=4) B( n=300 c=8...
What are alpha and Beta for a sampling plan A ( n=200 c=4) B( n=300 c=8 ) AQL =1% LTPD =4%
Find the resultant (magnitude and direction) of these forces: 300 N at 00 and 400 N...
Find the resultant (magnitude and direction) of these forces: 300 N at 00 and 400 N at 1500. After falling from a cliff that is 100 m high, a 30 kg rock hits the ground below. Neglecting air resistance, how fast was it moving just as it hit? How much heat will it take to completely melt 2 kg of lead that is at 2270 C? What is the mutual attractive gravitational force between two people, each with a mass...
Disposable Income Consumption 0 $200 billion $200 billion 300 billion 400 billion 400 billion 600 billion...
Disposable Income Consumption 0 $200 billion $200 billion 300 billion 400 billion 400 billion 600 billion 500 billion 800 billion 600 billion How much is the marginal propensity to consume when disposable income rises from $600 billion to $800 billion? Select one: a. 0.65 b. 0.5 c. 0.75 d. 0.85
Retained Earnings T-Account: Debit- 200 and 400/ Credit-700 Dividends T-Account: Debit-100, 100, and 200/ Credit-400 Income...
Retained Earnings T-Account: Debit- 200 and 400/ Credit-700 Dividends T-Account: Debit-100, 100, and 200/ Credit-400 Income Summary T-Acount: Debit- 1,500/ Credit- 800, and 700 Find (a) the revenue for the period (b) Dividends for the period (c) Net income (d) Ending balance of retained earnings
1. (A-D) A) a = 400 b = .9 I = 300 G = 200 T...
1. (A-D) A) a = 400 b = .9 I = 300 G = 200 T = 150 (b = MPC) a) Solve for Y* (equilibrium output) b) What is the value of the spending (Keynesian) multiplier? c) What is the value of the tax multiplier? d) What is the value of the 'balanced budget' multiplier? B) a = 400 b = .9 I = 300 G = 300 (an increase of 100 from A above) T = 150 a)...
A loan L is repaid with annual payments of $500, $400,$300, and $200 at the end...
A loan L is repaid with annual payments of $500, $400,$300, and $200 at the end of each year using a sinking fund method. If the loan has 10%effective interest rate per year and the sinking fund has 8% effective interest our year, find L
Which of the following is correct? Select one: a. The data set 100, 200, 300 has...
Which of the following is correct? Select one: a. The data set 100, 200, 300 has the same variance as the data set 150, 250, 350. b. If two data sets have the same range, both sets will have the same interquartile range. c. Pie and bar charts are graphical techniques for nominal data. The former focuses the attention on the frequency of the occurrences of each category, and the latter emphasizes the proportion of occurrences of each category d....
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT