mathpi.net

Matrix Subtraction

Matrix Subtraction is used to find the difference or subtraction of two matrices of same size. In this class, we will learn how to do matrix subtraction of given matrices, with the help of examples.

What is Matrix Subtraction?

Matrix subtraction is the process of subtracting matrices by subtracting the corresponding entries from the matrices.

\({\ \begin{bmatrix}a_{11} & a_{12}\\a_{21} & a_{22}\end{bmatrix} }\) - \({\ \begin{bmatrix}b_{11} & b_{12}\\b_{21} & b_{22}\end{bmatrix} }\) = \({\ \begin{bmatrix}a_{11} - b_{11} & a_{12} - b_{12}\\a_{21} - b_{21} & a_{22} - b_{22}\end{bmatrix} }\)

The operation is defined only for matrices of the same dimensions, meaning that each matrix must have the same number of rows and columns as the other.

Requirements for Matrix Subtraction

1. The matrices must be of the same dimension. That is, if Matrix A is of dimension m x n, Matrix B must also be of dimension m x n.

How to do Matrix Subtraction

To perform matrix subtraction, follow these steps:

1. Ensure that the matrices you are given to add have the same dimensions.

2. Add the corresponding elements from each matrix to form a new matrix.

Subtraction of 2x2 Matrices

Consider two matrices A and B of dimension 2x2:

Matrix \({\ A = \begin{bmatrix}a_{11} & a_{12}\\a_{21} & a_{22}\end{bmatrix} }\)

Matrix \({\ B = \begin{bmatrix}b_{11} & b_{12}\\b_{21} & b_{22}\end{bmatrix} }\)

The result of the subtraction \({\ A - B }\) is a new matrix \({\ C }\).

Matrix \({\ C = \begin{bmatrix}c_{11} & c_{12}\\c_{21} & c_{22}\end{bmatrix} = A-B = \begin{bmatrix}a_{11} & a_{12}\\a_{21} & a_{22}\end{bmatrix} - \begin{bmatrix}b_{11} & b_{12}\\b_{21} & b_{22}\end{bmatrix} }\)

where each element \({\ c_{ij} = a_{ij} - b_{ij} }\).

\({\ C = \begin{bmatrix}c_{11} & c_{12}\\c_{21} & c_{22}\end{bmatrix} = \begin{bmatrix}a_{11} - b_{11} & a_{12} - b_{12}\\a_{21} - b_{21} & a_{22} - b_{22}\end{bmatrix} }\)

Subtraction of 3x3 Matrices

Consider two matrices A and B of dimension 3x3:

Matrix \({\ A = \begin{bmatrix}a_{11} & a_{12} & a_{13}\\a_{21} & a_{22} &a_{23}\\a_{31} & a_{32} &a_{33}\end{bmatrix} }\)

Matrix \({\ B = \begin{bmatrix}b_{11} & b_{12} & b_{13}\\b_{21} & b_{22} &b_{23}\\b_{31} & b_{32} &b_{33}\end{bmatrix} }\)

The result of adding A to B is a new matrix C.

Matrix \({\ C = \begin{bmatrix}c_{11} & c_{12} & c_{13}\\c_{21} & c_{22} &c_{23}\\c_{31} & c_{32} &c_{33}\end{bmatrix} = \begin{bmatrix}a_{11} - b_{11} & a_{12} - b_{12} & a_{13} - b_{13}\\a_{21} - b_{21} & a_{22} - b_{22} & a_{23} - b_{23}\\a_{31} - b_{31} & a_{32} - b_{32} & a_{33} - b_{33}\end{bmatrix} }\)

Examples for Matrix Subtraction

1. Find the subtraction of following two matrices: A - B.

Matrix \({\ A = \begin{bmatrix}7 & 2\\3 & 1\end{bmatrix} }\)

Matrix \({\ B = \begin{bmatrix}4 & 5\\4 & 0\end{bmatrix} }\)

Solution

Given matrices are:

Matrix \({\ A = \begin{bmatrix}7 & 2\\3 & 1\end{bmatrix} }\)

Matrix \({\ B = \begin{bmatrix}4 & 5\\4 & 0\end{bmatrix} }\)

Checking if Matrix Subtraction is possible with Matrices A and B

Both matrix A and matrix B are of same size: 2x2. Therefore, we can do the matrix subtraction with these two matrices.

Calculating Subtraction of Matrices A and B

\({\ A - B = \begin{bmatrix}7 & 2\\3 & 1\end{bmatrix} - \begin{bmatrix}4 & 5\\4 & 0\end{bmatrix} }\)

\({\ A - B = \begin{bmatrix}7-4 & 2-5\\3-4 & 1-0\end{bmatrix} }\)

\({\ A - B = \begin{bmatrix}3 & -3\\-1 & 1\end{bmatrix} }\)

Result of Matrix Subtraction

Therefore, the subtraction of the given two matrices A and B is

\({\ A - B = \begin{bmatrix}3 & -3\\-1 & 1\end{bmatrix} }\)

2. Find the subtraction of following two matrices: A - B.

Matrix \({\ A = \begin{bmatrix}1 & 2 & 3\\4 & 5 & 6\end{bmatrix} }\)

Matrix \({\ B = \begin{bmatrix}10 & 10 & 10\\10 & 10 & 10\end{bmatrix} }\)

Solution

Given matrices are:

Matrix \({\ A = \begin{bmatrix}1 & 2 & 3\\4 & 5 & 6\end{bmatrix} }\)

Matrix \({\ B = \begin{bmatrix}10 & 10 & 10\\10 & 10 & 10\end{bmatrix} }\)

Checking if Matrix Subtraction is possible with Matrices A and B

Both matrix A and matrix B are of same size: 2x3. Therefore, we can do the matrix subtraction with these two matrices.

Calculating Subtraction of Matrices A and B

\({\ A - B = \begin{bmatrix}1 & 2 & 3\\4 & 5 & 6\end{bmatrix} + \begin{bmatrix}10 & 10 & 10\\10 & 10 & 10\end{bmatrix} }\)

\({\ A - B = \begin{bmatrix}1-10 & 2-10 & 3-10\\4-10 & 5-10 & 6-10\end{bmatrix} }\)

\({\ A - B = \begin{bmatrix}-9 & -8 & -7\\-6 & -5 & -4\end{bmatrix} }\)

Result of Matrix Subtraction

Therefore, the subtraction of the given two matrices A and B is

\({\ A - B = \begin{bmatrix}-9 & -8 & -7\\-6 & -5 & -4\end{bmatrix} }\)

3. Find the subtraction of following two matrices: A - B.

Matrix \({\ A = \begin{bmatrix}1 & 2\\4 & 5\end{bmatrix} }\)

Matrix \({\ B = \begin{bmatrix}10 & 10 & 10\\10 & 10 & 10\end{bmatrix} }\)

Solution

Given matrices are:

Matrix \({\ A = \begin{bmatrix}1 & 2\\4 & 5 \end{bmatrix} }\)

Matrix \({\ B = \begin{bmatrix}10 & 10 & 10\\10 & 10 & 10\end{bmatrix} }\)

Checking if Matrix Subtraction is possible with Matrices A and B

Matrix A is of size 2x2, and matrix B is of same size: 2x3.

The given two matrices are of different size.

The condition for the two matrices to be of same size is not met, and the Matrix subtraction cannot be done for given matrices.

Related Tutorials



Quiz / Practice Problems

1 What is the difference between matrices A = \begin{bmatrix}4 & 7\\1 & 5\end{bmatrix} and B = \begin{bmatrix}2 & 3\\0 & 1\end{bmatrix}?

Not answered
Explanation

A - B = \begin{bmatrix}4 & 7\\1 & 5\end{bmatrix} - \begin{bmatrix}2 & 3\\0 & 1\end{bmatrix}

A - B = \begin{bmatrix}4-2 & 7-3\\1-0 & 5-1\end{bmatrix}

A - B = \begin{bmatrix}2 & 4\\1 & 4\end{bmatrix}

2 What is the result of subtracting matrices A = \begin{bmatrix}5 & 6 & 7\\3 & 1 & 2\\4 & 0 & 2\end{bmatrix} and B = \begin{bmatrix}2 & 1 & 3\\1 & 2 & 4\\0 & 1 & 2\end{bmatrix}?

Not answered
Explanation

A - B = \begin{bmatrix}5 & 6 & 7\\3 & 1 & 2\\4 & 0 & 2\end{bmatrix} - \begin{bmatrix}2 & 1 & 3\\1 & 2 & 4\\0 & 1 & 2\end{bmatrix}

A - B = \begin{bmatrix}5-2 & 6-1 & 7-3\\3-1 & 1-2 & 2-4\\4-0 & 0-1 & 2-2\end{bmatrix}

A - B = \begin{bmatrix}3 & 5 & 4\\2 & -1 & -2\\4 & -1 & 0\end{bmatrix}

3 What is the subtraction of matrices A = \begin{bmatrix}1 & 2\\3 & 4\\5 & 6\end{bmatrix} and B = \begin{bmatrix}0 & 1\\2 & 3\\4 & 5\end{bmatrix}?

Not answered
Explanation

A - B = \begin{bmatrix}1 & 2\\3 & 4\\5 & 6\end{bmatrix} - \begin{bmatrix}0 & 1\\2 & 3\\4 & 5\end{bmatrix}

A - B = \begin{bmatrix}1-0 & 2-1\\3-2 & 4-3\\5-4 & 6-5\end{bmatrix}

A - B = \begin{bmatrix}1 & 1\\1 & 1\\1 & 1\end{bmatrix}

4 What is the difference between matrices A = \begin{bmatrix}2 & 3\\4 & 5\\6 & 7\end{bmatrix} and B = \begin{bmatrix}1 & 1\\2 & 2\\3 & 3\end{bmatrix}?

Not answered
Explanation

A - B = \begin{bmatrix}2 & 3\\4 & 5\\6 & 7\end{bmatrix} - \begin{bmatrix}1 & 1\\2 & 2\\3 & 3\end{bmatrix}

A - B = \begin{bmatrix}2-1 & 3-1\\4-2 & 5-2\\6-3 & 7-3\end{bmatrix}

A - B = \begin{bmatrix}1 & 2\\2 & 3\\3 & 4\end{bmatrix}