Habib University Linear Algebra
Spring 2025 Quiz 1 Solutions
Problem 1: Express the following matrix equation as a system of linear equations:
3 −1 2 x1 2
4 3 7 x2 = −1
−2 1 5 x3 4
Solution
The given matrix equation can be written as a system of linear equations by
interpreting each row of the matrix multiplication:
3x1 − x2 + 2x3 = 2,
4x1 + 3x2 + 7x3 = −1,
−2x1 + x2 + 5x3 = 4.
Thus, the system of linear equations is:
3x1 − x2 + 2x3 = 2,
4x1 + 3x2 + 7x3 = −1,
−2x1 + x2 + 5x3 = 4.
Problem 2: Show that if A is a p × q matrix, and A(BA) is defined, then B is a q × p
matrix.
Solution
Let B be a matrix of order m × n. For BA to be defined, the number of columns
of B must equal the number of rows of A. Thus, we have:
n = p,
which implies that B is a matrix of order m × p.
By the matrix multiplication rule, the order of BA is given by:
number of rows of B × number of columns of A.
This implies that the matrix BA has order m × q.
Now, for A(BA) to be defined, the number of columns of A must equal the number
of rows of BA. This gives:
q = m.
Hence, substituting m = q into the earlier result for B, we conclude that B is a
matrix of order q × p.
1
Habib University Linear Algebra
Spring 2025 Quiz 1 Solutions
Problem 3: Find matrices A, x, and b that express the given system of linear equations
as a single matrix equation Ax = b.
4x1 − 3x3 + x4 = 1,
5x1 + x2 − 8x4 = 3,
2x1 − 5x2 + 9x3 − x4 = 0,
3x2 − x3 + 7x4 = 2.
Solution
The given system of linear equations can be written in the form Ax = b, where:
4 0 −3 1 x1 1
5 1 0 −8 x2 3
A= 2 −5 9 −1 , x = x3 , b = 0 .
0 3 −1 7 x4 2
Thus, the matrix equation representing the system is:
4 0 −3 1 x1 1
5 1 0 −8 x2 3
2 −5 9 −1 x3 = 0 .
0 3 −1 7 x4 2
Problem 4: If A and B are two square matrices of the same size, then find the condition
such that:
(A + B)2 = A2 + B 2 + 2AB.
Solution
To determine the condition, we expand (A + B)2 using matrix multiplication:
(A + B)2 = (A + B)(A + B).
Expanding this:
(A + B)2 = A2 + AB + BA + B 2 .
For (A + B)2 = A2 + B 2 + 2AB to hold, we must have:
AB + BA = 2AB.
Simplifying this equation:
BA = AB.
Thus, the condition is that A and B must commute, i.e., AB = BA.
2
Habib University Linear Algebra
Spring 2025 Quiz 1 Solutions
Problem 5: Let D = diag(d1 , d2 , . . . , dm ), and A is an m × n matrix. By showing
appropriate derivation/working, find the rule for pre-multiplication of A by matrix D.
Solution
The matrix D = diag(d1 , d2 , . . . , dm ) is a diagonal m × m matrix with d1 , d2 , . . . , dm
on the diagonal and zero elsewhere:
d1 0 · · · 0
0 d2 · · · 0
D = .. .. . . . .
. . . ..
0 0 · · · dm
Let A be an m × n matrix:
a11 a12 ··· a1n
a21 a22 ··· a2n
A = .. .. .
.. ..
. . . .
am1 am2 · · · amn
The pre-multiplication DA is given below:
d1 0 ··· 0 a11 a12 · · · a1n
0 d2 · · · 0 a21 a22 · · · a2n
DA = .. .. .
.. . . . . .. ..
. . . .. .. . . .
0 0 · · · dm am1 am2 · · · amn
The result is:
d1 a11 d1 a12 ··· d1 a1n
d2 a21 d2 a22 ··· d2 a2n
DA = .. .
.. ... ..
. . .
dm am1 dm am2 · · · dm amn
Each row i of A is scaled by the corresponding diagonal entry di of D.
3
Habib University Linear Algebra
Spring 2025 Quiz 1 Solutions
Problem 6: Let D = diag(d1 , d2 , . . . , dm ), and A is an n × m matrix. By showing
appropriate derivation/working, find the rule for post-multiplication of A by matrix D.
Solution
The matrix D = diag(d1 , d2 , . . . , dm ) is a diagonal m × m matrix with d1 , d2 , . . . , dm
on the diagonal and zero elsewhere:
d1 0 · · · 0
0 d2 · · · 0
D = .. .. . . . .
. . . ..
0 0 · · · dm
Let A be an n × m matrix:
a11 a12 · · · a1m
a21 a22 · · · a2m
A = .. .. .
.. ..
. . . .
an1 an2 · · · anm
The post-multiplication AD is given below:
a11 a12 · · · a1m d1 0 · · · 0
a21 a22 · · · a2m
0 d2 · · · 0
AD = .. . .
.. .. .. .. .. . .
. . . . . . . ..
an1 an2 · · · anm 0 0 · · · dm
The result is:
a11 d1 a12 d2 · · · a1m dn
a21 d1 a22 d2 · · · a2m dn
AD = .. .. .
.. ...
. . .
an1 d1 an2 d2 · · · anm dn
In general, post-multiplication of A by D scales each column j of A by the
corresponding diagonal entry dj in D.
4
Habib University Linear Algebra
Spring 2025 Quiz 1 Solutions
Problem 7: Suppose that A and B are 6 × 8 matrices, and C is a 3 × 6 matrix. Then,
what is the size of the matrix C(A + B)?
Solution
Since A and B are both 6 × 8 matrices, their sum A + B is also a 6 × 8 matrix.
Matrix multiplication C(A + B) is defined only if the number of columns in C
matches the number of rows in A + B, which holds true in the given case as 6 = 6.
The resulting matrix will have size:
Number of rows from C × Number of columns from A + B = 3 × 8.
Problem 8: Suppose that A and B are 4 × 5 matrices, and C is a 5 × 4 matrix. Then,
what is the size of the matrix C(A + B)?
Solution
Since A and B are both 4 × 5 matrices, their sum A + B is also a 4 × 5 matrix.
Matrix multiplication C(A + B) is defined only if the number of columns in C
matches the number of rows in A + B, which holds true in the given case as 4 = 4.
The resulting matrix will have size:
Number of rows from C × Number of columns from A + B = 5 × 5.
Problem 9: Find the augmented matrix for the following system of linear equations:
x1 − 2x2 + x3 − 4x4 = 1,
x1 + 3x2 + 7x3 + 2x4 = 2,
x1 − 12x2 − 11x3 − 16x4 = 5.
Solution
The given system of linear equations can be written as an augmented matrix by
extracting the coefficients of x1 , x2 , x3 , x4 and placing the constants on the right as
the last column.
The augmented matrix is:
1 −2 1 −4 1
1 3 7 2 2 .
1 −12 −11 −16 5
5
Habib University Linear Algebra
Spring 2025 Quiz 1 Solutions
Problem 10: Show that if AB and BA are both defined, then AB and BA are square
matrices.
Solution
Let A be an m × n matrix and B be an p × q matrix.
For AB to be defined,
the number of columns of A = the number of rows of B
implies p = n.
Similarly, for BA to be defined,
the number of columns of B = the number of rows of A
implies q = m. And hence B must be of size n × m.
The order of product of two matrices is defined as:
the number of rows of left matrix × the number of columns of the right matrix.
Which gives us that AB is a matrix of size m × m and BA is a matrix of size n × n.
Thus, both AB and BA are square matrices.