The matrix size, noted $m \times n$, is the number of rows, respectively the number of columns that a matrix contains. A matrix is said to be square when $m=n$. Matrices of example II are of size $2 \times 3$.

## 1. Multiplication

We have seen in the previous chapter how coefficients and variables are separated from one another, which leads to a matrix multiplying a vector. This implies this multiplication to be defined.

Let $A$ be a matrix of size $\, {\color{orangered}{m}} \times {\color{steelblue}{n}}$ and $B$ be a matrix of size $\, {\color{grey}{m’}} \times {\color{darkred}{n’}}$.

$AB=C$ is possible only if ${\color{steelblue}{n}}={\color{grey}{m’}}$. The $C$ matrix, the product, is of size ${\color{orangered}{m}} \times {\color{darkred}{n’}}$.

The multiplication $A$ by $B$ is done by distributing $A$ rows on each columns of $B$ and by adding the products, namely $(c_{i,j}) = \sum_{k=0}^{n} a_{i,k}\,b_{k,j}$.

#### Example I

The addition of two matrices is possible only if they both have the same size. The corresponding elements are added. The subtraction is defined in a similar way.

## 3. Mutiplication by a scalar (number)

All elements of the matrix are multiplied by the scalar.

## 4. Decomposition

A matrix multiplying a column matrix can be decomposed into an addition of multiplications. This is due to the previous rules.

## Recapitulation

Multiplication

• $AB = C$ where $A$ a matrix of size $\,{\color{orangered}{m}} \times {\color{steelblue}{n}}$ and $B$ a matrix of size $\, {\color{grey}{m’}} \times {\color{darkred}{n’}}$. The multiplication is possible only if ${\color{steelblue}{n}}={\color{grey}{m’}}$. Matrix $C$ size is ${\color{orangered}{m}} \times {\color{darkred}{n’}}$.
• $A B \ne AB$
• Let $K=T$, the left multiplication by $P$ gives $PK=PT$
• Let $K=T$, the right multiplication by $P$ gives $KP=TP$

• $A + B = (a_{i,j} + b_{i,j})$

Multiplication by a scalar

• $\lambda A= (\lambda a_{i,j})$

Distributivity

• $A(B+C)=AB+AC$

Decomposition matrix multiplying a column matrix

• $\left(\begin{smallmatrix} v_{1} & \cdots & w_{1} \\ \vdots & \cdots & \vdots \\ v_n & \cdots & w_n \end{smallmatrix}\right) \left(\begin{smallmatrix} \lambda_1 \\ \vdots \\ \lambda_n \end{smallmatrix}\right) = \lambda_1 \left(\begin{smallmatrix} v_{1} \\ \vdots \\ v_n \end{smallmatrix}\right) + \cdots + \lambda_n \left(\begin{smallmatrix} w_{1} \\ \vdots \\ w_n \end{smallmatrix}\right)$