Evanalysis
2.1Estimated reading time: 19 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

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 00, 11, 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 mm rows and nn 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 11, column 33 can play a completely different role from the same number placed in row 33, column 11. 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 55 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 row-column map

The visual explanation below slows down the most important habit in this section: first read the matrix as a positioned object, then decide what the notation or operation is allowed to mean.

Read a matrix by position

Follow the basic row-column map behind matrix size, entry notation, equality, and coefficient columns.

  1. Read the size first

    A 2 x 3 matrix has two rows and three columns. That size determines which comparisons and operations are even defined.

  2. Locate entries by row and column

    The notation a_23 means row 2, column 3. In the sample matrix, that position contains the entry 4.

  3. Check equality entry by entry

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

  4. One mismatch is enough

    Changing only one entry changes the whole matrix, because the matrix remembers both values and positions.

  5. Keep the variable order

    In a coefficient matrix, column 2 has meaning only after the variable order has been fixed.

Before doing row reduction or multiplication, read the matrix as a positioned object: first its size, then the row and column of each entry, then whether another matrix has the same positioned data.

Read the size before you touch the entries

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

  • mm is the number of rows.
  • nn 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 ii and column jj. That notation matters because it tells you exactly where a number lives inside the array.

Worked example

Reading a matrix carefully

Let

A=[1203−14].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 \times 3. Its entry in row 2, column 3 is 44.

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 ii and column index jj.

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.

A matrix is determined by its ordered columns

The equality definition has a useful consequence: complete column information is enough to reconstruct a matrix. We do not need to compare the whole display at once, but we do need every column in its specified position.

Theorem

Coordinate reconstruction and equality

Given an ordered list c1,…,cnc_1,\ldots,c_n of column vectors in Rm\mathbb R^m, there is exactly one m×nm\times n matrix with these columns. Its entry aija_{ij} is the iith entry of cjc_j. Consequently, two matrices of this size are equal if and only if their corresponding columns are equal. The analogous statement holds for their ordered rows.

Proof

Existence and uniqueness come directly from the entries

For existence, place the iith coordinate of the jjth supplied vector in position (i,j)(i,j). Every required position receives exactly one real number, and each column then has the prescribed entries in the prescribed order.

For uniqueness, let BB be any other matrix with the same ordered columns. For each column index jj and each row index ii, its entry bijb_{ij} must be the iith coordinate of cjc_j, hence must equal aija_{ij}. The matrices have the same size and all corresponding entries agree, so they are equal by definition. Conversely, equal matrices have equal entries in each column, which makes the corresponding column vectors equal. Grouping the same argument by row instead of by column proves the row version.

Notice that this proof has both an existence part and an at-most-one part. The word “ordered” is also essential. A set of column vectors forgets which column comes first and forgets repetitions. Neither piece of information may be lost when reconstructing a matrix. A row vector and a column vector containing the same numbers likewise have different shapes; the theorem never identifies them merely because the printed numbers agree.

Worked example

Reconstruct a matrix and test a second description

Suppose the first, second, and third columns of AA are respectively

c1=[2−1],c2=[04],c3=[−35].c_1=\begin{bmatrix}2\\-1\end{bmatrix},\qquad c_2=\begin{bmatrix}0\\4\end{bmatrix},\qquad c_3=\begin{bmatrix}-3\\5\end{bmatrix}.

There are three columns of length two, so

A=[20−3−145].A=\begin{bmatrix}2&0&-3\\-1&4&5\end{bmatrix}.

The first row is [2 0 −3][2\ 0\ {-3}], and a23=5a_{23}=5. A second description says that the rows of AA are [2 0 −3][2\ 0\ {-3}] and [−1 4 5][-1\ 4\ 5]. Reading each position confirms that both descriptions determine the same matrix. If that second row were [−1 5 4][-1\ 5\ 4], the descriptions would conflict in two positions; there would be no matrix satisfying both. Having the same collection of numbers does not resolve the conflict.

If c1c_1 and c2c_2 are exchanged, the new first entry becomes zero instead of two. The result is another matrix, even though the list of available columns has not changed. This is the same positional issue that arises when columns record coefficients of differently ordered variables.

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 cc 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 cAcA is the matrix obtained by multiplying every entry of AA by cc: (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=[1−203],B=[41−52].A = \begin{bmatrix} 1 & -2 \\ 0 & 3 \end{bmatrix}, \qquad B = \begin{bmatrix} 4 & 1 \\ -5 & 2 \end{bmatrix}.

Then

A+B=[5−1−55],2A=[2−406].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 00. For each size it plays the role of the additive identity:

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

Which operations can be cancelled?

The entrywise definitions let us justify familiar algebraic moves before matrix multiplication is introduced. An equality between matrix expressions can be solved by scalar arithmetic at each position, provided all the expressions have the required size. Cancellation is a conclusion from those definitions, not a permission to treat every matrix operation like multiplication of numbers.

Theorem

Cancellation for entrywise operations

Let A,B,CA,B,C be real matrices of the same size. If A+C=B+CA+C=B+C, then A=BA=B. For a fixed real scalar λ≠0\lambda\ne0, if λA=λB\lambda A=\lambda B, then A=BA=B. The nonzero hypothesis in the second statement is necessary.

Proof

Reduce cancellation to one arbitrary position

From A+C=B+CA+C=B+C, the equality definition gives aij+cij=bij+cija_{ij}+c_{ij}=b_{ij}+c_{ij} at every position. Cancelling the real number cijc_{ij} gives aij=bija_{ij}=b_{ij}. Since the indices were arbitrary, matrix equality follows. Likewise, λA=λB\lambda A=\lambda B gives λaij=λbij\lambda a_{ij}=\lambda b_{ij}; division by the nonzero real number λ\lambda gives equality at every position. If λ=0\lambda=0, both scalar multiples are the zero matrix for any A,BA,B, so their equality no longer forces the original matrices to agree.

The proofs also explain how to solve a basic matrix equation. In 2X+B=C2X+B=C, a solution must have entries xij=(cij−bij)/2x_{ij}=(c_{ij}-b_{ij})/2. Conversely, assigning those entries produces a matrix satisfying the equation, since substitution recovers every entry of CC. Thus the formula both constructs a solution and shows there cannot be another one. The matching-size condition is checked before this calculation; subtraction cannot repair incompatible dimensions.

For a concrete check, take

B=[1−230],C=[54−16].B=\begin{bmatrix}1&-2\\3&0\end{bmatrix},\qquad C=\begin{bmatrix}5&4\\-1&6\end{bmatrix}.

Then X=[23−23]X=\begin{bmatrix}2&3\\-2&3\end{bmatrix}, and doubling its entries and adding the corresponding entries of BB recovers CC. If the coefficient of XX were zero instead, the equation would reduce to B=CB=C: every same-size matrix would solve it when that equality holds, and none would solve it when it fails. This is the matrix version of interpreting a zero-coefficient scalar equation, rather than attempting an illegal division.

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+2x2−x3=4,3x1−x2+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=[12−13−15],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

2x1−x3=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+0x2−x3=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=[20−1−143],b=[5−2].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 00 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

Checkpoint

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

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

Solution · Answer

No. Matrix addition is only defined for matrices of the same size.

Checkpoint

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

Name both the row and the column.

Solution · Answer

It is the entry in row 3 and column 1 of AA.

Exercise

Checkpoint

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

Keep the order of the variables fixed.

Solution · Guided solution

Using the variable order (x1,x2)(x_1, x_2), the coefficient matrix is

[1−121],\begin{bmatrix} 1 & -1 \\ 2 & 1 \end{bmatrix},

and the constant vector is

[30].\begin{bmatrix} 3 \\ 0 \end{bmatrix}.

Exercise: reconcile partial information before calculating

A 2×32\times3 matrix has first row [1 2 3][1\ 2\ 3] and second column [25]\begin{bmatrix}2\\5\end{bmatrix}. Describe every such matrix. Then decide what changes if the second column is instead [45]\begin{bmatrix}4\\5\end{bmatrix}. Explain which answer involves free entries and which involves inconsistent data.

Solution · Solution: shared positions must agree

The two descriptions overlap at position (1,2)(1,2). In the first case, both give the value two, so they are compatible. The second column fixes the middle entry in the second row, leaving only its first and last entries unspecified. Thus all the matrices, and no others, are

[123s5t],s,t∈R.\begin{bmatrix}1&2&3\\s&5&t\end{bmatrix},\qquad s,t\in\mathbb R.

Every choice of the two real numbers has the required row and column; conversely, any matrix with those data must have exactly this form. In the second case, the same position would have to contain both two and four. There is no matrix satisfying the data. No choice of the unspecified entries can remove that conflict. This separates incomplete information, which may permit many matrices, from incompatible information, which permits none.

This exercise also explains the scope of the reconstruction proposition. A complete ordered list of columns fixes every entry and gives exactly one matrix. A partial row-and-column description need not do so. Before counting unknown entries, first check the positions constrained in two different ways; otherwise a count of apparently free entries can conceal an impossibility.

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.2 Matrix multiplication, identity matrices, and linear systems.

Practice

Work out your answer, then check it. You can revise and try again.

Loading…

Prerequisites

This section can be read on its own.

Key terms in this unit