Evanalysis
2.1Embedded interactionEstimated reading time: 10 min

2.1 Matrix basics

Read matrices carefully as mathematical objects: size, entries, equality, basic operations, and how systems of equations become matrix statements.

Course contents

MATH1030: Linear algebra I

Linear algebra notes.

37 sections

Matrices first appear in the course as a convenient way to record a system of linear equations. Very quickly, though, they become objects in their own right. To work rigorously later, you need to separate several ideas that beginners often blur together:

  • what a matrix is;
  • when two matrices are equal;
  • which operations are defined before multiplication even enters the story;
  • how a matrix records the data of a linear system.

This note lays down that language carefully.

Before you start

This section does not assume that you already know matrix theory. It does, however, assume a few earlier habits from algebra and the first systems note.

You should be able to:

  • read variables such as x1x_1, x2x_2, and x3x_3 as distinct unknowns;
  • recognize coefficients in a linear equation, including coefficients equal to 0, 1, and 1-1;
  • keep an ordered tuple such as (2,1,4)(2,-1,4) in the correct order;
  • do basic signed arithmetic entry by entry.

If any of these feel rusty, the right way to read this page is still not to memorize vocabulary first. Instead, pause at each worked example and ask: which row, which column, and which position is being used?

What a matrix is

Definition

Matrix

A matrix is a rectangular array of numbers arranged in rows and columns.

If a matrix has m rows and n columns, we say it is an m×nm \times n matrix. The entries are usually real numbers in this course, although the formal definitions make sense over other number systems as well.

The point of the rectangular format is not decoration. A row records one line of data, a column records another line of data, and the position of an entry matters. Later, multiplication and row operations will depend on that position.

This is why a matrix should not be treated as a loose list of numbers. The entry in row 1, column 3 can play a completely different role from the same number placed in row 3, column 1. In a coefficient matrix, for example, columns are tied to the chosen order of the variables. If the variable order is (x1,x2,x3)(x_1, x_2, x_3), then the second column records coefficients of x2x_2. If the order is changed to (x2,x1,x3)(x_2, x_1, x_3), the displayed matrix must change as well.

Common mistake

Do not separate a coefficient from its position

The number 5 by itself does not say which variable it multiplies. In a coefficient matrix, the column position tells you that information. Moving a column changes the encoded system unless the variable order is changed at the same time.

Matrix anatomy: size, rows, columns, and one named entry
1203-14row 2column 3entry a_23 = 4

2 rows by 3 columns, so the size is 2 x 3

The first subscript chooses the row. The second subscript chooses the column.

Read the size before you touch the entries

The size of a matrix is written as m×nm × n.

  • m is the number of rows.
  • n is the number of columns.

If m=nm = n, the matrix is square.

Two matrices with different sizes are different kinds of objects. A 2×32 \times 3 matrix and a 3×23 \times 2 matrix are not even comparable entry by entry, because their row-column positions do not match.

Read entries one by one

If AA is a matrix, then aija_{ij} means the entry in row i and column j. That notation matters because it tells you exactly where a number lives inside the array.

Worked example

Reading a matrix carefully

Let

A=[120314].A = \begin{bmatrix} 1 & 2 & 0 \\ 3 & -1 & 4 \end{bmatrix}.

This matrix has 2 rows and 3 columns, so its size is 2×32 × 3. Its entry in row 2, column 3 is 4.

The notation aija_{ij} is not optional bookkeeping. It is the language used in definitions such as matrix equality, matrix addition, and matrix multiplication.

For a first pass through this topic, practise reading before calculating. The interactive task below is deliberately simple: it trains the exact habits that later prevent mistakes in row reduction and matrix multiplication.

Read and try

Practise reading a matrix before calculating

Use the guided tasks to practise the basic moves needed before doing matrix calculations: size, entries, rows, columns, and coefficient positions.

120
3-14

What to notice

Count rows first. Count columns second. Do not reverse the order.

Try it yourself

What is the size of this matrix?

Matrix equality is entrywise

Two matrices are equal only when they have the same size and every corresponding entry matches.

Definition

Matrix equality

Let A=[aij]A = [a_{ij}] and B=[bij]B = [b_{ij}] be matrices.

Then A=BA = B if and only if:

  1. AA and BB have the same size, and
  2. aij=bija_{ij} = b_{ij} for every row index i and column index j.

This means that proving two matrices are equal is often an entry-by-entry argument.

Worked example

Using matrix equality to solve for an unknown entry

Suppose

[123x]=[1235].\begin{bmatrix} 1 & 2 \\ 3 & x \end{bmatrix} = \begin{bmatrix} 1 & 2 \\ 3 & 5 \end{bmatrix}.

The two matrices already agree in three positions. Equality of matrices forces the remaining position to agree as well, so x=5x = 5.

Addition and scalar multiplication come first

Before matrix multiplication appears, there are two basic operations you should already read confidently.

Definition

Addition and scalar multiplication

Let A=[aij]A = [a_{ij}] and B=[bij]B = [b_{ij}] be matrices of the same size, and let c be a scalar.

  • The sum A+BA + B is the matrix obtained by adding corresponding entries: (A+B)ij=aij+bij(A + B)_{ij} = a_{ij} + b_{ij}.
  • The scalar multiple cA is the matrix obtained by multiplying every entry of AA by c: (cA)ij=caij(cA)_{ij} = c a_{ij}.

The phrase "of the same size" is essential. Matrix addition is not defined for matrices of different sizes.

Worked example

Compute a sum and a scalar multiple

Let

A=[1203],B=[4152].A = \begin{bmatrix} 1 & -2 \\ 0 & 3 \end{bmatrix}, \qquad B = \begin{bmatrix} 4 & 1 \\ -5 & 2 \end{bmatrix}.

Then

A+B=[5155],2A=[2406].A + B = \begin{bmatrix} 5 & -1 \\ -5 & 5 \end{bmatrix}, \qquad 2A = \begin{bmatrix} 2 & -4 \\ 0 & 6 \end{bmatrix}.

Every entry is handled separately, but the size stays 2×22 \times 2.

The zero matrix is the matrix whose entries are all 0. For each size it plays the role of the additive identity:

A+O=A.A + O = A.

A matrix records a linear system compactly

One reason matrices matter so early is that they package a linear system in a form that is easier to transform systematically.

Consider the system

x1+2x2x3=4,3x1x2+5x3=7.\begin{aligned} x_1 + 2x_2 - x_3 &= 4, \\ 3x_1 - x_2 + 5x_3 &= 7. \end{aligned}

Its coefficient matrix is

A=[121315],A = \begin{bmatrix} 1 & 2 & -1 \\ 3 & -1 & 5 \end{bmatrix},

its unknown vector is

x=[x1x2x3],x = \begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix},

and its constant vector is

b=[47].b = \begin{bmatrix} 4 \\ 7 \end{bmatrix}.

So the whole system can be recorded as

Ax=b.Ax = b.

This compact form is not a shortcut that hides meaning. It gathers the same coefficients, variables, and constants into an object that later supports row operations, null-space language, and invertibility tests.

How to approach basic matrix questions

Most early matrix questions are not trying to surprise you. They are testing whether you can keep the bookkeeping straight. A reliable working order is:

  1. identify the requested object: size, entry, row, column, coefficient matrix, constant vector, sum, or scalar multiple;
  2. check whether the operation is defined before calculating;
  3. keep row and column order fixed;
  4. compute only the entries that the question asks for;
  5. state the answer with its size when the object is a matrix or vector.

Worked example

From wording to coefficient matrix

Question: using the variable order (x1,x2,x3)(x_1,x_2,x_3), write the coefficient matrix and constant vector for

2x1x3=5,x1+4x2+3x3=2.\begin{aligned} 2x_1 - x_3 &= 5,\\ -x_1 + 4x_2 + 3x_3 &= -2. \end{aligned}

First, rewrite the first equation with the missing x2x_2 coefficient shown:

2x1+0x2x3=5.2x_1 + 0x_2 - x_3 = 5.

Now each equation becomes one row, and the columns follow the fixed variable order (x1,x2,x3)(x_1,x_2,x_3). Therefore

A=[201143],b=[52].A = \begin{bmatrix} 2 & 0 & -1 \\ -1 & 4 & 3 \end{bmatrix}, \qquad b = \begin{bmatrix} 5 \\ -2 \end{bmatrix}.

The most common mistake is to omit the 0 in the first row. But the missing x2x_2 coefficient is part of the data, and column 2 must still exist.

A short preview of multiplication

The next note explains matrix multiplication carefully. For now, you only need to see why rows and columns matter so much. Changing one row of a left matrix or one column of a right matrix changes exactly the output entries built from them.

Use the embedded figure as a preview of that row-by-column rule.

Read and try

Follow one matrix product entry

The live widget updates each entry of AB as you change the entries of A and B.

Result

89
34

8 = 1×2 + 2×3

Common mistakes

Common mistake

Do not swap rows and columns

The first index is the row number, not the column number. a23a_{23} means row 2, column 3.

Common mistake

Different sizes cannot be added

Matrix addition is defined entrywise. If the positions do not line up, there is no operation to perform.

Quick check

Quick check

Can a 2×32 × 3 matrix be added to a 3×23 × 2 matrix?

Answer from the definition of matrix addition, not from visual guesswork.

Solution

Answer

Quick check

If AA is a 4×24 × 2 matrix, what does the symbol a31a_{31} mean?

Name both the row and the column.

Solution

Answer

Exercise

Quick check

Write the coefficient matrix and constant vector for the system x1x2=3x_1 - x_2 = 3, 2x1+x2=02x_1 + x_2 = 0.

Keep the order of the variables fixed.

Solution

Guided solution

If you want to see how a system becomes a matrix, review 1.1 Equations and solution sets. For the next algebraic operation, continue to 3.1 Matrix multiplication and identity matrices.

Section mastery checkpoint

Answer each question correctly to complete this section checkpoint. Correct progress: 0%.

Skills: matrix-basics, matrix-dimensions

Fill in the blank: a matrix with 4 rows and 3 columns has size ____.

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Syntax guidance: Use the form m x n or m×nm×n.

Skills: matrix-basics, entry-notation

Let A=[[1,2,0],[3,1,4]]A = [[1,2,0],[3,-1,4]]. What is a23a_23?

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Skills: matrix-basics, coefficient-matrix, linear-system

Using variable order (x1,x2,x3)(x_1,x_2,x_3), the equation 2x1x3=52x_1 - x_3 = 5 has coefficient ____ in column 2.

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Syntax guidance: Enter a single number.

Skills: matrix-basics, matrix-addition, definedness

True or false: every 2 x 3 matrix can be added to every 3 x 2 matrix.

Attempts used: 0

Attempts remaining: Unlimited attempts

Preview does not consume an attempt.

Submit records a graded attempt.

Prerequisites

This section can be read on its own.

Key terms in this unit

Premium learning add-ons

Core notes stay free. Advanced exercises, video explanations, and premium exports are available through paid plans.