Week 5
Week 5
1. (1 point) Consider two non-zero vectors x ∈ C and y ∈ C. Suppose the inner product
between x and y obeys commutative property (i.e., x · y = y · x), it implies that
A. y must be a conjugate transpose of x
B. y is equal to x
C. y must be orthogonal to x
D. y must be a scalar (possibly complex) multiple of x
Explanation: Let us look at each option and see what makes the commutative property
hold.
Option A.
Assuming y = x∗
x· y = x∗ y = x∗ x∗
This multiplication is not defined, so option A is incorrect.
Option B.
Assuming y = x
x· y = y· x
This is trivially true, so option B is correct.
Option C.
Assuming x∗ y = 0
x· y = x∗ y = 0 = y ∗ x = y· x
So, option C is correct.
Option D.
Assuming y = zx where z ∈ C
2. (1 point) The inner product of two distinct vectors x and y that are drawn randomly
from C100 is 0.8 − 0.37i.The vector x is scaled by a scalar 1 − 2i to obtain a new vector
z, then the inner product between z and y is
Course: Machine Learning - Foundations Page 2 of 8
A. 0.06 − 1.97i
B. 1.54 − 1.23i
C. 1.54 + 1.23i
D. 0.8 − 0.37i
E. Not possible to calculate
Explanation: From the question, it is given that x∗ y = 0.8 − 0.37i. Let us replace x
with (1 − 2i)x and compute -
∴ Option C is correct.
3. (1 point)
Select
the correct statement(s).The Eigen-value decomposition for the matrix
0 −1
A=
1 0
A. doesn’t exist over R but exists over C
B. doesn’t exist over C but exists over R
C. neither exists over R nor exists over C
D. exists over both C and R
Here, we can see that the eigenvalues are complex. So, the decomposition doesn’t exist
over R but since there are two distinct eigenvalues, the decomposition will exist over C.
∴ Option A is correct.
1 1 + i −2 − 2i
4. (1 point) Consider the complex matrix S = 1 − i 1 −i . The matrix is
−2 + 2i i 1
A. Hermitian and Symmetric
B. Symmetric but not Hermitian
C. Neither Hermitian nor Symmetric
D. Hermitian but not Symmetric
Explanation: For this question, we can check both conditions. We can see that here
S T ̸= S, so S is not symmetric. But taking the complex conjugate transpose, S ∗ = S,
so S is hermitian.
Course: Machine Learning - Foundations Page 3 of 8
∴ Option D is correct.
Explanation: The requirement for a matrix U to be unitary is that it’s columns must
be pairwise orthogonal and of unit length.
Here, if we consider the diagonal matrix D = 2I, say. Then multiplying D with U will
cause all the columns to double, which in turn will change the length of the columns.
So, the resultant matrix will not be unitary.
∴ Option B is correct.
3 2 − i −3i
6. (3 points) The eigenvectors of matrix A = 2 + i 0 1 − i are
3i 1 + i 0
−1 1 − 21i 1 + 3i
A. 1 + 2i , 6 − 9i , −2 − i
1 13 5
1 1 − 21i 1 + 3i
B. 1 − 2i, 6 − 9i , −2 − i
1 13 5
−1 1 − 21i 1 + 3i
C. 1 − 2i, 6 − 9i , −2 − i
−1 13 5
−1 1 − 21i 1 − 3i
D. 1 + 2i, 6 − 9i , 2 − i
1 13 −5
Explanation: To solve this question, we can use trial and error from the options and
see which one of them is an eigenvector.
3 2 − i −3i −1 −1
2 + i 0 1 − i 1 + 2i = −1 1 + 2i
3i 1 + i 0 1 1
Course: Machine Learning - Foundations Page 4 of 8
3 2 − i −3i 1 − 21i 1 − 21i
2 + i 0 1 − i 6 − 9i = 6 6 − 9i
3i 1 + i 0 13 13
3 2 − i −3i 1 + 3i 1 + 3i
2 + i 0 1 − i −2 − i = −2 −2 − i
3i 1 + i 0 5 5
So, all the vectors from option A are eigenvectors as upon multiplication with the matrix
A, the vectors get scaled.
∴ Option A is correct.
√
1 k + i √2
7. (1 point) A matrix A = 2
is unitary if k is
k−i 2i
1
A. 2
B. 1
C. - 12
D. -1
E. ±1
F. ± 12
Explanation: To solve this question, we will use the fact that, for a unitary matrix A,
its columns must be pairwise orthogonal. That is we need,
0 = < a1 , a2 >
= a∗1 a2
√
1 1
= k−i k+i √2
2 2 2i
1 √
√ √ √
= 2k − 2i + 2ki − 2
4√ √ √ √
( 2k − 2) + i( 2k − 2)
=
4
√ √
So, we have, 2k − 2 = 0 =⇒ k = 1
∴ Option B is correct.
1 1+i
8. (3 points) A matrix A = can be written as A = U DU ∗ , where U is a
1−i 1
unitary matrix and D is a diagonal matrix. Then, U and D, respectively, are
Course: Machine Learning - Foundations Page 5 of 8
√ √
1√+ i 2 1+ 2 0√
A. U = ,D=
2 1−i 0 1− 2
√ √
−1 √ +i 2 1+ 2 0√
B. U = ,D=
2 −1 − i 0 1− 2
√ √
1√+ i 2 −1 + 2 0√
C. U = ,D=
2 1−i 0 1− 2
√ √
1 − i 2 1 + 2 0√
D. U = √ ,D=
−2 1 − i 0 1− 2
1−λ 1+i √ √
c(λ) = |A − λI| = = (1 − λ)2 − 2 = λ2 − 2λ − 1 =⇒ λ = 1 + 2, 1 − 2
1−i 1−λ
√
√ √
1+ 2 0√
So, the eigenvalues are 1 + 2 and 1 − 2 =⇒ D =
0 1− 2
Let the eigenvectors be v1 and v2 . Then,
√ −1 − i
√
− 2 1+ 1
Eλ=1+√2 = null √i = null √2
1−i − 2 1−i − 2
−1 − i
1 √ 1 + i
= null 2 =⇒ v1 = √2
0 0
√ 1+i
√
2 1√+ i 1
Eλ=1−√2 = null = null √ 2
1−i 2 1−i 2
1 + i
1 √
−1
√ − i
= null 2 =⇒ v2 =
2
0 0
1+i −1 − i
2 2
Converting v1 and v2 to unit vectors and putting them in a matrix we get U =
1
.
1
√ √
2 2
∴ Option A is correct.
Course: Machine Learning - Foundations Page 6 of 8
0 −1
9. (2 points) The matrix Z = has
1 0
A. only real eigenvalues.
B. one real and one complex eigenvalue.
C. no real eigenvalues.
−λ −1
|Z − λI| = = λ2 + 1 =⇒ λ = ±i
1 −λ
∴ Option C is correct.
10. (1 point) (Multiple select) Which of the following matrices is/are unitary?
cos θ − sin θ
A.
sin θ − cos θ
cos θ sin θ
B.
sin θ cos θ
− cos θ sin θ
C.
sin θ cos θ
cos θ sin θ
D.
− sin θ cos θ
− cos θ sin θ
E.
sin θ − cos θ
Explanation: The conditions for a particular matrix A to be unitary is that the columns
need to be of unit length and pairwise orthogonal.
We can see here that due to the property sin2 θ + cos2 θ = 1, all matrices here sat-
isfy the first condition.
For the second condition, we need the inner product of the columns to come out to 0.
This will only be true for options C and D.
1. U V is unitary.
2. U + V is unitary.
Course: Machine Learning - Foundations Page 7 of 8
Explanation: The conditions for a particular matrix A to be unitary is that the columns
need to be of unit length and pairwise orthogonal. These conditions are captured in the
property that for a unitary matrix U , U ∗ = U −1 . For the first statement, we have
(U V )∗ = V ∗ U ∗ = V −1 U −1 = (U V )−1
This shows that U V is a unitary matrix. However the same cannot be said for statement
2 because of the fact that U −1 + V −1 ̸= (U + V )−1
∴ Option D is correct.
Explanation: For this question, we can simply multiply the vectors in each of the op-
tions to the matrix A. If this multiplication has an effect of scaling the vectors, that
implies it is an eigenvector.
Option A.
1 1 + i −1 − i 0
=
1−i 2 1 0
This is an eigenvalue of 0, so option A is correct.
Option B.
Course: Machine Learning - Foundations Page 8 of 8
Option C.
"1 + i# "
1+i
#
1 1+i
2 =3 2
1−i 2 1 1
This is an eigenvalue of 3, so option C is correct.
Option D.
This vector is simply a multiple of the vector in option C, so it is also an eigenvector.