What is a Matrix?
A matrix (plural: matrices) is a rectangular array of numbers arranged in rows and columns.
For example, you may see a matrix written as:
Or alternatively,
This matrix has 2 rows (horizontal lines) and 3 columns (vertical lines), so we call it a matrix (read “two by three”). More formally, we define a matrix as
A rectangular array of numbers (or expressions) with entries arranged in rows and columns.
Each individual number in a matrix is called an entry or element. We usually denote a matrix by an uppercase letter (like or ), and its entries by lowercase letters with two subscripts. For example, if is a matrix, then (or ) denotes the entry in the row and the column of . We write
,
meaning the array whose entry is . For instance, if
,
then (row 2, column 3) and . In this example, has 3 rows and 5 columns, so we say “ is of size ” or “has dimensions ”.

Figure 4.10.1: A Matrix, made by Zachary Newcomer in Overleaf.
In Unit 4.10, we will assume all entries , or the set of all real numbers.
Rows, Columns, and Entries
In a matrix, a row is a horizontal strip of entries, and a column is a vertical strip of entries. If a matrix has rows and columns, we call it an matrix. Matrices are not commutative, meaning that the order of the numbers matters: an matrix is not the same as an matrix. For example, a matrix has 2 rows and 3 columns, while a matrix has 3 rows and 2 columns. These cannot be added or multiplied in the same ways because their sizes differ. We often write an matrix as , meaning has rows and columns with real-number entries.
We refer to the entry in row and column of a matrix as . For instance, in a matrix , we might say is the number in the 3rd row and 5th column. By convention, the first index is the row number and the second is the column number.
Here’s an example of labeling entries:
Let be the matrix
.
Then, is the entry in row 2, column 3. If , we would write that entry as 7.
This notation makes it easy to refer to entries. For example, when we discuss how to add two matrices and later on, we will say as long as the entry indices align.
Dimensions and Order
The dimension or order of a matrix is written as , where is the number of rows and is the number of columns. For example, a matrix with 2 rows and 2 columns is a matrix; with 1 row and 4 columns, it is a matrix, etc.
So, why does order matter?
First, it affects which operations we can do. For addition and subtraction, two matrices must have exactly the same dimensions to even add them (we will see why below). For multiplication, it determines whether two matrices can be multiplied, and what size the product will have. It is crucial to remember that you must pay attention to the dimensions of matrices before doing any operation.
Types of Matrices
Row Matrix
A Row Matrix has one row and multiple columns. An example of this is
Column Matrix
A Column Matrix has multiple rows but one column:
Square Matrix
A Square Matrix has the same number of rows and columns :
Rectangular Matrix
A Rectangular Matrix has a different number of rows and columns:
Zero Matrix
A Zero Matrix has in every entry, often written as :
Identity Matrix
An Identity Matrix is an matrix with ones across the main diagonal (top left to bottom right), with zeros everywhere else:
Multiplying by the identity will leave a matrix unchanged (much like multiplying a number by ).
Equality of Matrices
Two matrices and are equal if and only if they have the same dimensions and each corresponding entry is equal: and must both be , and for all .
For example, take the matrix .
Say we have another matrix .
Obviously, we can see that ; this is true because their dimensions are the same and each entry matches.
However, because the second matrix is , a different dimension, so they cannot be equal. Though this may seem like common sense, it is a common mistake to overlook dimensions when comparing matrices, so always first check dimensions.
Scalar Multiplication
We can multiply a matrix by an ordinary number (a scalar) just by multiplying each entry by that number.
If and is an matrix, then the scalar product is the matrix whose entries are , , .
For example, if , then for scalar ,
.
This, in comparison to matrix multiplication, is straightforward; it is done entrywise. This is due to the fact that multiplying by a scalar is a linear operation: and for scalars and matrices . Scalar multiplication preserves dimensions, so if is , so is . What this means is that scalar multiplication has no special dimension requirement beyond the matrix’s own dimension; we can multiply any matrix by any scalar.
Matrix Addition and Subtraction
Just like how we add vectors from their components, adding two matrices is done by adding corresponding entries. However, this is only valid when the two matrices are the same size. That is, to form , both and must be . If their dimensions differ, is undefined (you cannot add a matrix to a matrix, for instance). Matrix subtraction is defined similarly, the only difference being you subtract entrywise rather than add.
Example
Add and .
Since both matrices are , we can add them:
.
Similarly,
.
Matrix Multiplication
Up until now, we have gone over addition/subtraction of matrices and scalar multiplication. Matrix multiplication, when compared to these two, is much less intuitive. You may wonder: why is matrix multiplication defined in such a complicated way rather than just multiplying each entry? It turns out that the particular rule we will introduce for matrix multiplication is chosen so that matrices can model operations in math and science (we’ll dive deeper into this in 4.13 and 4.14). If we tried to multiply matrices entrywise (i.e., ), that operation would not be useful in those contexts and would also not preserve those algebraic relationships we want (like composition of linear transformations). In fact, mathematicians define matrix multiplication so that, when matrices represent linear transformations (we’ll see what this means in 4.12), multiplying matrices corresponds to performing one transformation after another.
When multiplying matrices, we are looking for an operation that:
- Takes two matrices and and produces another matrix .
- Reflects the idea of combining rows of one matrix with columns of another (a kind of dot product of row and column vectors).
- Ensures that (associativity) and that distributing over addition works.
Let’s look at an example that shows us exactly why matrix multiplication isn’t performed entrywise:
If matrix is and matrix is , and we defined as (entrywise), then multiplication would be commutative (since ), but as we discussed earlier, matrix multiplication should not be commutative in general. Instead, we use a new rule:
To multiply an matrix by an matrix , we will form an product whose entry is the dot product of row of with column of . More formally, we say:
.
More compactly,
.
We’ll unpack exactly what this means, but first, we need to know when two matrices can be multiplied because, like addition, there are times when is undefined.
Compatibility for Multiplication
So, when can we multiply matrices? Two matrices and can be multiplied (in the order ) exactly when the number of columns of equals the number of rows of . If is , and is , then is defined and will be an matrix. If this “inner” dimension does not match (for example, , ), then is undefined.
Matrix Multiplication Step-by-Step
Let’s break down matrix multiplication into 3 steps:
1. Identify the dimensions: Ensure that is and is . The product will be .
2. Compute each entry for each row and column:
- Multiply by , by, ,, by .
- Add all of those products together. The sum is
3. Assemble the product matrix: After finding all entries, write them in an matrix to form .
Example
Given that , and , find .
Step 1: Identify the Dimensions
Matrix has 2 rows and 3 columns, and Matrix has 3 rows and 2 columns, so
. The inside dimensions match: ()(), so multiplication is possible. The product will have the outside dimensions: .
Step 2: Compute Each Entry
Our formula is .
First row, first column:
First row, second column:
Second row, first column:
Second row, second column:
Step 3: Assemble the Product Matrix
So, What About Matrix Division?
After seeing matrix addition, subtraction, and multiplication, it’s natural to ask about matrix division. However, we do not cover matrix division in AP Precalculus; not because you don’t need to know it, but because there is no such thing as matrix division. Let’s go over why.
Think about ordinary numbers. Dividing a number is the same as multiplying by its reciprocal:
.
This works because every nonzero number has a reciprocal.
Matrices, however, are different. There is no reciprocal matrix for every matrix, so there is no single operation that we can call “matrix division.”
For example, suppose we write
Where A and B are both matrices. What should this mean? One possibility is
,
while another is
As we have discussed, unlike ordinary numbers, meaning matrix multiplication is not commutative
Instead of defining matrix division, mathematicians solve problems by multiplying by an inverse matrix, when one exists. We’ll take a look at exactly what an inverse matrix is in Unit 4.11.
Furthermore, not every matrix can be “undone.” Some matrices have no multiplicative inverse at all, so attempting to divide by them would be impossible.
Instead of defining matrix division, mathematicians solve problems by multiplying by an inverse matrix, when one exists. We’ll take a look at exactly what an inverse matrix is in Unit 4.11.
