# Matrices

## What is a Matrix & what are Matrices?

A matrix is an arrangement of numbers to organise data and solve variables. It’s a way to represent information using a table of numbers. Matrices organise numbers inside a big bracket. The order of the matrix states the size of matrices. The numbers are arranged in rows and columns.

Example 1:
$$A=\begin{bmatrix}2 & 4 \\-3 & 7 \end{bmatrix}$$
In the given matrix, we have 2 rows and 2 columns.

Example 2:
$$B=\begin{bmatrix}3 & 2 & 6 \\ 5 & 0 & 4 \end{bmatrix}$$
In the example above, we have 2 rows and 3 columns. The order of the matrix is 2 by 3 (2 x 3).

a. The order size must be the same. The matrices to add or subtract must match the size of the row and the column.
b. Add or subtract the numbers in the same position.

Add the numbers in the same positions.

Calculations:
$$B=\begin{bmatrix}(2+3) \ \ \ & \ \ \ (4+2) \\ ((-3)+7) \ \ \ & \ \ \ (7+0) \end{bmatrix}$$
$$\begin{bmatrix}5 & 6 \\ 4 & 7\end{bmatrix}$$
Example in Subtraction:

Again, subtract the number with the same position:

These are the calculations. They follows the rules in sign numbers.
$$B=\begin{bmatrix}(2-3) \ \ \ & \ \ \ (4-2) \\ ((-3)-5) \ \ \ & \ \ \ (7-0) \end{bmatrix}$$
$$\begin{bmatrix}-1 & 2 \\ -8 & 7\end{bmatrix}$$

Multiplication of Matrices
Example:
Multiplying matrix by a number.
$$3 \times \begin{bmatrix}3 & 2 \\ 5 & 0\end{bmatrix}$$
Multiply each matrix by 3.

These are the solutions:
$$\begin{bmatrix}3\times3 \ \ \ &3\times 2 \\ 3\times5 \ \ \ & 3\times0\end{bmatrix}$$
$$\begin{bmatrix}3 & 6 \\ 15 & 0\end{bmatrix}$$

Multiplying Matrix by Matrix
a. The number of rows of the first matrix must be equal to the number of columns in the second matrix.
b. The product of the matrix is equal to the number of rows of the first matrix and columns of the second matrix, then add.
Example:

Multiply each member of the first rows to the first column of the matrices and add each product.

For the first row and first column:
(4, 3, 5) x (1, 0, 4) = (4 x 1) + (3 x 0) + (5 x 4) = 4 + 0 + 20 = 24

For the first row and second column:
(4, 3, 5) x (2, 6, 8) = (4 x 2) + (3 x 6) + (5 x 8) = 8 + 18 + 40 = 66

For the second row and first column:
(2, 4, 7) x (1, 0, 4) = (2 x 1) + (4 x 0) + (7 x 4) = 2 + 0 + 28 = 30

And for the second row and second column:
(2, 4, 7) x (2, 6, 8) = (2 x 2) + (4 x 6) + (7 x 8) = 4 + 24 + 56 = 84

Therefore: