On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Algebra Fundamentals · Grade 9-12

Matrix Definition

A matrix is a rectangular array of numbers in m rows and n columns; each entry aij lives at row i, column j.

A=[aij]m×n where 1≤i≤m and 1≤j≤n

Quick Answer

A matrix is a rectangular array of numbers in m rows and n columns; each entry aij lives at row i, column j. Use one to keep a whole table of related numbers together, such as the coefficients of a system of equations, the results of a tournament, or the prices at several shops. The size is always given as rows by columns, so a matrix with 2 rows and 3 columns is 2×3. Once data is in matrix form you can add, scale and multiply whole tables at once.

Why This Matters

Naming a table as one object A, with a size and an address for every entry, is what lets you add tables, multiply them and solve systems with them. Later rules are decided by size alone: two matrices can be added only if their sizes match, and multiplied only if the inner sizes agree. Calling a 2×3 matrix 3×2 makes every one of those checks come out wrong.

Intuitive Explanation

A café sells small and large drinks at two branches. Put the day's sales in a table, with row 1 for the North branch, row 2 for the South branch, column 1 for small and column 2 for large: S=[40253218]. That grid is a matrix. It has 2 rows and 2 columns, so it is 2×2, and the entry s21=32 says the South branch sold 32 small drinks.

An entry's address gives the row first and the column second, the same order as the size. In A=[123456], which is 2×3, the entry a13 is 3 (row 1, column 3), while a31 does not exist because there is no third row. Rows run across; columns run down.

The shape carries meaning as well as the numbers. A single row such as [725] is a 1×3 matrix, also called a row vector, and a single column is an n×1 column vector. A matrix with as many rows as columns is square, and only square matrices have determinants and inverses.

Not every collection of numbers is a matrix. The point (3,4) is an ordered pair naming one location, not a grid. A layout with 3 numbers in the first row and 2 in the second is not a matrix either: every row must have the same length, or the column positions mean nothing.

Think of it like this. A matrix is like a theatre seating chart with no gaps: every seat has a row and a seat number, and you say the row first, so seat a23 is row 2, seat 3. Unlike a real theatre, a matrix cannot have a short back row; every row has exactly n seats.

Core idea. A matrix is a rectangular array where each entry is pinned by its row and column address.


When to Use

Use a matrix when numbers fall naturally into a grid with a meaning for each row and each column: sales by store and product, the coefficients of x and y in each equation of a system, points scored by each team in each round. State the size as rows by columns before doing anything else. If you have a single list of components, such as a displacement, treat it as a vector. If you need one number that describes a square matrix, find its determinant.

Tip. Ask: Are the numbers arranged in a fixed rectangle of rows and columns with a stated size?

How to Recognize It

Before treating numbers as a matrix, check what the rows stand for, what the columns stand for, and whether every row is complete.

  1. Does every row have the same number of entries, with no gaps?

    Yes means the numbers form a true matrix. A ragged list, such as one week with 5 entries and the next with 3, is not a matrix until the missing values are filled in, even if only with zeros.

  2. Is there only one row or only one column?

    A single row or column is still a matrix, but it is usually treated as a vector, a list of components such as a displacement ⟨3,−1⟩. Two or more of each means a full grid.

  3. Is the question about the layout, such as the size or one entry, rather than a single number computed from it?

    Questions like "what is a32" or "what size is B" stay with the definition. A request for one number that summarises a square matrix, such as whether it can be undone, points to the determinant.

  4. Are there just two numbers in parentheses naming a place on a graph?

    A pair like (4,−2) is a coordinate point, a location in the plane. It is not a grid of data, even though it holds two numbers side by side.

Matrix Definition compared with Vector, Determinant, and Coordinate point

Each row is a way of packaging numbers, so they look similar when written down. Ask whether you have a full rectangle with meaning in both directions, one list, one location, or a single number calculated from a square grid.

Matrix Definition

Meaning
Use this when numbers are organized in a rectangular grid you want to treat as a single object.
Key test
Are the numbers arranged in a fixed rectangle of rows and columns with a stated size?
Formula
A=[aij]m×n where 1≤i≤m and 1≤j≤n
Example
Given A=[5−10274], state its dimensions and a23.

Vector

Meaning
A matrix with a single row or single column.
Key test
Use when there is one row or one column representing a list or arrow.
Formula
⟨v1,v2⟩
Example
[34]

Determinant

Meaning
A single number computed FROM a square matrix.
Key test
Use when you reduce a square matrix to one scalar, not describe its layout.
Formula
ad−bc
Example
det⁡[1234]=−2

Coordinate point

Meaning
An ordered location (x,y), not a grid of numbers.
Key test
Use when naming a position in the plane.
Formula
(x,y)
Example
(3,4)

Formula & Notation

A=[aij]m×n where 1≤i≤m and 1≤j≤n
A matrix A∈Rm×n is a function A:{1,…,m}×{1,…,n}→R, written as a rectangular array [aij] where aij=A(i,j). The set Rm×n forms a vector space of dimension mn.

How to read it: Matrices are denoted by capital letters (A, B, C). Entry in row i, column j is written aij. Dimensions are written m×n (rows × columns).

Worked Examples

Example 1 — Name an entry and dimensions

Easy

Given A=[5−10274], state its dimensions and a23.
Show the steps and the answer
  1. Count the rows: 5,−1,0 and 2,7,4 make 2 rows.

    Rows run across, and the row count is written first in the size.

  2. Count the columns: each row holds 3 entries, so there are 3 columns.

    Every row of a matrix has the same length, so one row gives the column count.

  3. Write the size: 2×3.

    Size is always rows by columns.

  4. Find a23: go to row 2, which is 2,7,4, and take its third entry, 4.

    The first subscript picks the row and the second picks the column.

Answer: 2×3, a23=4

Takeaway: Count rows, then columns, and read aij as row i, column j.

Example 2 — A vector, not a general matrix

Standard

Is [34] a 2×2 matrix?
Show the steps and the answer
  1. Count the rows: 3 and 4 sit one above the other, so there are 2 rows.

    Each entry here is on its own line.

  2. Count the columns: each row holds one entry, so there is 1 column.

    A 2×2 matrix would need two entries in every row, four entries in all.

  3. Name the shape: a 2×1 matrix, also called a column vector.

    A single-column matrix is the shape used for the unknowns x and the constants b in Ax=b.

Answer: 2×1 (a column vector)

Takeaway: Two numbers do not make a square: count the entries in one row to get the number of columns.

Example 3 — Find the mistake: rows before columns

Application

For B=[104235−160278], Tom writes: "B is 4×3, and b32=−1." Find the mistakes and correct them.
Show the steps and the answer
  1. Count the rows: there are 3 lines of numbers.

    The size starts with the number of rows.

  2. Count the columns: each row has 4 entries, so B is 3×4.

    Tom gave the columns first; a 4×3 matrix would have 4 rows of 3 entries.

  3. Find b32: row 3 is 0,2,7,8, and its second entry is 2.

    The first subscript names the row, so b32 sits in the bottom row.

  4. Locate Tom's −1: it is in row 2, column 3, so it is b23.

    He swapped the subscripts the same way he swapped the size.

Answer: B is 3×4, and b32=2.

Takeaway: Rows come first in both the size and the subscripts; reading either one columns-first points to a different matrix or a different entry.

Where You'll See It

  • A bakery's weekly sales table

    Sales of bread, cakes and pies at two shops form a 2×3 matrix such as [1204530956025]. Entry a22=60 is cakes sold at shop 2, and next week's table, with the same layout, can be added to this one in a single step.

  • Pixels in a digital photo

    A grayscale image 1080 pixels tall and 1920 wide is stored as a 1080×1920 matrix of brightness values from 0 (black) to 255 (white). The entry in row 1, column 1 is the top-left pixel, and brightening the photo adds the same amount to every entry.

  • Storing a system of equations

    The system 2x+3y=7, x−y=1 is stored as the coefficient matrix [231−1]: row 1 holds the first equation and column 2 holds every y coefficient. Graphing calculators and computer programs solve systems from exactly this grid.

Common Mistakes

  1. The slip: Stating dimensions columns-first

    Instead: always write m×n as rows × columns.

  2. The slip: Mixing up the entry subscript order

    Instead: aij is row i then column j, not the reverse.

  3. The slip: Calling a non-rectangular set of numbers a matrix

    Instead: every row must have the same number of entries.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. State the dimensions of B=[140−263].

    Hint: Count rows first, then columns.

  2. For C=[29−1508], find c12 and c21.

    Hint: The first subscript is the row; the second is the column.

  3. How many entries does a 4×5 matrix have, and how many entries are in each row?

    Hint: The second number tells how many columns there are.

  4. Write the 2×3 matrix A whose entries are aij=i+2j.

    Hint: For each entry, i is its row and j is its column.

  5. A store records daily sales of 3 products over 4 days. Should this be stored as a matrix, a single vector or a coordinate point?

    Hint: How many separate lists of numbers are there?

  6. A student says [12345678] is a 4×2 matrix. Correct the student.

    Hint: Which comes first in the size: rows or columns?

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

Is a single number a matrix?

Technically yes: the number 7 can be written as the 1×11\times1 matrix [7][7], with one row and one column. It usually appears as the result of a calculation, for instance when a 1×31\times3 row times a 3×13\times1 column gives a 1×11\times1 answer. Most books then treat it as an ordinary number. The size still matters in theory: as a matrix, [7][7] times BB is defined only when BB has one row, while the number 7 can scale any matrix.

Why is the size written rows first and not columns first?

It is a convention, like driving on one side of the road: the choice is arbitrary, but everyone has to agree. It matches the entry label aija_{ij}, where ii is the row. It also makes the multiplication rule easy to read: in (2×3)(3×4)(2\times3)(3\times4) the inner numbers must match, and the outer numbers, 2×42\times4, give the size of the answer.

Can a matrix hold things other than numbers?

In school algebra the entries are numbers, but the grid idea reaches much further. A digital photo is a matrix of pixel brightness values; a greyscale image 1920 pixels wide and 1080 tall is a 1080×19201080\times1920 matrix. Entries can also be variables, as in [x20y]\begin{bmatrix}x&2\\0&y\end{bmatrix}. What makes it a matrix is the rectangle and the row-column addressing, not the type of entry.

Are two matrices with the same numbers always equal?

Only if the sizes match and every number sits in the same position. [12]\begin{bmatrix}1&2\end{bmatrix} is 1×21\times2 and [12]\begin{bmatrix}1\\2\end{bmatrix} is 2×12\times1, so they are different matrices even though both contain 1 and 2. Swapping two entries also gives a different matrix. This is why an equation between two 2×22\times2 matrices gives four separate equations, one per position.

Learning Path

You need Systems of Equations (whose coefficients fill a matrix) and Variables first. This concept adds the matrix as one object with a size m×n and an address aij for every entry. Next come Matrix Addition, Subtraction, and Scalar Multiplication, then Matrix Multiplication, and the Determinant, a single number computed from a square matrix.

See Also