MATH 240

Fri. September 20th, 2019


Matrix Operations

Addition

Matrices of the same dimentions can be added together element-wise.

Scaling

Multiplying a matrix by a scalar multiplies every element of the matrix by that scalar.

Multiplication

For two matrices A,BA,B, for ABAB to be defined, the number of columns in AA must be the same as the number of rows in BB.

If AA is m×nm\times n and BB is n×pn\times p, then ABAB will be m×pm\times p.

If you lay the iith row of AA over the jjth column of BB, multiply element-wise, and add the results together, you get element i,ji,j of ABAB.

Ex.
A=(2315)B=(436123)AB=(2(4)+3(1)2(3)+3(2)2(6)+3(3)1(4)+(5)(1)1(3)+(5)(2)1(6)+(5)(3))=(110211139)\begin{aligned} A&=\begin{pmatrix} 2&3\\1&-5 \end{pmatrix}\\ B&=\begin{pmatrix} 4&3&6\\1&-2&3 \end{pmatrix}\\ \\ AB&=\begin{pmatrix} 2(4)+3(1)&2(3)+3(-2)&2(6)+3(3)\\ 1(4)+(-5)(1)&1(3)+(-5)(-2)&1(6)+(-5)(3) \end{pmatrix}\\ &=\begin{pmatrix} 11&0&21\\-1&13&-9 \end{pmatrix} \end{aligned}

Transpose

For a matrix AA, its transpose ATA^T is the matrix whose columns are the rows of AA.

Ex.
A=(abcd)AT=(acbd)\begin{aligned} A&=\begin{pmatrix} a&b\\c&d \end{pmatrix}\\ A^T&=\begin{pmatrix} a&c\\b&d \end{pmatrix} \end{aligned}

Properties of Matrix Operations

If A,B,CA,B,C are matrices, r,sr,s are scalars, and ImI_m is an identity matrix:
A+B=B+A(A+B)+C=A+(B+C)A+0=Ar(A+B)=rA+rB(r+s)A=rA+sA(rs)A=r(sA)A(BC)=(AB)CA(B+C)=AB+AC(B+C)A=BA+CAr(AB)=(rA)B=A(rB)ImA=A=AIm(AT)T=A(A+B)T=AT+BT(AB)T=BTAT.\begin{aligned} A+B&=B+A\\ (A+B)+C&=A+(B+C)\\ A+0&=A\\ r(A+B)&=rA+rB\\ (r+s)A&=rA+sA\\ (rs)A&=r(sA)\\ \\ A(BC)&=(AB)C\\ A(B+C)&=AB+AC\\ (B+C)A&=BA+CA\\ r(AB)&=(rA)B=A(rB)\\ I_mA&=A=AI_m\\ \\ (A^T)^T&=A\\ (A+B)^T&=A^T+B^T\\ (AB)^T&=B^TA^T. \end{aligned}

Note that AB=BAAB=BA is not necessarily true! (Matrix multiplication is not commutative.)

Identity Matrices

An identity matrix ImI_m is a m×mm\times m matrix with 11s along the diagonal and 00s everywhere else.

Ex.
I4=(1000010000100001)I_4=\begin{pmatrix} 1&0&0&0\\0&1&0&0\\0&0&1&0\\0&0&0&1 \end{pmatrix}

This acts as an analogue to 11 for matrices – it is the multiplicative identity.