08. Other operations

08. Other operations

Matrix addition

In this video, we'll define some further operations you can do to produce new matrices. The first is matrix addition If we have two m -by- n matrices A and B with entries A i j and B i j , we can form a new matrix A + B with ( A + B ) i j = A i j + B i j . In other words, you take the i j th entries of both matrices and add them.

( 1 0 1 1 ) + ( 1 1 0 - 1 ) = ( 2 1 1 0 ) .

Special case: vector addition

This is most useful when A and B are both column vectors, i.e. m -by- 1 matrices. Let's see what it means in for vectors in 𝐑 2 . The formula is ( x y ) + ( a b ) = ( x + a y + b ) .

Geometrically, we add two vectors v = ( x y ) and w = ( a b ) by translating w to the tip of v and drawing the arrow from the tail of v to the tip of w . One can see from the picture that the x - (respectively y -) coordinate of this arrow is the sum of the x - (respectively y -) coordinates of v and w .

Vector addition

Rescaling

Given a number λ and a matrix A , you can form the matrix λ A whose entries are λ times the entries of A .

2 ( 1 2 3 4 ) = ( 2 4 6 8 ) .

Matrix exponentiation

The exponential of a number x is defined by the Taylor series of exp : exp ( x ) = 1 + x + x 2 2 ! + x 3 3 ! + = n = 0 x n n ! We can use the same definition to define the exponential of a matrix: exp ( M ) = n = 0 1 n ! M n . Here, M 0 is understood to mean the identity matrix I (the analogue for matrices of the number 1 ).

Consider M = ( 0 1 0 0 ) . Since M 2 = 0 , all the higher powers of M vanish (the name for this is nilpotence: some power of M is zero), so the matrix exponential becomes exp ( M ) = I + M = ( 1 1 0 1 ) . So we get the matrix for a shear as the exponential of a nilpotent matrix.

In fact, exp ( 0 t 0 0 ) = ( 1 t 0 1 ) , so we get a whole family of matrices which shear further and further to the right as t varies.

Take M = ( 0 - t t 0 ) . We have M = t ( 0 - 1 1 0 ) M 2 = ( - t 2 0 0 - t 2 ) = - t 2 I M 3 = - t 3 ( 0 - 1 1 0 ) M 4 = t 4 I etc.

and in the end we get exp ( M ) = I + t ( 0 - 1 1 0 ) - t 2 2 ! I - t 3 3 ! ( 0 - 1 1 0 ) + t 4 4 ! I + t 5 5 ! ( 0 - 1 1 0 ) etc. The coefficient of I is the Taylor series for cos t ; the coefficent of ( 0 - 1 1 0 ) is the Taylor series for sin t , so overall we get exp ( M ) = ( cos t - sin t sin t cos t ) . So we get a general rotation matrix in 2-d by exponentiating this very simple matrix.