Skip to content
๐ŸŽฏโญ INTERACTIVE LESSON

Matrix Operations

Learn step-by-step with interactive practice!

Matrix Operations - Complete Interactive Lesson

Part 1: Meet the Matrix

๐Ÿ”ข Matrix Operations

Part 1 of 5 โ€” Meet the Matrix


Topics in This Part

Section
What Is a Matrix?
Dimensions and Entries
Equal Matrices

๐Ÿ”‘ Key Concept: A matrix is just a rectangular grid of numbers. Before we add, subtract, or multiply them, we need a shared language for describing them โ€” their size and the address of every number inside.

What Is a Matrix?

A matrix (plural matrices) is a rectangular array of numbers arranged in rows and columns, written inside brackets:

A=[2โˆ’15034]A = \begin{bmatrix} 2 & -1 & 5 \\ 0 & 3 & 4 \end{bmatrix}

  • Rows run horizontally (left to right). AA has 2 rows.
  • Columns run vertically (top to bottom). AA has 3 columns.

Each number inside is called an entry (or element).

๐Ÿ’ก Memory trick: "Rows are Right-across, Columns are Climbing-down." Always read rows first, columns second.

Dimensions and Entries

The dimensions (or order) of a matrix are written rowsร—columns\text{rows} \times \text{columns} โ€” always rows first.

A=[2โˆ’15034]isย aย 2ร—3ย matrix.A = \begin{bmatrix} 2 & -1 & 5 \\ 0 & 3 & 4 \end{bmatrix} \quad\text{is a } 2 \times 3 \text{ matrix.}

To name a single entry we use aija_{ij}, where ii is the row number and jj is the column number:

EntryLocationValue
a11a_{11}row 1, col 122
a13a_{13}row 1, col 355
a22a_{22}row 2, col 233
a23a_{23}row 2, col 344

๐Ÿ”‘ Key Idea: The subscript order matches the dimension order โ€” aija_{ij} means row ii, column jj.

Concept Check ๐ŸŽฏ

Locate the Entries ๐Ÿงฎ

Use M=[92โˆ’4071]M = \begin{bmatrix} 9 & 2 & -4 \\ 0 & 7 & 1 \end{bmatrix}.

1) MM has how many rows? 2) MM has how many columns? 3) What is the value of m13m_{13}?

When Are Two Matrices Equal?

Two matrices are equal only if both conditions hold:

  1. They have the same dimensions, and
  2. Every matching entry is identical: aij=bija_{ij} = b_{ij} for all i,ji, j.

Example

[x57y]=[357โˆ’2]โ€…โ€ŠโŸนโ€…โ€Šx=3,โ€…โ€Šy=โˆ’2\begin{bmatrix} x & 5 \\ 7 & y \end{bmatrix} = \begin{bmatrix} 3 & 5 \\ 7 & -2 \end{bmatrix} \;\Longrightarrow\; x = 3,\; y = -2

We match the matrices position-by-position: the top-left entries must agree (x=3x = 3) and the bottom-right entries must agree (y=โˆ’2y = -2).

โš ๏ธ A 2ร—32 \times 3 matrix can never equal a 3ร—23 \times 2 matrix, even if they contain the very same numbers. Shape comes first.

You now have the vocabulary every operation depends on. In Part 2 we start combining matrices with addition, subtraction, and scalar multiplication.

Solve for the Unknowns ๐Ÿ”ฝ

Given [x8โˆ’3y]=[68โˆ’31]\begin{bmatrix} x & 8 \\ -3 & y \end{bmatrix} = \begin{bmatrix} 6 & 8 \\ -3 & 1 \end{bmatrix}, match each entry.

Part 2: Addition, Subtraction & Scalar Multiplication

๐Ÿ”ข Matrix Operations

Part 2 of 5 โ€” Addition, Subtraction & Scalar Multiplication


๐Ÿ”‘ The Idea: Addition, subtraction, and multiplying by a single number all work entry-by-entry. These are the "easy" operations โ€” matrix multiplication (Part 3) is the one with a twist.

Adding and Subtracting Matrices

To add or subtract two matrices, combine corresponding entries.

โš ๏ธ You can only add or subtract matrices with the same dimensions. If the shapes differ, the operation is undefined.

Worked Example: Addition

[2140]+[3โˆ’516]=[2+31+(โˆ’5)4+10+6]=[5โˆ’456]\begin{bmatrix} 2 & 1 \\ 4 & 0 \end{bmatrix} + \begin{bmatrix} 3 & -5 \\ 1 & 6 \end{bmatrix} = \begin{bmatrix} 2+3 & 1+(-5) \\ 4+1 & 0+6 \end{bmatrix} = \begin{bmatrix} 5 & -4 \\ 5 & 6 \end{bmatrix}

Worked Example: Subtraction

[72โˆ’18]โˆ’[3542]=[7โˆ’32โˆ’5โˆ’1โˆ’48โˆ’2]=[4โˆ’3โˆ’56]\begin{bmatrix} 7 & 2 \\ -1 & 8 \end{bmatrix} - \begin{bmatrix} 3 & 5 \\ 4 & 2 \end{bmatrix} = \begin{bmatrix} 7-3 & 2-5 \\ -1-4 & 8-2 \end{bmatrix} = \begin{bmatrix} 4 & -3 \\ -5 & 6 \end{bmatrix}

๐Ÿ’ก Line the two matrices up like grids and march through them position by position. Watch the signs carefully on subtraction.

Concept Check ๐ŸŽฏ

Scalar Multiplication

A scalar is just a single number. To multiply a matrix by a scalar, multiply every entry by that scalar:

3[2โˆ’104]=[3โ‹…23โ‹…(โˆ’1)3โ‹…03โ‹…4]=[6โˆ’3012]3 \begin{bmatrix} 2 & -1 \\ 0 & 4 \end{bmatrix} = \begin{bmatrix} 3\cdot 2 & 3\cdot(-1) \\ 3\cdot 0 & 3\cdot 4 \end{bmatrix} = \begin{bmatrix} 6 & -3 \\ 0 & 12 \end{bmatrix}

This even handles a negative scalar โ€” multiplying by โˆ’1-1 flips every sign:

โˆ’1[5โˆ’237]=[โˆ’52โˆ’3โˆ’7]-1 \begin{bmatrix} 5 & -2 \\ 3 & 7 \end{bmatrix} = \begin{bmatrix} -5 & 2 \\ -3 & -7 \end{bmatrix}

๐Ÿ”‘ Key Idea: Subtraction is really "add the opposite." Aโˆ’B=A+(โˆ’1)BA - B = A + (-1)B, which is why both operations need matching dimensions.

Scalar & Combined Practice ๐Ÿงฎ

Let A=[4โˆ’215]A = \begin{bmatrix} 4 & -2 \\ 1 & 5 \end{bmatrix} and B=[30โˆ’12]B = \begin{bmatrix} 3 & 0 \\ -1 & 2 \end{bmatrix}.

1) In 2A2A, what is the top-right entry? 2) In Aโˆ’BA - B, what is the bottom-left entry? 3) In A+3BA + 3B, what is the top-left entry?

Properties of Addition ๐Ÿ”ฝ

These operations behave just like ordinary numbers. Fill in each property (assume A,BA, B have matching dimensions).

Part 3: Matrix Multiplication

๐Ÿ”ข Matrix Operations

Part 3 of 5 โ€” Matrix Multiplication


๐Ÿ”‘ Why it's different: Matrix multiplication is not entry-by-entry. Instead, each output entry is a row-times-column dot product. Get the setup right and the arithmetic is easy.

When Can You Multiply? The Inner-Match Rule

To multiply Aร—BA \times B, the number of columns in AA must equal the number of rows in BB.

AโŸmร—nโ€…โ€Šโ‹…โ€…โ€ŠBโŸnร—pโ€…โ€Š=โ€…โ€ŠCโŸmร—p\underbrace{A}_{m \times \textcolor{red}{n}} \;\cdot\; \underbrace{B}_{\textcolor{red}{n} \times p} \;=\; \underbrace{C}_{m \times p}

  • The inner numbers must match โ†’ tells you if multiplication is allowed.
  • The outer numbers give the size of the product.

Examples

AABBAllowed?Product size
2ร—32 \times 33ร—43 \times 4โœ… inner 3=33=32ร—42 \times 4
3ร—23 \times 22ร—22 \times 2โœ… inner 2=22=23ร—23 \times 2
2ร—32 \times 32ร—32 \times 3โŒ inner 3โ‰ 23 \ne 2undefined

โš ๏ธ Because the inner numbers must match, ABAB being defined does not mean BABA is defined. Order matters!

Can You Multiply? ๐Ÿ”ฝ

For each pair, decide whether the product ABAB exists and, if so, its dimensions.

How to Multiply: Row ยท Column

Entry cijc_{ij} of the product comes from row ii of AA dotted with column jj of BB: multiply matching pieces, then add.

Worked Example: 2ร—22 \times 2 times 2ร—22 \times 2

[1234][5678]\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 5 & 6 \\ 7 & 8 \end{bmatrix}

Compute each entry by pairing a row with a column:

c11=(1)(5)+(2)(7)=5+14=19c_{11} = (1)(5) + (2)(7) = 5 + 14 = 19 c12=(1)(6)+(2)(8)=6+16=22c_{12} = (1)(6) + (2)(8) = 6 + 16 = 22 c21=(3)(5)+(4)(7)=15+28=43c_{21} = (3)(5) + (4)(7) = 15 + 28 = 43 c22=(3)(6)+(4)(8)=18+32=50c_{22} = (3)(6) + (4)(8) = 18 + 32 = 50

=[19224350]= \begin{bmatrix} 19 & 22 \\ 43 & 50 \end{bmatrix}

๐Ÿ’ก Say it out loud: "row 1, column 1" gives the top-left; "row 2, column 1" gives the bottom-left. The row index follows AA, the column index follows BB.

Build the Product ๐Ÿงฎ

Multiply [2013][4โˆ’152]\begin{bmatrix} 2 & 0 \\ 1 & 3 \end{bmatrix} \begin{bmatrix} 4 & -1 \\ 5 & 2 \end{bmatrix}. Find each requested entry.

1) c11c_{11} (row 1 ยท column 1) =โ€‰?= \,? 2) c12c_{12} (row 1 ยท column 2) =โ€‰?= \,? 3) c21c_{21} (row 2 ยท column 1) =โ€‰?= \,?

Concept Check ๐ŸŽฏ

Part 4: Special Matrices & Determinants

๐Ÿ”ข Matrix Operations

Part 4 of 5 โ€” Special Matrices & Determinants


๐Ÿ”‘ Big Payoff: A few special matrices and the determinant unlock the most useful application of all โ€” solving systems of equations. This part sets that up.

Special Matrices

A square matrix has the same number of rows and columns (nร—nn \times n).

Identity matrix II โ€” has 11s on the main diagonal (top-left to bottom-right) and 00s elsewhere. It is the multiplicative "1" of matrices: AI=IA=AAI = IA = A.

I2=[1001],I3=[100010001]I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}, \qquad I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}

Zero matrix OO โ€” all entries are 00. It is the additive "0": A+O=AA + O = A.

MatrixRoleActs like the number
Identity IIAI=AAI = A11 (multiplication)
Zero OOA+O=AA + O = A00 (addition)

๐Ÿ’ก The identity only "does nothing" when it's the right size to multiply AA โ€” its dimension must match.

Concept Check ๐ŸŽฏ

The Determinant of a 2ร—22 \times 2 Matrix

For a square matrix, the determinant is a single number that tells you key facts about it. For a 2ร—22 \times 2:

A=[abcd]โ€…โ€ŠโŸนโ€…โ€Šdetโก(A)=adโˆ’bcA = \begin{bmatrix} a & b \\ c & d \end{bmatrix} \;\Longrightarrow\; \det(A) = ad - bc

Multiply the main diagonal, subtract the off-diagonal.

Worked Example

detโก[3524]=(3)(4)โˆ’(5)(2)=12โˆ’10=2\det\begin{bmatrix} 3 & 5 \\ 2 & 4 \end{bmatrix} = (3)(4) - (5)(2) = 12 - 10 = 2

Worked Example (with negatives)

detโก[6โˆ’142]=(6)(2)โˆ’(โˆ’1)(4)=12โˆ’(โˆ’4)=16\det\begin{bmatrix} 6 & -1 \\ 4 & 2 \end{bmatrix} = (6)(2) - (-1)(4) = 12 - (-4) = 16

โš ๏ธ Watch the signs! The formula is adโˆ’bcad - bc, so a negative bb or cc can flip the sign of the subtracted term.

๐Ÿ”‘ Why it matters: If detโก(A)=0\det(A) = 0, the matrix has no inverse and the related system has no unique solution. A nonzero determinant means the matrix is invertible.

Compute Determinants ๐Ÿงฎ

Use detโก[abcd]=adโˆ’bc\det\begin{bmatrix} a & b \\ c & d \end{bmatrix} = ad - bc.

1) detโก[4312]=โ€‰?\det\begin{bmatrix} 4 & 3 \\ 1 & 2 \end{bmatrix} = \,? 2) detโก[50โˆ’23]=โ€‰?\det\begin{bmatrix} 5 & 0 \\ -2 & 3 \end{bmatrix} = \,? 3) detโก[2613]=โ€‰?\det\begin{bmatrix} 2 & 6 \\ 1 & 3 \end{bmatrix} = \,?

Reading the Determinant ๐Ÿ”ฝ

Part 5: Mixed Practice & Mastery Check

๐Ÿ”ข Matrix Operations

Part 5 of 5 โ€” Mixed Practice & Mastery Check


You can now (1) describe matrices by size and entry, (2) add, subtract, and scale them, (3) multiply with the rowยทcolumn rule, and (4) find determinants. Let's put it all together.

Quick Reference

OperationRuleRequirement
Add / Subtractentry-by-entrysame dimensions
Scalar ร—\times matrixmultiply every entryalways allowed
Multiply Aโ€‰BA\,Brow ยท column dot productscols of AA = rows of BB
Determinant (2ร—22\times2)adโˆ’bcad - bcsquare matrix

โš ๏ธ Three traps to remember: (1) add/subtract only with matching shapes, (2) matrix multiplication is not commutative, (3) for detโก\det, it's adโˆ’bcad - bc โ€” mind the signs.

Mixed Practice ๐ŸŽฏ

One More Round ๐Ÿงฎ

Let A=[2โˆ’351]A = \begin{bmatrix} 2 & -3 \\ 5 & 1 \end{bmatrix} and B=[40โˆ’16]B = \begin{bmatrix} 4 & 0 \\ -1 & 6 \end{bmatrix}.

1) Bottom-right entry of A+BA + B =โ€‰?= \,? 2) detโก(A)=โ€‰?\det(A) = \,? 3) Top-left entry of the product ABAB (row 1 ยท column 1) =โ€‰?= \,?

Exit Quiz โœ…

Answer all three to finish the lesson.