Training Linear Algebra Matrices and Matrix Operations
1 / 5

Matrices and Matrix Operations

24 min Linear Algebra

Matrices and Matrix Operations

Matrices are one of the most versatile tools in all of mathematics. A matrix is simply a rectangular grid of numbers — rows and columns — but that simple structure turns out to be the perfect language for organizing everything from systems of equations to 3-D graphics transformations to Google's page-rank algorithm. Any time you need to keep track of many quantities that relate to each other in a structured, linear way, matrices are the natural choice.

The three fundamental operations on matrices — addition, scalar multiplication, and matrix multiplication — follow clear, mechanical rules that you can execute by hand or program a computer to perform. Addition and scalar multiplication work entry-by-entry and are straightforward. Matrix multiplication is more subtle: it combines the rows of the first matrix with the columns of the second using dot products, and it is only defined when the number of columns in the first matrix equals the number of rows in the second. Importantly, matrix multiplication is not commutative — the order in which you multiply matters.

Understanding the dimensions of a matrix is critical. An $m \times n$ matrix has $m$ rows and $n$ columns, and keeping track of these dimensions tells you immediately whether a given operation is legal. When you multiply an $m \times n$ matrix by an $n \times p$ matrix, the result is $m \times p$. If the inner dimensions don't match, the multiplication is undefined.

In this lesson you will practice each of these operations, build fluency with matrix arithmetic, and develop the dimensional awareness that is essential for every topic that follows — from row reduction to determinants to eigenvectors.

Notation

A matrix with $m$ rows and $n$ columns is an $m \times n$ matrix.

Basic Operations
  • Add and subtract matrices entry-by-entry.
  • Multiply a matrix by a scalar by multiplying each entry.
  • Matrix multiplication is defined when inner dimensions match.
Example 1

Add $$\begin{bmatrix}1&2\\3&4\end{bmatrix}+\begin{bmatrix}5&6\\7&8\end{bmatrix}.$$

  1. Write the augmented matrix and apply row operations.
  2. $$\begin{bmatrix}6&8\\10&12\end{bmatrix}$$
Example 2

Compute $$2\begin{bmatrix}3&-1\\0&5\end{bmatrix}.$$

  1. Write the augmented matrix and apply row operations.
  2. $$\begin{bmatrix}6&-2\\0&10\end{bmatrix}$$
Example 3

Multiply $$\begin{bmatrix}1&2\\0&1\end{bmatrix}\begin{bmatrix}3\\4\end{bmatrix}.$$

  1. Write the augmented matrix and apply row operations.
  2. $$\begin{bmatrix}11\\4\end{bmatrix}$$
Interactive Explorer: Matrix Arithmetic
Result row 1: [6, 8]
Result row 2: [10, 12]

Practice Problems

1. Add $$\begin{bmatrix}2&1\\0&3\end{bmatrix}+\begin{bmatrix}4&-1\\5&2\end{bmatrix}.$$
2. Compute $$-3\begin{bmatrix}1&-2\\4&0\end{bmatrix}.$$
3. State the size of a $3 \times 2$ matrix.
4. When is matrix multiplication defined?
5. Multiply $$\begin{bmatrix}2&0\\1&3\end{bmatrix}\begin{bmatrix}1\\2\end{bmatrix}.$$
Show Answer Key

1. $$\begin{bmatrix}6&0\\5&5\end{bmatrix}$$

2. $$\begin{bmatrix}-3&6\\-12&0\end{bmatrix}$$

3. 3 rows, 2 columns

4. When the number of columns of the first equals the number of rows of the second

5. $$\begin{bmatrix}2\\7\end{bmatrix}$$