{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# soln2 - MATH 235/W08 Determinants Solutions to Assignment 2...

This preview shows pages 1–8. Sign up to view the full content.

MATH 235/W08 Determinants Solutions to Assignment 2 Hand in questions 1,2,3,4,5,6,7,8 Several solutions are found using MATLAB. The MATLAB file http://orion.math.uwaterloo.ca/˜hwolkowi/henr contains a diary command and a echo on command. 1. Evaluate the determinants of the following matrices: (a) 1 i 1 + i 2 - i 3 0 - 1 + i 3 1 - i (b) 0 2 3 π 1 - 1 . 56 - 1 . 58 4 . 34 0 0 0 4 0 0 9 102 (c) a b c 2 a + 3 d 2 b + 3 e 2 c + 3 f d e f , where a, b, c, d, e, f C . (d) 6 0 - 1 0 0 9 3 2 3 7 8 0 3 2 9 0 0 4 0 0 5 0 5 0 1 BEGIN SOLUTION: disp(’solutions for assign 2 in W08’) solutions for assign 2 in W08 disp(’ ’) disp(’Prob 1. Evaluate the det of the following four matrices’) 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Prob 1. Evaluate the det of the following four matrices A1=[ 1 i 1+i 2-i 3 0 -1+ i 3 1-i A1 = 1.0000 0 + 1.0000i 1.0000 + 1.0000i 2.0000 - 1.0000i 3.0000 0 -1.0000 + 1.0000i 3.0000 1.0000 - 1.0000i ] det(A1) ans = 15.0000 - 1.0000i disp(’or by expanding along row 2 we get ’) or by expanding along row 2 we get -(2-i)*det([i 1+i;3 1-i]) +3*det([1 1+i;-1+i 1-i]) ans = 15.0000 - 1.0000i A2=[ 0 2 3 pi 1 -1.56 -1.58 4.34 0 0 0 4 0 0 9 102 A2 = 0 2.0000 3.0000 3.1416 1.0000 -1.5600 -1.5800 4.3400 0 0 0 4.0000 0 0 9.0000 102.0000 ] det(A2) ans = 2
72 disp(’exchange rows 1,2 and rows 3,4 to get a triangular matrix’) exchange rows 1,2 and rows 3,4 to get a triangular matrix A2copy=A2([2 1 4 3],:) A2copy = 1.0000 -1.5600 -1.5800 4.3400 0 2.0000 3.0000 3.1416 0 0 9.0000 102.0000 0 0 0 4.0000 prod(diag(A2copy)) ans = 72 pause a=sym(’a’) a = a b=sym(’b’) b = b c=sym(’c’) c = c d=sym(’d’) d = 3

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
d e=sym(’e’) e = e f=sym(’f’) f = f A3=[ a b c 2*a+3*d 2*b+3*e 2*c+3*f d e f A3 = [ a, b, c] [ 2*a+3*d, 2*b+3*e, 2*c+3*f] [ d, e, f] ] disp(’row 2 is a linear combination of rows 1 and 3 - so det is 0 - verify’) row 2 is a linear combination of rows 1 and 3 - so det is 0 - verify det(A3) ans = 0 A4=[ 6 0 -1 0 0 A4 = 6 0 -1 0 0 4
9 3 2 3 7 8 0 3 2 9 0 0 4 0 0 5 0 5 0 1 9 3 2 3 7 8 0 3 2 9 0 0 4 0 0 5 0 5 0 1 ] det(A4) ans = -144 disp(’exchange two rows’) exchange two rows A4copy=A4([4 1 2 3 5],:) A4copy = 0 0 4 0 0 6 0 -1 0 0 9 3 2 3 7 8 0 3 2 9 5 0 5 0 1 disp(’exchange two cols’) exchange two cols disp(’the sign after the two exchanges is +’) the sign after the two exchanges is + A4copy=A4copy(:,[3 1 2 4 5]) A4copy = 4 0 0 0 0 -1 6 0 0 0 2 9 3 3 7 3 8 0 2 9 5 5 0 0 1 det(A4copy) ans = 5

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
144 disp(’by expanding along row 1 repeatedly: det is product along diagonal ’) by expanding along row 1 repeatedly: det is product along diagonal prod(diag(A4copy)) ans = 144 END SOLUTION. 2. Find the value of the determinants of the following matrices. Explain your answer in terms of cofactor expansion: (a) 0 0 0 1 0 0 - 1 0 0 1 0 0 - 1 0 0 0 (b) The 100 × 100 matrix A below: A = 0 0 · · · 0 1 0 0 · · · 1 0 . . . . . . . . . . . . 0 1 · · · 0 0 1 0 · · · 0 0 The ij th entry of A is 1 if i + j = 101; all other entries are 0. BEGIN SOLUTION: disp(’Prob 2. Evaluate the det of the following two matrices - use cofactors’) Prob 2. Evaluate the det of the following two matrices - use cofactors A1=zeros(4); A1(1,4)=1; A1(2,3)=-1; A1(3,2)=1; A1(4,1)=-1 A1 = 6
0 0 0 1 0 0 -1 0 0 1 0 0 -1 0 0 0 det(A1) ans = 1 disp(’or by cofactors: det(A1)= a_14 * C14’) or by cofactors: det(A1)= a_14 * C14 disp(’and expansion along first row of A14: C14 = - (-1)(0+1) = 1’)

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 20

soln2 - MATH 235/W08 Determinants Solutions to Assignment 2...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online