You are on page 1of 4

Degree in Data Science and Engineering

Group 96/196
Linear algebra. Test 2. December 9, 2020
INSTRUCTIONS:
• Write now your surname followed by your first name below using capitals. Every paper
on your table, written or not, must have your name and surname on it.
• Exams are official documents so you must use a pen. Anything written in pencil will not
be marked.
• You will be asked to hand in your exam at once if it comes into other student’s sight.
• The use of notes, books, calculators or mobile phones is not allowed at any point.

1. Determine if the following statements are true or false. Justify your answer.
(a) Let A be a n × n real matrix such that AA> = I. The determinant of A can only
take two values. (0.5)
(b) Let B be a n × n real matrix. Each eigenvalue of B is also an eigenvalue of B 2 . (0.5)
(c) Let C be a 7 × 5 real matrix. The largest possible rank of C is 7. (0.5)
(d) Let v1 , v2 and u be three vectors in Rn such that v1 and v2 are orthogonal to u. The
vector v = 15 v1 − 54 v2 is also orthogonal to u. (0.5)

Solution:
a) True. Using the properties of the determinants we have that det(AAT ) = det(A)
det(AT ) = (det(A))2 = det(I) = 1. So, det(A) can only take values 1 and -1.
b) False. We consider λ an eigenvalue of B, so Bx = λx for some x 6= 0. Multiplying
on both sides of the equation by B, then B(Bx) = B 2 x = B(λx) = λ(Bx) = λ2 x. As
B 2 x = λ2 x with x 6= 0, we can deduce that λ2 is an eigenvalue of B 2 .
c) False. The rank corresponds to the number of linearly independent columns of a
matrix. As C is a 7 × 5 matrix it satisfies rank(C) ≤ 5, so its largest possible rank is
5.
d) True. The vectors u and v are orthogonal if u · v = 0. As v = 15 v1 − 54 v2 and v1
and v2 are orthogonal to u, we have that u·v = u·(15 v1 −54 v2 ) = 15 u·v1 −54 u·v2 = 0.
Then, the vectors u and v are orthogonal.

 
1 2 1 0
2. Consider the matrix A =  0 1 1 1 .
1 1 0 −1
(a) Find a basis for Col(A). What is the dimension of Col(A)? (1)
(b) Find a basis for Nul(A). What is the dimension of Nul(A)? (1)
(c) Find the coordinates of the vector x = (−1, 1, −2)T in the basis found for Col(A). (0.5)
Solution:
a) The column space of the matrix A is the set of all linear combinations of the
columns of A. To find a basis for Col(A) we have to calculate the echelon form of the
matrix and select the pivot columns of A.
   
1 2 1 0 1 2 1 0
A= 0 1 1 1 ∼ 0 1 1 1 
1 1 0 −1 0 0 0 0

The echelon
 form of A has
a pivot in the first and second columns. A basis for Col(A)
 1 2 
is B =  0  , 1  . The dimension of Col(A) is 2.

 1 1 
b) The null space of the matrix A is the set of all solutions of the homogeneous
equation Ax = 0. To find a basis for Nul(A) we have to find the parametric solution
for the system and select the director vectors.
   
 1 2 1 0 0 1 2 1 0 0
A 0 = 0 1 1 1 0 ∼ 0 1 1 1 0 
1 1 0 −1 0 0 0 0 0 0

The solution of the system hastwo free


 variables
 (x3 and x4 ), so it can be written
1 2
 −1   −1 
in parametric form as x = x3   1  + x4  0 . Then, a basis for Nul(A) is
  
0 1
   

 1 2 

−1 −1
    
B=    ,   . The dimension of Nul(A) is 2.

 1   0  
 0 1 

We can check that the rank theorem is satisfied: dim Nul(A) + dim Col(A) = number
of columns of A.
c) The vector 
x can be
 writtenas linear
 combination
  of the vectors that form a basis
−1 1 2
for Col(A) as  1  = −3  0  + 1  1 . These two coefficients are unique.
−2 1 1
 
−3
Then, the coordinates of the vector are [x]B = .
1

 
−3 −2 −2
3. Consider the matrix A =  2 1 2 .
2 2 1
(a) Find the characteristic polynomial associated to the matrix A. (0.75)
(b) Find the eigenvalues of A. What is its algebraic multiplicity? (0.75)
(c) Find the eigenvectors of A. (1)
(d) Find matrices P invertible and D diagonal such that A = P DP −1 (do not compute
P −1 ). (0.5)
Solution:
a) The characteristic polynomial is defined as p(λ) = det(A − λI). Then
 
−3 − λ −2 −2
p(λ) = det  2 1−λ 2  = −λ3 − λ2 + λ + 1 = −(λ + 1)2 (λ − 1)
2 2 1−λ
b) The eigenvalues of A correspond to the roots of the characteristic polynomial.
Then, the eigenvalues are λ1 = −1, with algebraic multiplicity 2, and λ2 = 1, with
algebraic multiplicity 1.
c) The eigenvectors of A associated to the eigenvalue λ are the vectors that span the
subspace Nul(A − λI).
λ = −1:    
 −2 −2 −2 0 1 1 1 0
A+I 0 = 2 2 2 0 ∼ 0 0 0 0 
2 2 2 0 0 0 0 0
The solution of the system 
has twofree variables
 (x2 and x3 ), so it can 
be written
 in
−1 −1 −1
parametric form as x = x2  1  + x3  0 . Then, the vectors  1  and
0 1 0
 
−1
 0  are eigenvectors of A associated to λ1 = −1.
1
λ = 1:    
 −4 −2 −2 0 2 1 1 0
A−I 0 = 2 0 2 0  ∼  0 −1 1 0 
2 2 0 0 0 0 0 0
The solution of 
the system
 has one free variable
 (x3
), so it can be written in parametric
−1 −1
form as x = x3  1  . Then, the vector  1  is an eigenvector of A associated
1 1
to λ2 = 1.
d) The values in the diagonal of the matrix D correspond to the eigenvalues of A and
the columns of P correspond to the eigenvectors associated to each
 eigenvalue,but it
−1 0 0
is important to consider the order. Then, one option is D =  0 −1 0  and
0 0 1
 
−1 −1 −1
P = 1 0 1 . It can be easily shown that A = P DP −1 .
0 1 1

  

 λ + 2µ 

2λ − µ
  
4. Consider the set W =   : λ, µ ∈ R


 −λ +µ  

 λ+µ 

(a) Show that W is a subspace of R4 . (1)


(b) Find a basis for W . What is the dimension of W ? (0.5)
(c) Is the basis found in the previous section orthogonal? If yes, find an orthonormal
basis for W . (0.5)
(d) Does the vector x = (1, −1, 0, 1)T ∈ W ⊥ ? (0.5)

Solution:
a) To show that W is a subspace of R4 we have to check that it satisfies these three
properties:
1) The zero vector of R4 is in W.
It is obvious that the vector (0, 0, 0, 0)T ∈ W when λ = 0 and µ = 0.
2) For each vectors u, v ∈ W , the sum u + v ∈ W .
   0 
λ + 2µ λ + 2µ0
 2λ − µ  0 0 
, v =  2λ 0 − µ 0  with λ, µ, λ0 , µ0 ∈ R.

We consider the vectors u =   −λ + µ   −λ + µ 
λ+µ λ0 + µ0
 
(λ + λ0 ) + 2(µ + µ0 )
 2(λ + λ0 ) − (µ + µ0 ) 
Both vectors are in W . The sum u + v =   −(λ + λ0 ) + (µ + µ0 )  is also in W .

(λ + λ0 ) + (µ + µ0 )
3) For each u ∈ W and α ∈ R, the product αu ∈ W .
 
λ + 2µ
 2λ − µ 
 −λ + µ  and a scalar α ∈ R. The product αu =
We consider the vector u =  
λ+µ
 
λ + 2µ
 2λ − µ 
α −λ + µ  is in W .

λ+µ
     

 1 2 

 
2   −1  
b) The set W can be written as W = λ    + µ
  : λ, µ ∈ R , from

 −1  1  

 1 1 
   

 1 2 

2 −1
    
where we can deduce that W = span    ,   . Furthermore, these two

 −1   1  
 1 1 
vectors are linearly independent, so they form a basis for W . The dimension of the
subspace is 2.
   

 1 2 


2   −1 
c) The basis B =    ,   found in the previous section is an orthog-

 −1   1  
 1 1 
onal basis because b1 · b2 = 0. So, to find an orthonormal basis
 for W
 we only
 needto

 1 2 

 1   1  −1 
2
find unitary vectors in the directions of b1 and b2 . B̂ = √  , √  
−1 7  1 
 7
  
 
1 1 
is an orthonormal basis for W .
d) A vector x is in the orthogonal complement W ⊥ if x is orthogonal to every vector
in a set that spans the subspace. So, it is enough to check if the vector x is orthogonal
to b1 = (1, 2, −1, 1)T and b2 = (2, −1, 1, 1)T . We have that b1 · x = 0 but b2 · x 6= 0.
Therefore, x ∈ / W ⊥.

You might also like