# 3.1 Matrix definitions

We begin with a lot of definitions.

###### Definition 3.1.1.
• A $m\times n$ matrix is a rectangular grid of numbers with $m$ rows and $n$ columns.

• A square matrix is one which is $n\times n$ for some $n$.

• A (height $m$) column vector is an $m\times 1$ matrix.

• A (width $n$) row vector is a $1\times n$ matrix.

• $\mathbb{R}^{n}$ is the set of all column vectors with height $n$ and real numbers as entries, $\mathbb{C}^{n}$ is the set of all height $n$ column vectors with complex numbers as entries.

• $M_{m\times n}(\mathbb{R})$ is the set of all $m\times n$ matrices with real number entries.

• The $m\times n$ zero matrix, written $0_{m\times n}$, is the $m\times n$ matrix all of whose entries are zero.

###### Example 3.1.1.
• $\begin{pmatrix}1\\ 0\end{pmatrix}$ is a $2\times 1$ column vector, an element of $\mathbb{R}^{2}$.

• $\begin{pmatrix}1&2&3\\ 4&5&6\end{pmatrix}$ is a $2\times 3$ matrix

• $\begin{pmatrix}-1&-2\end{pmatrix}$ is a $1\times 2$ row vector

• $\begin{pmatrix}1&2\\ 2&1\end{pmatrix}$ is a $2\times 2$ square matrix.

• $\mathbf{0}_{2\times 2}=\begin{pmatrix}0&0\\ 0&0\end{pmatrix}$.

## 3.1.1 Matrix entries

The $i,j$ entry of a matrix means the number in row $i$ and column $j$. It is important to get these the correct way round. Usually when you give $(x,y)$ coordinates, $x$ refers to the horizontal direction and $y$ refers to the vertical direction. When we talk about the $i,j$ entry of a matrix, however, the first number $i$ refers to the row number (i.e. the vertical direction) and the second number $j$ refers to the column number (i.e. the horizontal direction).

We often write $A=(a_{ij})$ to mean that $A$ is the matrix whose $i$, $j$ entry is called $a_{ij}$. For example, if $A$ is $2\times 2$ then saying $A=(a_{ij})$ means that

 $A=\begin{pmatrix}a_{11}&a_{12}\\ a_{21}&a_{22}\end{pmatrix}.$

If you’re using this notation you must also specify the size of the matrix, of course.

We often talk about the columns and rows of a matrix. If $A$ is an $m\times n$ matrix

 $A=\begin{pmatrix}a_{11}&a_{12}&\cdots&a_{1n}\\ a_{21}&a_{22}&\cdots&a_{2n}\\ \vdots&\vdots&\vdots&\vdots\\ a_{m1}&a_{m2}&\cdots&a_{mn}\end{pmatrix}$

then the $i$th row of $A$ means the $1\times n$ row vector

 $\begin{pmatrix}a_{i1}&a_{i2}&\cdots a_{in}\end{pmatrix}$

and the $j$th column of $A$ is the $m\times 1$ column vector

 $\begin{pmatrix}a_{1j}\\ a_{2j}\\ \vdots\\ a_{mj}\end{pmatrix}.$

For example, if

 $A=\begin{pmatrix}1&2\\ 3&4\end{pmatrix}$

then the first row is $\begin{pmatrix}1&2\end{pmatrix}$ and the second column is $\begin{pmatrix}2\\ 4\end{pmatrix}$.

## 3.1.2 Matrix addition and scalar multiplication

We can add matrices of the same size. If $A=(a_{ij})$ and $B=(b_{ij})$ are the same size, then $A+B$ is defined to be the matrix whose $i,j$ entry is $a_{ij}+b_{ij}$.

###### Example 3.1.2.
 $\begin{pmatrix}1&2\\ 4&5\end{pmatrix}+\begin{pmatrix}0&1\\ 2&3\end{pmatrix}=\begin{pmatrix}1+0&2+1\\ 4+2&5+3\end{pmatrix}=\begin{pmatrix}1&3\\ 6&8\end{pmatrix}.$

In other words, we add matrices by adding corresponding entries. We never add matrices of different sizes.

We also multiply matrices by numbers. This is called scalar multiplication. If $A=(a_{ij})$ is a matrix and $\lambda$ a number then $\lambda A$ means the matrix obtained by multiplying every entry in $A$ by $\lambda$, so the $i,j$ entry of $\lambda A$ is $\lambda a_{ij}$.

###### Example 3.1.3.
 $2\begin{pmatrix}1&-3\\ 0&1\end{pmatrix}=\begin{pmatrix}2&-6\\ 0&2\end{pmatrix}.$

## 3.1.3 Laws for addition and scalar multiplication

These operations have some familiar properties.

###### Theorem 3.1.1.

If $a$ and $b$ are numbers and $A$, $B$, and $C$ are matrices of the same size,

1. 1.

$A+B=B+A$ (commutativity)

2. 2.

$A+(B+C)=(A+B)+C$ (associativity)

3. 3.

$(a+b)A=aA+bA$ (distributivity),

4. 4.

$a(A+B)=aA+aB$ (distributivity), and

5. 5.

$a(bA)=(ab)A$. ∎

These can be proved using the usual laws for addition and multiplication of numbers.