HW 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

MS-A0011 – Matrix Algebra Problem set 1

2024–2025 (Period II)


Milo Orlich – Nataliia Kushnerchuk Deadline: Sun 27.10.2024 at 23:59

Submit on MyCourses your solutions to Homework 1 and 2 by Sunday, October 27.

Warm-ups
Work on Warm-up 1–4 during the exercise sessions of Week 1. You do not need to submit
solutions to these problems.

Warm-up 1. Perform the following operations involving vectors, if they are defined:
! ! ! ! ! !
2 −1 2 −1 2 −1
a. + b. · c. ×
3 −5 3 −5 3 −5
!  −1  !  −1  !  −1 
2   2   2  
d. +  −5  e. ·  −5  f. ×  −5 
3 3  3
0 0 0
    
           
 2   −1   2   −1   2   −1 
g.  3  +  −5  h.  3  ·  −5  i. 3  ×  −5 
           

1 0 1 0 1 0
           
           
 −1   2   −1   2   −1   2 
j.  −5  +  3  k.  −5  ·  3  ℓ, −5  ×  3 
           

0 1 0 1 0 1
           
! ! !
−1 −1 −1
m. 4+ n. 4 · o. 4
−5 −5 −5
" ! !# ! ! " ! !# ! ! !
−1 2 1 −1 2 1 −1 2 1
p. + · q. + · r. · · .
−5 3 1 −5 3 1 −5 3 1

Warm-up 2. The definition of scalar product we saw for vectors u = uu12 and v = vv12 is
 

u · v = u1 v1 + u2 v2 . Instead, in physics it is common to define u · v = cos(α)|u||v|, where α is


the angle between u and v:

Draw reference axes so that the vectors u and v shoot from the origin. Orient the axes
so that the vector u lies√on the horizontal axis, namely it is of the form u = (u, 0). Note
in particular that |u| = u 2 = |u|. (The first vertical bars give the length of a vector, the
second ones the absolute value of a real number.) Check that the result of “our” definition
of u · v and the one “from physics” are the same.

1
Warm-up 3. Perform the following operations, if they are defined:
! ! ! ! !−1
1 2 3 4 1 3 1 2
a. + e. i.
3 4 −1 0 2 4 0 3

!  1 2   ! !−1
1 2   1   2 3
b. +  3 4  f. 3 4 j.
3 4 2 0 4
−1 0
 
!  1 2  ! " ! !#−1
1 2     1 1 2 2 3
c.  3 4  g. 3 4 k.
3 4  2 0 3 0 4
−1 0

     
 1 2  1 2 !    x1   x1   
d.  3 4  h. x1 x2 x3  x2  ℓ.  x2  x1 x2 x3 .
     
 3 4
−1 0 x3 x3
    

   
 1 2 3   1 0 0 
Warm-up 4. (a) Consider the matrix A =  4 5 6 . Recall that I3 =  0 1 0  is
   
7 8 9 0 0 1
   
called the identity matrix, because for any B ∈ R3×3 , one has BI3 = I3 B = B. The
following matrices look similar to I3 :
       
 1 0 0   0 1 0   0 0 1   0 1 0 
P1 =  0 0 1  , P2 =  1 0 0  , P3 =  0 1 0  , P4 =  0 0 1  .
       
0 1 0 0 0 1 1 0 0 1 0 0
       

Compute the products APi and Pi A for all i = 1, . . . , 4. Based on this, figure out what
the matrices P1 , . . . , P4 do to a general matrix in R3×3 when you multiply on the left
and on the right. (Their function is very similar to that of the matrices we will see in
Gaussian elimination, but they are not the same!)
(b) Now let A be a general matrix in Rn×m , and let B ∈ Rm×ℓ . Call r1 , . . . , rn the rows of A,
and call c1 , . . . , cℓ the columns of B. Express the entries of the matrix product AB in
terms of the c’s and the r’s.

Homework
Submit on MyCourses your solutions only for the following two problems. Explain the
reasoning behind your solutions, do not just return the final result. If you make use of
important results from the lectures, state them explicitly.
Homework 1. For the expressions in (a) and (b), determine all the operations involved
(sum of matrices, transposition, dot product, etc). Also, for each operation, describe the
imput and output sets as in the example.
(ex.) Let A ∈ Rn×m , B ∈ Rm×ℓ and C ∈ Rℓ×n . In the expression (AB)T + C there are three
operations: multiplication of matrices, which is a function Rn×m × Rm×ℓ → Rn×ℓ ,
transposition of matrices Rn×ℓ → Rℓ×n , and sum of matrices Rℓ×n × Rℓ×n → Rℓ×n .
(a) Let u and v be vectors in Rn . Determine explicitly, as in the example above, all the
operations involved in the expression |((u + v) · u)v|.
(b) Let u ∈ Rn , v ∈ Rm and A ∈ Rn×m . Determine explicitly all the operations involved in
the expression (|Av + u| + 17)(uT A). [2 points]

2
Homework 2. The following picture is a map of roads connecting cities C1 , . . . , C6 .

C6

C1 C5

C7

C2 C4

C3

By “road” here we mean each one of the single straight lines between two cities. For
instance, there are two roads leaving (or equivalently, arriving at) city C1 . And there are
four roads leaving C2 . There are ten roads in total. Consider now the following matrix:
 
 0 1 0 0 0 1 0 
 1 0 1 0 0 1 1 
 
 
 0 1 0 1 0 0 0 
 
A =  0 0 1 0 1 0 1  ,
 0 0 0 1 0 1 1 
 
 
 1 1 0 0 1 0 0 
 
0 1 0 1 1 0 0

which is defined by setting



1 if there is a road between Ci and Cj


ai,j =
0 otherwise.

(a) Find a vector v that satisfies the following: the i-th entry of the vector Av is the
number of roads leaving city Ci .

(b) By a “route of length 2” we mean a sequence of two connected roads. For instance,
from C2 to C4 there are two possible routes of length 2: the one that goes through C3 ,
and the one that goes through C7 . Similarly, there are two possible routes of length
3 connecting C3 to C6 : the one through C2 and C1 , and the one through C4 and C5 .
Compute the powers A2 and A3 . Describe what the entries of A2 and A3 mean, in
terms of routes between cities. (You do not need to prove that your description is
correct.)

[2 points]

Extra problem (optional)


The following problem will NOT be discussed during the exercise sessions and is NOT for homework. You
can solve it if you feel like it.

Extra problem. Let A, B and C be matrices of sizes ℓ × m, m × n and n × p. How many multiplications are
required to compute the product AB? In which order should the triple product ABC be computed, so as to
minimize the number of multiplications required?

You might also like