# Matrix

1,016pages on
this wiki

A matrix is a table (or an array) of objects, such as quantities, arranged in rows and columns.

One can represent an entry in a matrix as $a_{i,j}$ where the subindex $i$ walks the rows and $j$ walks the columns. For example $a_{3,4}$ would be the entry in row 3 and column 4.

Here is an example of a matrix (a $3\times4$ matrix with integer entries):

$\begin{bmatrix}7&341&110&14\\-27&34&0&-19\\20&26&33&25\end{bmatrix}$

Matrices can be formed with other kinds of objects.

Here is an example using polynomials for the entries.

$\begin{bmatrix}x^2-1&11x+20\\x^3&x^4+4x^3+8\end{bmatrix}$

This is a $2\times2$-matrix using polynomials of one variable.

Matrices can also be used to model translations from $\R^n\to\R^m$ .

## Formal definition

Let $m,n\in\N$ .
Let $S$ be a set.
Then a $m\times n$ matrix over $S$ is a mapping $a:[1,m]\times[1,n]\to S$ .

## Matrix operations

Matrix addition and subtraction can only be done on matrices of the same dimensions. Corresponding entries are added (or subtracted).

$\begin{bmatrix}a_{1,1}&a_{1,2}\\a_{2,1}&a_{2,2}\end{bmatrix}+ \begin{bmatrix}b_{1,1}&b_{1,2}\\b_{2,1}&b_{2,2}\end{bmatrix}= \begin{bmatrix}a_{1,1}+b_{1,1}&a_{1,2}+b_{1,2}\\a_{2,1}+b_{2,1}&a_{2,2}+b_{2,2}\end{bmatrix}$

### Ordinary matrix multiplication

The ordinary matrix product is the most often used and the most important way to multiply matrices. It is defined between two matrices only if the width of the first matrix equals the height of the second matrix, and is interpreted as applying the transformation of the first matrix to the second. Multiplying an $m\times n$ matrix with an $n\times p$ matrix results in an $m\times p$ matrix. The ordinary matrix product is associative, but not commutative.

Each entry in the product matrix is the dot product in the associated row of the first matrix and the associated column of the second matrix.

$\begin{bmatrix}a_{1,1}&a_{1,2}&a_{1,3}\\a_{2,1}&a_{2,2}&a_{2,3}\end{bmatrix} \begin{bmatrix}b_{1,1}&b_{1,2}\\b_{2,1}&b_{2,2}\\b_{3,1}&b_{3,2}\end{bmatrix} = \begin{bmatrix} a_{1,1}\cdot b_{1,1}+a_{1,2}\cdot b_{2,1}+a_{1,3}\cdot b_{3,1}&a_{1,1}\cdot b_{1,2}+a_{1,2}\cdot b_{2,2}+a_{1,3}\cdot b_{3,2}\\ a_{2,1}\cdot b_{1,1}+a_{2,2}\cdot b_{2,1}+a_{2,3}\cdot b_{3,1}&a_{2,1}\cdot b_{1,2}+a_{2,2}\cdot b_{2,2}+a_{2,3}\cdot b_{3,2} \end{bmatrix}$

### Scalar matrix multiplication

The scalar matrix product is the result of multiplying a matrix by a scalar. This entails nothing more than multiplying each entry in the matrix by the value of the scalar. For example, letting $r$ be a scalar and $A$ be a matrix,

$\mathbf{A}={\begin{bmatrix}a&b\\c&d\end{bmatrix}}$

$r\mathbf{A}=r{\begin{bmatrix}a&b\\c&d\end{bmatrix}= \begin{bmatrix}r\cdot a&r\cdot b\\r\cdot c&r\cdot d\end{bmatrix}}$

#### Misc

To remove the last row of an $m\times n$ matrix, multiply by the $m\times m$ identity matrix augmented with a $m\times n$ 0 matrix.