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 Aij and Bij , we can form a new matrix A+B with (A+B)ij=Aij+Bij.

In other words, you take the ij th entries of both matrices and add them.

(1011)+(110-1)=(2110).

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 (xy)+(ab)=(x+ay+b).

Geometrically, we add two vectors v=(xy) and w=(ab) 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(1234)=(2468) .

Matrix exponentiation

The exponential of a number x is defined by the Taylor series of exp : exp(x)=1+x+x22!+x33!+=n=0xnn!

We can use the same definition to define the exponential of a matrix: exp(M)=n=01n!Mn.
Here, M0 is understood to mean the identity matrix I (the analogue for matrices of the number 1 ).

Consider M=(0100) . Since M2=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=(1101).

So we get the matrix for a shear as the exponential of a nilpotent matrix.

In fact, exp(0t00)=(1t01),

so we get a whole family of matrices which shear further and further to the right as t varies.

Take M=(0-tt0) . We have M=t(0-110)

M2=(-t200-t2)=-t2I
M3=-t3(0-110)
M4=t4I
etc.

and in the end we get exp(M)=I+t(0-110)

-t22!I-t33!(0-110)
+t44!I+t55!(0-110)
etc. The coefficient of I is the Taylor series for cost ; the coefficent of (0-110) is the Taylor series for sint , so overall we get exp(M)=(cost-sintsintcost).
So we get a general rotation matrix in 2-d by exponentiating this very simple matrix.