# Linear Algebra/Matrix operations

Exercise 2c ka question no.3 edition 2018

Two matrices can be added together only if they have the same dimensions (the same number of rows and columns). The resultant matrix is simply the matrix whose elements are the sum of the elements in the two matrices that were added together. If a matrix ${\displaystyle A}$  is added to a matrix ${\displaystyle B}$  and the resultant matrix is ${\displaystyle C}$ , then ${\displaystyle c_{ij}=a_{ij}+b_{ij}}$ .

${\displaystyle {\begin{pmatrix}5&1&7\\3&9&4\\0&-2&6\end{pmatrix}}+{\begin{pmatrix}3&2&4\\7&1&-3\\4&5&6\end{pmatrix}}={\begin{pmatrix}8&3&11\\10&10&1\\4&3&12\end{pmatrix}}}$

## Multiplication of Matrices

Two matrices may be multiplied together only if the number of columns in the first matrix is equal to the rows in the second matrix. That is, if the first matrix is ${\displaystyle n\times m}$ , then the second matrix must be ${\displaystyle m\times p}$ . The resulting matrix will have a dimension of ${\displaystyle n\times p}$ , where each element is the sum of the products of the entries in a row of the first matrix with the entries of the corresponding column in the second matrix. If ${\displaystyle C=AB}$ , then ${\displaystyle c_{ij}=\sum _{k=1}^{n}a_{ik}b_{kj}}$ .

Although matrix multiplication is not commutative, it is associative, which means that (AB)C=A(BC). Since matrix multiplication is not commutative, the order of the factors must be specified. AB would be read as "A post-multiplied by B" or "B premultiplied by A." Matrix multiplication obeys the distributive property, so A(B+C)=AB+AC. Also, two nonzero matrices do not necessarily have a nonzero product.

There is no such thing as "Matrix Division". To divide out a matrix, you need first to obtain the inverse of the matrix, and then multiply by the inverse. We discuss inverses below.

## Transpose

To obtain the transpose of a matrix, we swap the rows and the columns of that matrix. If we have a matrix X, the transpose is denoted XT. For example:

${\displaystyle X={\begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix}}}$
${\displaystyle X^{T}={\begin{bmatrix}1&4&7\\2&5&8\\3&6&9\end{bmatrix}}}$

## Determinant

The determinant of a matrix, X is denoted by |X|.

## Inverse Matrix

If the matrix has a non-zero determinant, the matrix is said to be invertable. Inverse matrices follow the given formula:

${\displaystyle XX^{-1}=X^{-1}X=I}$

Where I is the identity matrix.