Skip to lesson

Math · Precalculus

Chapter 6: Matrices and Systems

Matrix Operations

A grid of numbers that acts like a single object.

Lesson
1
Time
About 22 minutes
0 of 12 done

Step 1: Let's Learn

Read it, or press Listen and follow the words.

A matrix is a rectangular array of numbers. Its size is written rows by columns, so a 2×3 matrix has 2 rows and 3 columns.

Adding and scaling

Add matrices entry by entry, which requires identical sizes. Scaling multiplies every entry by the same number.

Multiplying is different

To multiply, take each row of the first against each column of the second, multiplying matching entries and adding.

When it is defined

The columns of the first must match the rows of the second. A 2×3 times a 3×4 works and gives a 2×4.

Order matters

AB and BA are usually different, and one may not even be defined. Matrix multiplication is not commutative.

What it is for

A matrix stores a transformation. Multiplying applies it, which is how rotations and scalings are handled in graphics.

A grid that behaves like one object

A matrix is a rectangular array of numbers that can be added, multiplied and inverted as a unit. Treating a whole table of data as a single algebraic object is what makes matrices powerful.

Multiplication is rows against columns

Each entry of the product is the dot product of a row of the first matrix with a column of the second. The inner dimensions must match, which is why not every pair of matrices can be multiplied.

Order matters

AB and BA are generally different, and one may be defined while the other is not. Matrix multiplication is not commutative, which is a real departure from ordinary arithmetic and must be respected.

Matrices are transformations

Multiplying a vector by a matrix rotates, scales, shears or reflects it. That is why graphics hardware is built around matrix multiplication — every camera move is one matrix applied to millions of points.

Step 2: Try It Yourself

Tap and try it out.

Change the entries and watch the product recompute. Each output entry is one row against one column.
2134

Step 3: Watch an Example

One step at a time.

Watch Kofi Multiply Two Matrices

Kofi multiplies the 2×2 matrices [[1, 2], [3, 4]] and [[5, 6], [7, 8]].

  1. Step 1

    For the top-left entry he takes row 1 against column 1: 1×5 + 2×7.

Step 4: Your Turn

Practice makes it stick.

The Size

Problem 1 of 2

A 2×3 matrix times a 3×4 matrix. How many columns does the result have?

The Entry

Problem 2 of 2

Row (1, 2) against column (5, 7). What is the entry?

Rows Against Columns

1 of 8

A 3×5 matrix has how many entries?

2 of 8

Row (2, 3) against column (4, 1). What is the entry?

3 of 8

A 4×2 times a 2×3. How many rows does the result have?

4 of 8

Scale [[1, 2], [3, 4]] by 5. What is the bottom-right entry?

5 of 8

Add [[1, 2], [3, 4]] and [[5, 5], [5, 5]]. What is the top-left entry?

6 of 8

Can a 2×3 be added to a 3×2? Enter 1 for yes, 0 for no.

7 of 8

Which products are defined?

8 of 8

Row (0, 5) against column (6, 2). What is the entry?

Step 5: Quick Check

Show what you know.

Question 1 of 2

Row (3, 1) against column (2, 4). What is the entry?

Question 2 of 2

Is AB always equal to BA for matrices?

What You Learned

  • A matrix is sized rows by columns, and addition needs identical sizes.
  • Multiplication takes rows against columns, and needs the inner dimensions to match.
  • AB and BA are generally different.