Linear Algebra/Matrix operations

From Wikibooks, open books for an open world
< Linear Algebra
Jump to: navigation, search
Algebra

Addition of Matrices[edit]

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 A is added to a matrix B and the resultant matrix is C, then c_{ij} = a_{ij} + b_{ij}.


\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[edit]

Matrix multiplication diagram.PNG

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 n \times m, then the second matrix must be m \times p. The resulting matrix will have a dimension of 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 C=AB, then c_{ij} = \sum_{k = 1}^na_{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[edit]

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:

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

Determinant[edit]

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

Inverse Matrix[edit]

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

XX^{-1} = X^{-1}X = I

Where I is the identity matrix.