In this explainer, we will learn how to identify the conditions for two matrices to be equal.
Given that linear algebra is different to conventional algebra, it is no surprise that there are fundamentally different concepts involved. Ideas such as the order, type, and transpose simply do not appear in conventional algebra. In conventional algebra, two quantities are equal if they have the same value. For example, if we have and then we can say that the two quantities are equal and hence write .
Alternatively, if we have and then clearly these quantities are not equal and we would write . However, these quantities are related and one such example is to say that or, equivalently, that . This is not the only relationship between and in this case, since we could also say that or something more convoluted such as . We could invent infinitely many such relationships, so long as both sides of the equation have the same value.
In order for linear algebra to be well defined, we need to have a definition of equality, which will allow for us to describe relationships between matrices. The notion of equality in conventional algebra is as we have described above, but for linear algebra we need to consider that matrices have multiple entries and therefore our definition of equality has to respect this.
Definition: Equality of Two Matrices
Consider two matrices, with order and with order , described by their entries as follows:
Then, we say that the two matrices are equal, that is, , if their dimensions are equal and the corresponding entries are identical. In other words, the following two conditions must be satisfied:
Conversely, if or , or there are any and such that , then the two matrices are not equal; that is, .
We note that this definition of equality is clearly more strict than a regular equality of the form , since we need to check both the dimensions of the matrices and all of the entries in each matrix for equality. In particular, even if all possible pairs of entries are equal, if the dimensions are not also equal, then the matrices cannot be equal. We will demonstrate this in the following example.
Example 1: Conditions for the Equality of Matrices
Given that is it true that ?
The matrices and can be written as
Recall that in order for two matrices to be equal, both their dimensions and their entries must be equal. In this case, we notice that some of the pairs of entries are equal. For instance, we have
However, the orders of the matrices are not equal. Matrix has two rows and three columns, so it is a matrix, while matrix has two rows and two columns, making it a matrix. We circle this extra column below:
As the orders of these matrices are not equivalent, it is not true that .
Note that two matrices having the same order is a necessary condition for equality but it is not a sufficient condition. Just because two matrices share the same order, it does not mean that they are automatically equal. This is very straightforward to demonstrate with the two matrices below:
These matrices both have 3 rows and 4 columns and are therefore both of order . These are also both very simple matrices, with every entry being zero except for , which we have highlighted. However, given that , these matrices are not equal and therefore we write .
Example 2: Identifying Equality of Matrices
If is it true that ?
Recall that to check whether two matrices are equal, we have to confirm that they have the same order and that for all and .
These two matrices both have order , so to check for equality we will have to check every entry. In the matrices below, we have highlighted every entry in a different color to provide an easy comparison:
Comparing the top left entries, we find that , and comparing the bottom left entries, we get . However, examining the entries in the top right, we find that , while ; hence . Similarly, in the bottom right, we can see that , while , so . As these matrices do not satisfy the condition of for all , they are not equal.
When working with larger matrices, the same principle applies in exactly the same way, only with a larger number of comparisons to be made. In practice, rather than writing down every single comparison, we would inspect the two matrices to find any difference between pairs of entries. For example, consider the two matrices of order :
Given that these matrices do have the same order, we then look for pairs of entries which differ:
We have that and that , which gives two reasons why .
Example 3: Solving Equations Using Matrix Equality
Given that find the values of and .
We recall that for two matrices to be equal, given that they have the same order, we must have that for all and .
We begin by highlighting all of the entries that we must compare:
There are two pairs of entries that are clearly equal in both matrices, namely, that and that .
To ensure that these matrices are equal, we set , which implies that , giving . We now set which gives and hence . Thus, the final matrix is and , .
The question above shows how the condition on matrix equality is very restrictive. The matrices in the previous question were both of order and hence had 4 entries each. Immediately, we could observe that two pairs of entries were identical across both matrices. Even though we had found two instances of equality, we still had to check two remaining pairs of entries. Had either of these pairs of entries been unequal, the matrices would not have been equal, by definition.
The following two examples demonstrate how equality between matrices might rely on the correct calculation of multiple variables.
Example 4: Solving Equations Using Matrix Equality
Find the values of and , given the following:
Let us, first of all, recall that for two matrices to be equal, if we know that they have the same order, then for all and .
We highlight each pair of entries as shown:
Clearly we already have and , so there are no further checks needed for these entries.
By setting , we obtain the equation . Solving this for , we get
By setting , we have , implying that . In summary, and .
Example 5: Solving Equations Using Matrix Equality
Given that determine the values of , and .
Recall that for two matrices of the same order, they are only equal if all their corresponding entries are equal. Thus, we can make the comparison for each entry: which gives the system of linear equations
We notice that the first two equations, and , can be added together to eliminate the term. This gives us
Substituting this value of into the first equation (although the second can also be used), we get
Now that we have found and , we notice that we can solve for . This gives us
Finally, we can find from the last equation, :
In summary, we get , , , and .
In a superficial sense, checking for matrix equality is nothing more than checking for multiple separate instances of equality across all of the matrix entries. Ultimately, this bland assessment is a totally accurate one, as the definition of matrix equality does indeed require comparing all entries of the two matrices involved. However, the situation changes when we are working with matrices that have entries which are populated to some extent by variables, as well as numbers. This flexibility, when combined with other operations from linear algebra (such as matrix multiplication, matrix exponentiation, and matrix inversion), allows for more elaborate mathematical problems to be constructed, as we have seen above. For example, once matrix multiplication has been well defined, it is possible to encode entire systems of linear equations in terms of simple matrix equations, providing a powerful and concise language for working with such advanced concepts. Although defining matrix equality might seem unnecessary or trivial, it is of crucial importance for understanding linear algebra and the many indispensable mathematical tools that this area has provided.
- Consider two matrices, with order and with order , described by their entries as follows: Then, if and only if
- Matrix equality is a strict condition. If there are any and such that , then .
- Additionally, if and are of different orders, then .
- We can find missing values that make two matrices equal by forming and solving equations.