**Matrix Multiplication: **In algebra there are two types Matrix multiplication: Multiplication of a matrix by a number and multiplication of a matrix by another matrix.

**Scalar Multiplication**: When we multiply a matrix with a number it is called scalar multiplication in which every element of a matrix is multiplied by the same number.

For example: If we multiply a matrix A with 5 then every element of the matrix would be multiplied with 5.

**Multiplication of a Matrix with another Matrix:**

The matrix product **AB** is defined only when the number of columns in **A** is equal to the number of rows in **B**. Similarly, the matrix product **BA** is defined only when the number of columns in **B** is equal to the number of rows in **A**. This type of multiplication is also known as dot product.

Suppose A is a m*n matrix and B is a n*o matrix, then matrix product AB results into a matrix C with dimensions of m*o i.e. C would be a matrix with m rows and o columns. Each element of the C matrix would be computed as per the following formula.

C_{mo} = ∑_{n }A_{mn}*B_{no}

For Example_{:}

The multiplication operation in the above matrix happened as per below equations:

- C11 = 0*6 + 1*8 +2*10 = 0 + 8 + 20 = 28
- C12 = 0*7 + 1*9 +2*11 = 0 + 9 + 22 = 31
- C21 = 3*6 + 4*8 +5*10 = = 18 + 32 + 50 = 100
- C22 = 3*7 + 4*9 +5*11 = 21 + 36 +55 = 112

**Multiplication Order:**

In some cases, matrix multiplication is defined for **AB** but not for **BA** and vice versa. However, even when matrix multiplication is possible in both directions, results may be different. That is **AB** is not always equal to **BA**.

Because order is important, matrix algebra jargon has evolved to clearly indicate the order in which matrices are multiplied.

- To describe the matrix product
**AB**, we can say**A**is*post-multiplied*by**B**; or we can say that**B**is*pre-multiplied*by**A**. - Similarly, to describe the matrix product
**BA**, we can say**B**is*post-multiplied*by**A**; or we can say that**A**is*pre-multiplied*by**B**.

The bottom line: when you multiply two matrices, order matters.

**Identity Matrix**

The **identity matrix** is an *n* x *n* diagonal matrix with 1’s in the diagonal and zeros everywhere else. The identity matrix is denoted by **I** or **I _{n}**. Two identity matrices appear below.

The identity matrix has a unique talent. Any matrix that can be pre-multiplied or post-multiplied by **I** remains the same; that is:

**AI** = **IA** = **A**