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 and which are described by their entries as follows:

The two matrices are considered βequalβ only if every entry is identical. In other words, we require that for all . If this is the case, then we write

If there are any such that , we write

In some way, this definition is unsurprising, as there is no obvious alternative way for describing equality between two matrices. On the other hand, this definition of equality is clearly more strict than would be used in conventional algebra, which has no need to discuss multiple entries.

### Example 1: Conditions for the Equality of Matrices

Given that is it true that ?

### Answer

The matrices and can be written as

Since the matrix has two rows and three columns, we have and . The matrix has two rows and two columns and hence and .

This demonstrates immediately that the two matrices cannot be equal. The entries and are highlighted below:

However, the matrix has no entries or , given that it only has two columns. Since these entries do not exist, we conclude that , meaning that the statement is false.

At this point, it is hopefully clear that there is one immediate condition which, if not met, implies that two matrices cannot be equal. If we are attempting to compare the entries of two matrices with a differing number of rows or columns, then we would find this to be an impossible task, meaning that it is not possible for two such matrices to be equal.

### Theorem: Matrix Order and Matrix Equality

For two matrices and to be equal, they must have the same number of rows and the same number of columns. In other words, the matrices must have the same order.

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 ?

### Answer

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:

From this we find that and . However, we also find that and that , which means that these two matrices 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 .

### Answer

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 . The final matrix is

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 three 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:

### Answer

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 , which gives the two solutions .

By setting , we have , implying that .

### Example 5: Solving Equations Using Matrix Equality

Given that determine the values of , and .

### Answer

Given that the two matrices are equal, we can make the comparison for each entry: which gives the system of linear equations

The first two of these equations are and . These are solved simultaneously to give and .

We then use the given equation . Using the calculated values of and , we find that .

The final equation can be solved using the known values for and , giving .

### Example 6: Solving Equations Using Matrix Equality

Given that find the value of .

### Answer

By highlighting the paired entries, we deduce that we must solve the system of equations

We can find the values of and directly from the two equations and . By taking logarithms of both sides, we obtain and .

By understanding the laws of exponents and logarithms, we use the condition to find

Since , we now find using the given equation . We have

Now that we have , we calculate that

Therefore, .

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.

### Key Points

- For two matrices and to be βequal,β it must be the case that for all . In other words, each entry must be identical.
- Matrix equality is a strict condition. If for any then .
- If and are two matrices with different orders, then .