0% found this document useful (0 votes)
2 views

Tutorial 3 Solution

This document contains tutorial exercises on linear algebra, focusing on Gaussian elimination, invertibility of matrices, and Cramer's Rule. It includes solutions for determining the invertibility of given matrices, conditions for invertibility, and solving matrix equations. Additionally, it discusses stochastic matrices and their properties.

Uploaded by

Lim Jia Le
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Tutorial 3 Solution

This document contains tutorial exercises on linear algebra, focusing on Gaussian elimination, invertibility of matrices, and Cramer's Rule. It includes solutions for determining the invertibility of given matrices, conditions for invertibility, and solving matrix equations. Additionally, it discusses stochastic matrices and their properties.

Uploaded by

Lim Jia Le
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

NATIONAL UNIVERSITY OF SINGAPORE

Department of Mathematics

MA1508E Linear Algebra for Engineering Tutorial 3

1. Use the method of Gaussian elimination to determine if the following matrices are
invertible. If the matrix is invertible, find its inverse.
 
−1 3
(a) .
3 −2
 
−1 3 −4
(b)  2 4 1 .
−4 2 −9

Solution:

(a)
2 3
   
−1 3 1 0 R2 +3R1 , −R1 , 1
R ,
7 2
R1 +3R2 1 0
−−−−−−−−−−−−−−−−→ 7
3
7
1 .
3 −2 0 1 0 1 7 7
 
1 2 3
So the matrix is invertible and its inverse is 7
.
3 1

(b)
   
−1 3 −4 1 0 0 −1 3 −4 1 0 0
R2 +2R1 , R3 −4R1 , R3 +R2
 2 4 1 0 1 0 − −−−−−−−−−−−−−−→  0 10 −7 2 1 0  .
−4 2 −9 0 0 1 0 0 0 −2 1 1

The matrix is not invertible.

2. (a) Use themethod of Gaussian elimination to write down the conditions so that the
1 1 1
matrix a b
 c  is invertible.
a2 b 2 c2
Solution:
     
1 1 1 1 1 1 1 1 1
−aR1 R3 −(b+a)R2
 a b c  −R−2− −2−→ 0 b − a c − a  −−−−−−−→ 0 b − a c−a 
2 2 2 R3 −a R1 2 2 2 2
a b c 0 b −a c −a 0 0 (c − a)(c − b)

So we need c ̸= a and c ̸= b for the last row to be nonzero. Suppose so, we proceed,
   
1
R
1 1 1 1 1 0
(c−a)(b−a) 3 R2 −(c−a)R3
−−−−−−−→ 0 b − a c − a −−−−−−−→ 0 b − a 0
R1 −R3
0 0 1 0 0 1
If b ̸= a, then it is clear that the matrix can be reduced to the identity matrix.
Thus the conditions are a ̸= b, b ̸= c, c ̸= a, that is, they are distinct points.

Alternative: One can stop after the third ERO and note that the determinant of
the resultant matrix is (b − a)(c − a)(c − b), which is nonzero if and only if the 3
points are distinct.

(b) Notice that the above matrix is the transpose of the order 3 Vandermonde matrix.
By (a), what are the conditions needed for the 3 points (x1 , y1 ), (x2 , y2 ), (x3 , y3 ) on
the xy-plane to ensure that there is a unique polynomial of degree 2 whose graph
passes through those points.

Solution: Recall that a matrix is invertible if and only its transpose is. So if we pick
the 3 points (x1 , y1 ), (x2 , y2 ), (x3 , y3 ) on the xy-plane to have distinct x-coordinates,
then the Vandermonde matrix is invertible. This means that the linear system corre-
sponding to the augmented matrix
 
1 x1 x21 y1
1 x2 x22 y2 
1 x1 x21 y3

has a unique solution, and thus we obtain a unique polynomial of degree 2 interpolating
the 3 points.
   
2 1 1 2 3 4 1
3. (a) Solve the matrix equation 0 1 2 X = 1 0 3 7.
1 3 2 2 1 1 2
   
2 1 1 1
(b) Hence, solve for 0 1 2 x = −1. (Hint: look at the columns of the matrix
1 3 2 −1
on the right.)

Solution:

(a)
1 0 0 57 11 12
− 57
   
2 1 1 2 3 4 1 7 7
 0 1 2 1 0 3 7  −→  0 1 0 1 − 2 − 13 − 15 
7 7 7 7
1 3 2 2 1 1 2 0 0 1 37 17 17
7
32
7
 
5 11 12 −5
So X = 71  1 −2 −13 −15 
3 1 17 32
     
1 3 2
(b) Notice that −1 = 0 − 1 is the subtraction of the first column from the
    
−1 1 2
     
11 5 6
second of the matrix on the right. So let x = 17 −2 − 1 = 1
7
−3
1 3 −2
works.

Remarks: One may choose to compute the inverse of the matrix on the left, then
premultiply it to the matrix on the right to find X in (a). This approach involves more
computation than the approach above. However, the inverse can be used directly to
compute part (b). Note that because the matrix on the left is invertible, the answers
in (a) and (b) is unique.

4. (Cramer’s Rule)

(a) Compute the determinant of the following matrices.


 
1 5 3
(i) A = 0 2 −2
0 1 3
 
1 5 3
(ii) A1 = 2 2 −2
0 1 3
 
1 1 3
(iii) A2 = 0 2 −2
0 0 3
 
1 5 1
(iv) A3 = 0 2 2
0 1 0
 
1
(b) Solve the matrix equation Ax = b, where b = 2.

0
 
det(A1 )
1
(c) Compute det(A) det(A2 ). How is this related to the answer in (b)?

det(A3 )
Observe that the matrix Ak is obtained by replacing the k-th column of A by b.
Cramer’s rule state that if A is an invertible matrix of order n and Ak is the matrix
obtained from A by replacing the k-th column of A by b, then the matrix equation
Ax = b has a unique solution
 
det(A1 )
1  det(A2 ) 
x= .
 
..
det(A) 

. 
det(An )
Solution:

(a) (i) 8 (ii) -16 (iii) 6 (iv) -2


 
−8
(b) x = 14  3 .
−1

(c) Equal to the solution in (b).

 
−x 1 0
5. Let A =  0 −x 1 . Find all values of x such det(A) = 0. For each of the x
2 −5 4 − x
found, solve the homogeneous linear system Ax = 0.

Solution:
−x 1 0
0 −x 1 = −x3 + 4x2 − 5x + 2 = −(x − 1)2 (x − 2)
2 −5 4 − x

So the values of x such that det(A) = 0 are x = 1 and x = 2. When x = 1, solving


Ax = 0:
    
−1 1 0 0 1 0 −1 0  x1 = s
 0 −1 1 0  −→  0 1 −1 0  ⇒ x2 = s
2 −5 3 0 0 0 0 0 x3 = s, s∈R

When x = 2, solving Ax = 0:

1 0 − 41 0  x1 = 4s
   
−2 1 0 0
1
 0 −2 1 0  −→  0 1 − 0  ⇒
2
x2 = 2s
2 −5 2 0 0 0 0 0 x3 = s, s∈R

6. A square matrix P = (pij ) of order n is a stochastic matrix, or a Markov matrix if the


sum of each column vector is equal to 1,

p1j + p2j + · · · + pnj = 1

for every j = 1, ..., n.

(a) Give an example of an invertible stochastic matrix, and a singular one.


Solution: The identity matrix I is an obvious but uninteresting invertible stochas-
0.2 0.3
tic matrix. is an invertible stochastic matrix. The stochastic matrix
0.8 0.7  
0.5 0.5
P in (c) is also invertible. is a singular stochastic matrix.
0.5 0.5

(b) Show that if P is a stochastic matrix, then I − P is singular.


Solution:
 
1 − p11 −p12 · · · −p1n
 −p21 1 − p22 · · · −p2n 
 R1 +R2 R1 +R3 R1 +Rn
I − P =  .. ..  −−−−→−−−−→ · · · −−−−→

.. . .
 . . . . 
−pn1 −pn2 · · · 1 − pnn
1 − k=1 pk1 1 − nk=1 pk2 · · · 1 − nk=1 pkn
 Pn P P 

 −p21 1 − p22 ··· −p2n 

 .. .. . . .
. 
 . . . . 
−pn1 −pn2 ··· 1 − pnn
 
0 0 ··· 0
 −p21 1 − p22 · · · −p2n 
=  ..
 
.. . . .. 
 . . . . 
−pn1 −pn2 · · · 1 − pnn

and so its RREF cannot be the identity matrix.


 
0.2 0.8 0.4
(c) Check that P = 0.3 0.2
 0.4 is a stochastic matrix. Solve the homogeneous
0.5 0 0.2
system (I − P)x = 0.
Solution:

1 0 − 85 8
   
0.8 −0.8 −0.4  x1 = 5
s,
11  11
I − P = −0.3 0.8 −0.4 −→ 0 1 − 10 ⇒
   x2 = 10
s,
−0.5 0 0.8 0 0 0 x3 = s, s∈R

a + px b + qx c + rx a b c
3
7. Show that p + ux q + vx r + wx = (1 + x ) p q r .
u + ax v + bx w + cx u v w
Solution:
   
a + px b + qx c + rx a + px b + qx c + rx
R2 −xR3 R −xR2
p + ux q + vx r + wx − −−−−→ p − ax2 q − bx2 r − cx2  −−1−−−→
u + ax v + bx w + cx u + ax v + bx w + cx
 3 3 3

a(1 + x ) b(1 + x ) c(1 + x )
 p − ax2 q − bx2 r − cx2 
u + ax v + bx w + cx
If x = −1, then the first row is a zero row and so the determinant is 0, which agrees
with the right hand side too. Otherwise, we continue
   
1
R 1
a b c 2
a b c
1+x3 2 2 2  R2 +x R1 
−−−−→ p − ax q − bx r − cx
 −−−−−→ p q r
R3 −xR1
u + ax v + bx w + cx u v w
1
Since all the elementary row operation except 1+x 3 R1 are adding a multiple of one

row to another, and thus the determinant of the elementary matrices are 1, and
1 1
the determinant of the elementary matrix corresponding to 1+x 3 R1 is 1+x3 . Hence,

a b c a + px b + qx c + rx
1
p q r = 1+x3 p + ux q + vx r + wx .
u v w u + ax v + bx w + cx
Supplementary Problems
8. (Application of determinants to computing areas.) Consider the triangle with
vertices (x1 , y1 ), (x2 , y2 ) and (x3 , y3 ) as shown in the figure below.

y
P2 (x2 , y2 )

P1 (x1 , y1 )

P3 (x3 , y3 )
x
A(x1 , 0) B(x2 , 0) C(x3 , 0)

We may compute the area of the triangle as

(area of trapezoid AP1 P2 B)+(area of trapezoid BP2 P3 C)−(area of trapezoid AP1 P3 C)

(a) Recall that the area of a trapezoid is 12 the distance between the parallel sides of
the trapezoid times the sum of the lengths of the parallel sides. Use this fact to
show that the area of the triangle P1 P2 P3 is
1
− [(x2 y3 − x3 y2 ) − (x1 y3 − x3 y1 ) + (x1 y2 − x2 y1 )] .
2

Solution: The area of triangle P1 P2 P3 is


1 1 1
= (x2 − x1 )(y1 + y2 ) + (x3 − x2 )(y2 + y3 ) − (x3 − x1 )(y1 + y3 )
2 2 2
1 1 1 1 1 1
= x2 y1 − x1 y2 + x3 y2 − x2 y3 − x3 y1 + x1 y3
2 2 2 2 2 2
1
= − [(x2 y3 − x3 y2 ) − (x1 y3 − x3 y1 ) + (x1 y2 − x2 y1 )]
2

(b) Show that the expression in the square brackets obtained in part (a) is the deter-
minant of the following matrix
 
x1 y 1 1
A = x2 y2 1 .
x3 y 3 1
Solution: By cofactor expansion along the third column of A, we have

x2 y 2 x y x y
det(A) = − 1 1 + 1 1 = (x2 y3 −x3 y2 )−(x1 y3 −x3 y1 )+(x1 y2 −x2 y1 )
x3 y 3 x3 y 3 x2 y 2

(c) Explain why we need to take the absolute value of det(A) before concluding that
the area of the triangle is
1
|det(A)|.
2
Solution: The determinant may be positive or negative, depending on the loca-
tion of the points and how they are labeled. For example, compare the determi-
nant of    
x1 y 1 1 x1 y 1 1
x2 y2 1 and x3 y3 1 .
x3 y 3 1 x2 y 2 1

(d) Find the area of the following quadrilaterals with the given vertices.
(i) P with vertices (2, 3), (5, 3), (4, 5), (7, 5).
(ii) Q with vertices (−2, 3), (1, 4), (3, 0), (−1, −3).

Solution:

(i) The quadrilateral is divided into two triangles P1 and P2 with vertices
(2, 3), (5, 3), (4, 5) and (4, 5), (5, 3), (7, 5) respectively. The area of the quadri-
latral is:
2 3 1 4 5 1
1 1 1 1
5 3 1 + 5 3 1 = (6) + (6) = 6.
2 2 2 2
4 5 1 7 5 1

(ii) The quadrilateral is divided into two triangles P1 and P2 with vertices
(−2, 3), (1, 4), (3, 0) and (−2, 3), (−1, −3), (3, 0) respectively. The area of
the quadrilateral is:

1 4 1 −2 3 1
1 1 1 1
−2 3 1 + −1 −3 1 = (14) + (27) = 20.5.
2 2 2 2
3 0 1 3 0 1

You might also like