# Subtraction of Matrix in Discrete mathematics

Matrix subtraction can be described as a process of subtraction of corresponding elements of two or more than two matrices. A matrix is a type of mathematical format that is used to arrange the data as rows and columns. With the help of element-wise subtraction, we can perform the subtraction of matrices. If there are two matrices and the order of these matrices is the same, only then it is possible to do the difference between these two matrices. Similarly, when the order of the two given matrices is the same, only then the addition of the matrices will be possible. In this case, the resultant matrix will contain the same order. We cannot do the subtraction of two given matrices if the order of these matrices is not the same. For example: If we try to subtract the 3*3 matrix from the 2*2 matrix, then we will not be able to do that because the order or dimensions of both matrices are not the same.

On the basis of the order of the matrices, we can perform the arithmetic operation on them. In case of addition and subtraction, we always check the order of the matrices, but in case of matrix multiplication, we can only check whether the number of columns in 1st matrix and the number of rows in the 2nd matrix are the same or not. The order of matrix multiplication will be the same as the order of resulting matrix.

## What is subtraction of Matrices

The subtraction of matrices can be described as an operation in which we perform the element-wise subtraction of matrices which has the same order. This means the matrices should have the same number of rows and columns for the process of subtraction. If the number of horizontal rows of the first matrix is m and the number of vertical rows of the second matrix is n, then that type of matrix will be known as the m*n dimension matrix. In the process of matrix subtraction, we should subtract those types of matrices which have the same dimension because while subtracting, we subtract the corresponding elements of matrices.

## Definition of Subtraction of matrices

If the same order is contained by two matrices, A and B, which is an m*n matrix, where A = [aij] and B = [bij], in this case, the subtraction of these matrices will be described as follows:

A - B = aij - bij

Suppose there is a matrix D where D = [dij], then

dij = aij = bij where (i = 1, 2, 3, 4, …, and j = 1, 2, 3, 4, ….)

In conclusion, we can say that

D = A - B = aij - bij

## Meaning of Matrix subtraction

If the number of rows and the number of columns is similar to each other, only then we can do the matrix subtraction. At the time of subtracting two matrices, we are going to subtract the elements in each row and column of one matrix from the corresponding elements in the rows and columns of the second matrix. Suppose there are two matrices, A and B, which have the same order, m*n. Here m is used to indicate the number of rows, and n is used to indicate the number of columns of two matrices. It can be indicated as A = [aij] and B = [bij]. Now we will use the following way to indicate the difference between A and B, i.e., A-B = [aij] - [bij] = [aij - bij]. Here ij is used to indicate the position of each element in the ith and jth column. The matrix m*n will be the dimension of this difference matrix. ### Subtraction of 2*2 matrices

As we have learned that if there are an equal number of rows and columns in the matrices, only then we will be able to do the subtraction of those matrices. Therefore, if we want to do the subtraction of matrices which has order 2*2, then we can say that the matrices will have 2 rows and 2 columns. Suppose there are two 2*2 matrices, A and B. We will do the subtraction of A and B by doing the difference between the elements of matrices of the same positions. That means to subtract B from A, we need to subtract B's elements from the corresponding A's elements. The elements of A and B matrices are described as follows: In the following way, we will do the subtraction of these matrices A and B like this:

a11 - b11

a12 - b12

a22 - b22

a21 - b21

The result of this subtraction can be shown in another way, which is described as follows: Now we will better understand the concept of matrix subtraction which has 2*2 dimensions, with the help of using an example of matrices A and B and subtracting B from A. #### Note: Suppose there are two matrices, A and B, and the order of these matrices is the same, in this case, it will contain the following relation:

A - B ≠ B - A

Hence, the subtraction of two matrices cannot have the commutative property.

### Subtraction of 3*3 matrices

If there are two 3*3 matrices and we try to subtract them, then it will imply that the matrices which we are going to subtract from one another will have the 3 rows and 3 columns. In case of subtraction of matrices, we usually subtract the element of 1st matrix from the corresponding elements of 2nd matrix. Suppose there are two 3*3 matrices, A and B. In the following way, we can represent the elements of the matrices like this: In the following way, we will do the subtraction of these matrices A and B like this: ### Scalar value

If there are a scalar value k and two matrices A and B, then what will be the value of k(A-B)?

Solution: As we know that k is a scalar value, and we can distribute this value inside the bracket in the following way:

k(A-B) = kA - kB

## Properties of Matrix multiplication

The matrix subtraction will be performed in the same way as the matrix addition. All constraints which are applied in case of addition of matrices will also be applied in case of subtraction of matrices. Among all the properties, there is one important property that should be held by matrix subtraction, i.e., we can define the matrix subtraction if and only if the matrices contain the same order.

• In case of matrix subtraction, there must be an equal number of rows and columns.
• The matrix subtraction does not contain the commutative property, i.e., A - B ≠ B - A.
• The matrix subtraction does not contain the associative property, i.e., (A - B) - C ≠ A - (B - C).
• If we subtract the matrix from itself, then it will generate a result in the form of a null matrix, i.e., A - A = 0.
• Subtraction of a matrix can also be described as the addition of negation of a matrix into some other matrix, i.e., A - B = A + (-B).

## Important notes on matrix subtraction

• If there are two matrices that have the same dimension, only then we can do the subtraction of these matrices.
• The matrix subtraction does not contain the associative and commutative properties.
• In case of matrix subtraction, we can only subtract the corresponding elements of matrices.

### Example of subtraction of matrices

There are a lot of examples of subtraction of matrices, and some of them are described as follows:

Example 1: In this example, we have two matrices, A and B, and we have to determine A - B. The elements of A and B are described as follows: Solution: The subtraction of A and B is described as follows: Example 2: In this example, we have three matrices, A, B, and M. Here, we have to check whether we can define A - B, A - M, and B - M. The elements of A, B, and M are described as follows: Solution: The subtraction of A and B is described as follows: The order of A is 3*3, and the order of M is 2*2. So the order of A and the order of M are not similar to each other. Therefore, we cannot define the subtraction of A-M.

The order of B is 3*3, and the order of M is 2*2. So the order of B and the order of M are not similar to each other. Therefore, we cannot also define the subtraction of B-M.

Hence the subtraction of A-B can be defined.

The subtraction of A-M cannot be defined.

The subtraction of B-M cannot be defined.

Example 3: In this example, there are two matrices, A and B, and we have to determine the subtraction of these matrices. The elements of A and B are described as follows: Solution: The subtraction of A and B is described as follows: Example 4: In this example, there are two 3*3 matrices, A and B, and we have to determine the subtraction of these matrices. The elements of A and B are described as follows: Solution: Here, we will assume that C = A - B, so Hence this is the answer of subtraction of A and B.

Example 5: In this example, if we have two elements, A and B, and a13 = 14 is an element in A, and b13 = -3 is an element in B, then we have to find out the element in 1st row and 3rd column of matrix B - A with the help of definition of matrix subtraction.

Solution: We can determine the value of b13 - a13 with the help of definition of matrix subtraction. For this, we have to find out the element in 1st row and 3rd column of matrix B - A like this:

b13 - a13 = -3 - 14 = -17

Hence the element of 1st row and the 3rd column of B - A will be -17.

Example 6: In this example, we will use the formula of matrix subtraction and write the element of matrix C = A-B explicitly where the elements of A = {2 5 9} and the elements of B = {1 9 12}.

Solution: As we can see that both matrices A and B have the same dimensions, i.e., 1*3. So it will be possible to do the subtraction of A and B. So

C = A - B = [2-1 5-9 9-12] = [1 -4 -3]

Hence the elements of matrix C = A-B will be

C11 = 1

C12 = -4

C13 = -3

Next Topic#

### Feedback   