0% found this document useful (0 votes)
9 views

assignment+1+solutions

The document provides solutions to a linear algebra assignment focusing on matrix inverses, change of basis, eigenvalues, and eigenvectors. It includes calculations for the inverse of a matrix, determining component vectors relative to a new basis, and finding eigenvalues and eigenvectors for a given matrix. Additionally, it discusses the conditions for invertibility and diagonalizability of matrices and their eigenvector matrices.

Uploaded by

mokshguptacod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

assignment+1+solutions

The document provides solutions to a linear algebra assignment focusing on matrix inverses, change of basis, eigenvalues, and eigenvectors. It includes calculations for the inverse of a matrix, determining component vectors relative to a new basis, and finding eigenvalues and eigenvectors for a given matrix. Additionally, it discusses the conditions for invertibility and diagonalizability of matrices and their eigenvector matrices.

Uploaded by

mokshguptacod
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Linear Algebra for Machine Learning

Assignment solution
September 13, 2022

1 Matrix inverse
1. Find inverse of the 
matrix.
1 0 1 2
−1 1 2 0
A= −2 0 1 2

0 0 0 1
 
1 0 −1 0
1 −3 3 −3 12 
A−1 =  
3  2 0 1 −6
0 0 0 3
Python code
mat_A = np.array([[1, 0, 1, 2], [-1, 1, 2, 0], [-2, 0, 1, 2], [0, 0, 0, 1]])
A_inverse = np.linalg.inv(mat_A)
print(A_inverse)

2 Change of basis
1. Determine the component vector of the vector V = (1, 7, 7) in R2 relative
to the desired Basis B = {(1, −6, 3), (0, 5, −1), (3, −1, −1)}.
          
1 1 0 3 1 0 3 a
V = 7 = a −6 + b  5  + c −1 = −6 5 −1  b 
7 3 −1 −1 3 −1 −1 c
   −1    
a 1 0 3 1 4
 b  = −6 5 −1 7 =  6 
c 3 −1 −1 7 −1

3 Eigenvectors and eigenvalues


1. 
Find eigenvalues
 and linearly independent eigenvectors for the matrix A =
4 −3 −3
 3 −2 −3. Using the eigenvectors, diagonalize the matrix A.
−1 1 2

1
The characteristic polynomial: det(A − tI) = −(t − 1)2 (t − 2).
The eigenvalues are λ = 1 with multiplicity 2. and λ = 2 with multiplicity
1.
Eigenvectors
 for
 λ = 1 can be
 found
 by
 finding
 the null space of A − I =
3 −3 −3 1 1
 3 −3 −3 which are: 1 and 0
−1 1 1 0 1
Eigenvector
 forλ = 2 can be  by finding the null space of A − 2I =
 found
2 −3 −3 −3
 3 −4 −3 which is: −3
−1 1 0 1
These eignevectors are linearly independent.
We construct matrix S by using the eigenvectors as columns.
 
1 1 −3
S = 1 0 −3
0 1 1
The diagonal matrix is constructed using eignevalues as diagonal entries
 
1 0 0
D = 0 1 0
0 0 2
The matrix is diagonalized as: A = SDS −1 .
2. For a matrix A of size n × n you are told that all its n eigen vectors are
independent. Let S denote the matrix whose columns are the n eigen
vectors of A.
(a) Is A Invertible?
(b) Is A Diagonalizable?
(c) Is S Invertible?
(d) Is S Diagonalizable?
Your answer can be “yes”,“no” or “depends”. For each one, give argu-
ments and/or examples to support your answer.
 
1 0
(a) Is A Invertible? Depends. A = has eigen vectors [1,0] and
0 0
[0,1] but is not invertible.
 
1 0
A= has eigen vectors [1,0] and [0,1] and is invertible since
0 2
det(A) = 2.
(b) Is A Diagonalizable?
Yes, indeed we can write:

2
AS = [λ1 S1 , λ2 S2 , . . . , λn SN ]
AS = SΛ
−1
S AS = Λ

Thus, by definition A is diagonalizable.


(c) Is S Invertible? Yes. Because the columns of S are linearly indepen-
dent.
(d) Is S Diagonalizable? Depends. Same as previous question.

You might also like