Write a MATLAB function to perform the LU factorization (without pivoting). Your input should be a nonsingular n ×n matrix A. Your output should be a lower triangular matrix L and an upper triangular matrix U such that A = LU. See detailed description in MATLAB Grader.

MATH 3510 FALL 2021 HOMEWORKWrite a MATLAB function to perform the LU factorization (without pivoting). Your
input should be a nonsingular n ×n matrix A. Your output should be a lower triangular
matrix L and an upper triangular matrix U such that A = LU. See detailed description in
MATLAB Grader. 4

(DUE IN CLASS OCTOBER 6)
Instructions: For proof-based questions, write your answers on your own papers. For pro-
gramming questions, submit your codes using MATLAB Grader. Hand in your homework
(written part) on Wednesday, October 6 in class.
1. Write a MATLAB function to perform the LU factorization (without pivoting). Your
input should be a nonsingular n ×n matrix A. Your output should be a lower triangular
matrix L and an upper triangular matrix U such that A = LU. See detailed description in
MATLAB Grader.
2. We discussed in class that Gaussian Elimination/LU factorization is an O(n3) algorithm.
This means that for a n ×n matrix, LU factorization needs approximately n3 flops. The
top supercomputer today is Supercomputer Fugaku in Japan. This machine can execute,
theoretically, 4.42 ×1017 flops per second.
a. How long does it take approximately (in years) for Supercomputer Fugaku to com-
plete a LU factorization for a square matrix with n = 108? How about n = 109,
n = 1010?
b. Suppose we have an O(n) algorithm to solve the linear system Ax = b, how long
does it take for Supercomputer Fugaku to solve the system with size n = 108? How
about n = 109, n = 1010?
Remark 1. From the results you should see why we need fast algorithms.
3. (Pivoting) In class, we find the LUP factorization of the following matrix
A =

0 1 2
1 1 1
2 3 4


is
L =

1 0 0
0 1 0
2 5 1

, U =

1 1 1
0 1 2
0 0 8

, P =

0 1 0
1 0 0
0 0 1

.
In other words, we have PA = LU.
Use this LUP factorization to solve the system Ax = b by hand where b =

0
2
4

.

2 (DUE IN CLASS OCTOBER 6)
Remark 2. You need to use forward substitution and back substitution.
4. (Vector Norms)
a. Let x =


1
3
2
2

. Compute the norms x1 and x2.
b. Define a vector -norm x for any x Rnas follows,
x = maxk|xk|.
Prove the following properties for ‖·‖:
1. x 0. x = 0 if and only if x = 0.
2. αx = |α|‖x, where α R.
3. x + y ≤‖x + y.