No history yet

Introduction to Matrices

What is a Matrix?

A matrix is simply a rectangular grid of numbers, arranged in rows and columns. Think of it like a spreadsheet or a calendar. It's a way to organize related data in a structured way.

For example, if a small bakery sells three types of bread (sourdough, rye, and whole wheat) over two days, they could track their sales in a matrix. Each row could represent a type of bread, and each column could represent a day.

Bread TypeMondayTuesday
Sourdough2522
Rye1518
Whole Wheat3035

This grid is a matrix. We describe its size, or dimensions, by its number of rows and columns, always in that order: rows by columns. The bakery's matrix has 3 rows and 2 columns, so it's a 3×23 \times 2 matrix.

A general matrix might look like this, where each element is identified by its row and column number.

A=(a11a12a1na21a22a2nam1am2amn)A = \begin{pmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{pmatrix}

Here, mm is the number of rows and nn is the number of columns. The element a21a_{21} is in the second row and the first column.

Common Matrix Types

Matrices come in a few common shapes and forms. The names help us quickly understand their properties.

  • A rectangular matrix is any matrix where the number of rows and columns are not equal, like our 3×23 \times 2 bakery example.
  • A square matrix has the same number of rows and columns. For example, a 2×22 \times 2 or a 4×44 \times 4 matrix.
Square Matrix: (9317)\text{Square Matrix: } \begin{pmatrix} 9 & 3 \\ 1 & 7 \end{pmatrix}

Within square matrices, there are a couple of special cases.

A diagonal matrix is a square matrix where all the numbers are zero, except for the ones on the main diagonal (from the top left to the bottom right).

Diagonal Matrix: (500020001)\text{Diagonal Matrix: } \begin{pmatrix} 5 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & -1 \end{pmatrix}

An identity matrix is a special kind of diagonal matrix. All the numbers on its main diagonal are 1. It's often denoted by II. The identity matrix is important for more advanced operations, acting a bit like the number 1 in regular multiplication.

I=(100010001)I = \begin{pmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}

Basic Operations

You can perform arithmetic with matrices, but with a few rules. The most straightforward operations are addition, subtraction, and scalar multiplication.

Key rule: To add or subtract two matrices, they must have the exact same dimensions.

When you add or subtract, you simply perform the operation on the corresponding elements. If you have matrix A and matrix B, you add the element in the first row, first column of A to the element in the first row, first column of B. And so on for every position.

Let's say we have two matrices representing sales from two different bakery locations.

A=(25221518)B=(20281210)A = \begin{pmatrix} 25 & 22 \\ 15 & 18 \end{pmatrix} \quad B = \begin{pmatrix} 20 & 28 \\ 12 & 10 \end{pmatrix}

To find the total sales, we add them together:

A+B=(25+2022+2815+1218+10)=(45502728)A + B = \begin{pmatrix} 25+20 & 22+28 \\ 15+12 & 18+10 \end{pmatrix} = \begin{pmatrix} 45 & 50 \\ 27 & 28 \end{pmatrix}

Subtraction works the same way. You just subtract the corresponding elements.

What about multiplying a matrix by a single number? This is called scalar multiplication. A scalar is just a regular number (not a matrix). To do this, you multiply every single element in the matrix by that scalar.

Imagine the owner of the first bakery wants to project sales for a 3-day holiday weekend, guessing they'll be triple the Monday-Tuesday numbers. They can multiply matrix A by the scalar 3.

3A=3×(25221518)=(3×253×223×153×18)=(75664554)3A = 3 \times \begin{pmatrix} 25 & 22 \\ 15 & 18 \end{pmatrix} = \begin{pmatrix} 3 \times 25 & 3 \times 22 \\ 3 \times 15 & 3 \times 18 \end{pmatrix} = \begin{pmatrix} 75 & 66 \\ 45 & 54 \end{pmatrix}

These basic operations are the building blocks for working with matrices.