← Back to all activities πŸ“ Worksheet (KO) πŸ“– Read the article ν•œκ΅­μ–΄ β†’
πŸ”’ Matrix Lab

Just line numbers up in a grid,
and a brand-new operation appears

A matrix is just a table of numbers arranged in a rectangle. Even though it's just a table, you can define operations on it like addition, subtraction, and multiplication β€” and remarkably, multiplication gives a different result if you swap the order. Try filling in the cells yourself to see it.

A matrix is a table that organizes numbers into horizontal lines (rows) and vertical lines (columns). If it has m rows and n columns, it's called an "mΓ—n matrix," and the number sitting in row i, column j is called the (i,j) entry of that matrix.

Adding and subtracting matrices is intuitive β€” you just calculate position by position, using the numbers in the same spot. But multiplication is defined differently β€” and unlike ordinary number multiplication, this multiplication gives a different result if you swap the order (AB β‰  BA). Try each one hands-on below to see for yourself.

πŸ“‹ What is a matrix? β€” Fill numbers into rows and columns

Use the buttons to change how many rows (horizontal lines) and columns (vertical lines) the table below has, and type numbers directly into the cells. Click any cell to see which row and column it's in.

Rows (m)
2
Columns (n)
3
Matrix A
βž• Addition, Subtraction & Scalar Multiplication

Two matrices A and B need to be the same size to add or subtract them (calculated position by position). Use the slider for k to decide how many times to scale A.

Rows (m)
2
Columns (n)
2
A
+ / βˆ’
B
=
A+B
Aβˆ’B
2
kA
βœ–οΈ Matrix Multiplication β€” Not just any sizes will do

A is an mΓ—n matrix, B is a pΓ—q matrix. To calculate AB, the number of columns in A (n) must equal the number of rows in B (p). Try changing the sizes freely and see when multiplication is defined.

A: Rows (m)
2
A: Columns (n)
3
B: Rows (p)
3
B: Columns (q)
2
A
Γ—
B
=
AB
πŸ”„ Are AB and BA the same?

This time, compare AB and BA side by side using two square matrices (matrices with the same number of rows and columns), A and B. Number multiplication gives the same result either way (3Γ—5=5Γ—3), but matrix multiplication usually doesn't.

A
B
AB
BA
πŸ—ΊοΈ Real-world Application β€” Counting Routes with an Adjacency Matrix

A matrix that marks 1 if there's a direct route between cities A, B, and C, and 0 if there isn't, is called an adjacency matrix. Use the buttons below to turn routes on and off, and see what MΒ² β€” the adjacency matrix M multiplied by itself β€” actually means.

Adjacency matrix M
β†’ MΓ—M β†’
MΒ²

🧩 Matrix Quiz

Question 1/10 Β· 0 correct