MA1522 Linear Algebra for Computing
Week 9 Problem Solving Session
Announcements
1. Attempt Quiz 5.1 to 5.2, due on Friday 17 October 2025.
2. No tutorial next week due to Diwali. Watch Wednesday Lecture group 2 tutorial recording instead.
3. Problem-Solving session as per normal next Thursday, but Dr Lo will be facilitating the session instead.
4. Homework 2 due this Sunday, 19 October 2025, 2359h. Download your submitted file to check that it
is the right, complete, file, and all the pages are clear. Canvas will impose the late penalty
automatically for any submission after deadline.
Submission
▶ The questions are available in Canvas Assignment, with copyable MATLAB codes.
▶ Submit your solutions only for those labeled Problem 1 to 3.
▶ If handwritten on A4 paper: scan or take clear photos of your work. Merge all pages into a single
PDF file, arranged in the correct order.
▶ If typed or written digitally: save or export directly as a PDF file.
▶ Name your file as StudentNo week9 (e.g. A1234567Z [Link]).
▶ Upload your PDF file to Canvas under Lecture group 1: Problem Solving Session Week 9.
▶ Deadline: Today, 1830hrs.
Question 1(a)
Let
1 1 1
0
0 1
S = u1 = 1
, 1 ,
u2 = u3 = −1 .
−1 0 1
1 0 −1
Convert S into an orthonormal set. Write down the orthonormal vectors explicitly, but you do not need to
show any computation.
u1=[1;0;1;-1;1];u2=[1;0;1;0;0];u3=[1;1;-1;1;-1];
Question 1(b)
Let T = {w1 , w2 , w3 } be the orthonormal set obtained in (a). For each i = 1, 2, 3, find [ui ]T , the
coordinates of ui relative to the basis T . You do not need to show any computation.
Question 1(c)
1 1 1
0 0 1
1
Let A = 1 −1
. Find a QR-factorization of A.
−1 0 1
1 0 −1
A=[u1 u2 u3]
Challenge
Prove that in the economic QR-factorzation, R is invertible.
Prelude to Question 2
Why was there a need for "econ" when finding QR-factorization using MATLAB? Let A be a m × n
matrix where rank(A) = n.
▶ In the general full QR-factorization,
A = QR
requires Q to be an orthogonal matrix QT Q = I = QQT , i.e. a square matrix whose columns (and
rows) form an orthonormal basis for Rm . In this case, R will have m − n zero rows at the bottom.
▶ In our course, we defined QR-factorization to be such that Q has the same size as A, and the columns
of Q is an orthonormal set, and thus R is a square matrix, of order equals to the number of columns
of A. This is called the “economy-size” QR factorization, no redundant columns of Q, no extra rows
of zeros in R. It uses less memory and computation time, especially for large matrices.
Question 2(a)
Let
1 1 1
0
0 1
W = span u1 = 1
, 1 ,
u2 = u3 = −1 .
−1 0 1
1 0 −1
Find the set of all vectors v that are orthogonal to W . Equivalently, determine the orthogonal complement
W ⊥.
Question 2(b)
Find an orthonormal basis for W ⊥ .
Question 3(a)
1 1 1 1
0 0 1 2
Let A = 1 1 −1 and b = 3. Find all least square solutions to Ax = b. Is the least square
−1 0 1 4
1 0 −1 5
solution unique? Why?
u is a least square solution to Ax = b if and only if u is a solution to AT Ax = AT b.
b=[1;2;3;4;5];
Question 3(b)
Use (economic) QR-factorization of A to find the least square solution.
Write A = QR, use u = (AT A)−1 AT b.
Question 3(c)
Use the (economic) QR-factorization of A to find the projection of b onto the column space of A.