0% found this document useful (0 votes)
3 views5 pages

Linear Algebra Tutorial: LU Factorization & More

This document contains tutorial exercises for MA1522 Linear Algebra for Computing at the National University of Singapore. It includes problems on matrix operations, LU factorizations, determinants, Cramer's rule, and approximating integrals using interpolating polynomials. Additionally, it covers concepts related to permutation matrices and the area of triangles using determinants.

Uploaded by

kimminh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

Linear Algebra Tutorial: LU Factorization & More

This document contains tutorial exercises for MA1522 Linear Algebra for Computing at the National University of Singapore. It includes problems on matrix operations, LU factorizations, determinants, Cramer's rule, and approximating integrals using interpolating polynomials. Additionally, it covers concepts related to permutation matrices and the area of triangles using determinants.

Uploaded by

kimminh
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

NATIONAL UNIVERSITY OF SINGAPORE

Department of Mathematics

MA1522 Linear Algebra for Computing Tutorial 3

1. Let A be the 4 × 4 matrix obtained from I by the following sequence of elementary row
operations:
1
R2 R −R R ↔R R +3R
I −2−→−−1−−→
2
−−2−−→
4 3
−− 1
−−→ A.
Write A−1 as a product of four elementary matrices.

2. Find an LU factorization for the matrices A, and solve the equation Ax = b.


   
2 −1 2 1
(a) A = −6 0 −2 and b = 0.
  
8 −1 5 4
   
2 −4 4 −2 0
(b) A =  6 −9 7 −3 and b = 0 .
 
−1 −4 8 0 17
 
2 −6 6
−4 5 −7
 
3
3. Let A =  5 −1 .
−6 4 −8
8 −3 9

(a) Find an LU factorization of A.


(b) We can find a LU factorization in MATLAB using the command lu. Enter the
following codes.

>> A=[2 -6 6;-4 5 -7;3 5 -1;-6 4 -8;8 -3 9];

>> [L U]=lu(sym(A)).

Compare the results with the answer in (a).


 
−x 1 0
4. Let A =  0 −x 1 . Compute the determinant of A and find all the values
2 −5 4 − x
of x such that A is singular.
a + px b + qx c + rx a b c
3
5. Show that p + ux q + vx r + wx = (1 + x ) p q r .
u + ax v + bx w + cx u v w
   
1 5 1 2 1 0 1 1
0 2 6 3
  0 1 1 −1
6. Let A = 
0 and B =  . Compute
0 1 2 0 0 1 2
0 0 1 1 0 0 0 3

(a) det(3AT );
(b) det(3AB−1 ); and
(c) det((3B)−1 ).

7. Use Cramer’s rule to solve



 x + 5y + 3z = 1
2y − 2z = 2
y + 3z = 0

 
1 −1 2
8. Compute the adjoint of A = 0 2 1, and use it to compute A−1 .
3 0 6
Extra problems
 
0 1 1
1. Let A = 1 1 0.
1 0 1
(a) Is it possible find an LU factorization of A?
(b) An n × n matrix P is a permutation matrix if there is exactly one 1 in each row
and column, and 0 everywhere else, equivalent, a matrix obtained from the identity
matrix using only row swap. Find a permutation matrix P such that PA has an
LU factorization.
This question demonstrates that not every matrix can be written as a LU factoriza-
tion. However, we can always find a permutation matrix P such that PA has an LU
factorization.
2. Let A be a n × n invertible matrix.
(a) Show that adj(A) is invertible and find its inverse.
(b) Find det(adj(A)).
(c) If det(A) = 1, show that adj(adj(A)) = A.
3. 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
(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

(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
(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).

4. (Approximate integration)
There are some integrals that are not possible to solve by finding the antiderivate. The
integral can be approximated by using an interpolating polynomial to approximate the
integrand and integrating the approximating polynomial. For example, suppose we want
to evaluate the integral Z 1
2
e−x dx
0
We begin by picking a few points between the limits, say

x0 = 0, x1 = 0.25, x2 = 0.5, x3 = 0.75, x4 = 1


2
and evaluate the integrand f (x) = e−x at these points. They are approximately

f (0) = 1, f (0.25) = 0.9394, f (0.5) = 0.7788, f (0.75) = 0.5698, f (1) = 0.3679

The interpolating polynomial is (check it!)

p(x) = 0.0416x4 + 0.4882x3 − 1.1846x2 + 0.0226x + 1

and Z 1
p(x)dx ≈ 0.7468
0
R1 2
which, up to the fourth decimal place, is exactly the integral 0 e−x dx. The more points
we pick, and thus the higher the degree of the polynomial, the more accurate the ap-
proximation becomes.

By using MATLAB, we can easily approximate the integral using interpolating polyno-
mial. Suppose we want an interpolating polynomial of degree n. First create a vector
whose entries are n + 1 regular steps between a to b
>> v=[a:(b-a)/n:b]’;

Then we create the Vandermonde matrix

>> A=fliplr(vander(v));

2
Let b be the vector whose entries are the evaluation of e−x at the points of v

>> b=exp(-v.^2);

Then we obtain the coefficient of the interpolating polynomial of degree n

>> A\b

R1 2
Use an interpolating polynomial of degree 10 to approximate the integral 0
e−x dx.

You might also like