# 代写 ETF2700 - week 7 tute solutions

• 100%原创包过,高质量代写&免费提供Turnitin报告--24小时客服QQ&微信：273427
• Q1.
代写 ETF2700 - week 7 tute solutions
% Do it by hand, verify in Matlab
A = [10 1 1; 0 0.25 1; 0 0 3];
b = [-7; 4; 6];
x = A\b       % Method 1: left division (Gauss Elimination Algorithm)
x = inv(A)*b  % Method 2: matrix inverse
Q2.
% Do it by hand, verify in Matlab
代写 ETF2700 - week 7 tute solutions
A = [1 4 3; 2 5 4; 1 -3 -2];
b = [1; 4; 5];
x = A\b       % Method 1: left division (Gauss Elimination Algorithm)
Q3.
% The matrix-vector notation is: Ax = b

Q4.
A = [1 4 3; 2 5 4; 1 -3 -2];
b = [1; 4; 5];
x = inv(A) * b % Method 2: matrix inverse
Q5.
A = [1 4; 2 5];
b = [9; 12];
x = inv(A) * b

Q6.
A = LU
Creates:
U = upper triangular matrix
L = unit lower triangular matrix
In matlab:   [L, U] = lu(A)
Step 1: solve Ly = b for y (y = L-1*b)
Step 2: Solve Ux = y for x
(i.e. : x = inv(U) * inv(L) * b)
By hand:  Q7.  (I solved these online using - http://www.math.odu.edu/~bogacki/cgi-bin/lat.cgi)

Row
Operation
1:

 1 4 3 1 2 5 4 4 4 -13 -10 6
add -2 times the 1st row to the 2nd row
 1 4 3 1 0 -3 -2 2 4 -13 -10 6

Row
Operation
2:

 1 4 3 1 0 -3 -2 2 4 -13 -10 6
add -4 times the 1st row to the 3rd row
 1 4 3 1 0 -3 -2 2 0 -29 -22 2

Row
Operation
3:

 1 4 3 1 0 -3 -2 2 0 -29 -22 2
multiply the 2nd row by -1/3
 1 4 3 1 0 1 2   3 -2   3 0 -29 -22 2

Row
Operation
4:

 1 4 3 1 0 1 2   3 -2   3 0 -29 -22 2
add 29 times the 2nd row to the 3rd row
 1 4 3 1 0 1 2   3 -2   3 0 0 -8   3 -52   3

Row
Operation
5:

 1 4 3 1 0 1 2   3 -2   3 0 0 -8   3 -52   3
multiply the 3rd row by -3/8
 1 4 3 1 0 1 2   3 -2   3 0 0 1 13   2

Row
Operation
6:

 1 4 3 1 0 1 2   3 -2   3 0 0 1 13   2
add -2/3 times the 3rd row to the 2nd row
 1 4 3 1 0 1 0 -5 0 0 1 13   2
Row
Operation
7:

 1 4 3 1 0 1 0 -5 0 0 1 13   2
add -3 times the 3rd row to the 1st row
 1 4 0 -37   2 0 1 0 -5 0 0 1 13   2
Row
Operation
8:

 1 4 0 -37   2 0 1 0 -5 0 0 1 13   2
add -4 times the 2nd row to the 1st row
 1 0 0 3   2 0 1 0 -5 0 0 1 13   2

The reduced row echelon form of the augmented matrix is
 1 0 0 3   2 0 1 0 -5 0 0 1 13   2
which corresponds to the system
 1 x1 = (3/2) 1 x2 = -5 1 x3 = (13/2)

Q8. inv(A) * [1; 4; 6]

Q9. [L, U] = lu(A)
y = inv(L) * [1; 4; 6]
x = inv(U) * y
Q12. Elements incorrectly labelled so skip this one…
Q13.
Q = [0 0 0 0 0 0; 0 0 0 0 0 0; 2 6 0 0 0 0; 0 6 2 0 0 0; 0 0 0 0 0 0; 0 15 0 3 1 0];
I = eye(6);
d = [10 100 5 0 0 10];
x = d * inv(I - Q)
from matlab: x = [140  820  65  30  10  10]
Note that you need to post multiply d by (I-Q)-1
Q14. Product of diagonal elements = -16
Q15. 7
Q18. Det(U) is product of diagonals = 320, which equals det(A)
Q21. |A-1| = 1/|A| = 1/320 = 0.0031
Q22.
b) D*S = eye(4), therefore D and S are inverse matrices
c) I + L + L2 + L3 + L4 = S
when n = 4:  (I – L)-1 = (D)-1 = S = I + L + L2 + L3 + L4
for any n: (I – L)-1 = = I + L + L2 + L3 + … + Ln