Weeks
Mathematics 2Week 5 · Rank, Nullity and Linear Transformations
Week 5 Notes

Mathematics for
Data Science 2

Rank, nullity and linear maps: the null space and how to find its basis, the rank–nullity theorem, linear mappings and their matrices, and linear transformations with one-one and onto tests.

7 chapters43 worked examples~59 min read
Null spaceNullityRank–nullityLinear mapsOne-one and onto

Chapters

  1. 01The Null Space and NullityPart 1
  2. 02Finding a Basis of the Null SpacePart 2
  3. 03The Rank–Nullity TheoremPart 3
  4. 04What Is a Linear Mapping?Part 4
  5. 05Linear Transformations, One-one and OntoPart 5
  6. 06Practice Questions14 questions
  7. 07Week 5 Summary SheetAll parts
01
Rank and nullity · Part 1 of 5

The Null Space and Nullity

Every matrix AA sends some vectors to zero. This chapter is about that set: what it is, why it is always a subspace, and how big it is.

1.1Definition

The null space of a matrix AA of order m×nm\times n is the set of all vectors that AA sends to the zero vector:

N(A)={ x∈Rn  :  Ax=0 }N(A)=\{\, x\in \mathbb{R}^n \; :\; Ax=0\, \}

In other words, the null space is the set of all solutions of the homogeneous system Ax=0Ax=0. Each solution is a vector with nn entries, so the null space lives inside Rn\mathbb{R}^n.

Trap

The null space lives in Rn\mathbb{R}^n, where n = number of columns, not rows. The null space of a 2×32\times 3 matrix is in R3\mathbb{R}^3, not R2\mathbb{R}^2. If an option gives a vector of the wrong size (for example 2 entries for a matrix with 3 columns), it is wrong straight away.

One thing is always true: A⋅0=0A\cdot 0=0. So the zero vector is in the null space of every matrix. The real question is what else is in it.

Notation

eje_j is the vector with 1 in position jj and 0 everywhere else, for example e3=(0,0,1,0)e_3=(0,0,1,0) in R4\mathbb{R}^4. In matrices, blue\textcolor{#4fd1b5}{\text{blue}} marks a pivot and orange\textcolor{#f5b041}{\text{orange}} marks a free variable or free column.

1.2What the null space means: a recipe that cancels the columns

Look at a matrix–vector product column by column: AxAx is a linear combination of the columns of A, and the weights are the entries of xx. For example:

[1203−14][21−1]=2[13]+1[2−1]+(−1)[04]=[41]\begin{aligned} \begin{bmatrix} 1 & 2 & 0 \\ 3 & -1 & 4 \end{bmatrix}\begin{bmatrix} \textcolor{#4fd1b5}{2} \\ \textcolor{#4fd1b5}{1} \\ \textcolor{#4fd1b5}{-1} \end{bmatrix} &=\textcolor{#4fd1b5}{2}\begin{bmatrix} 1 \\ 3 \end{bmatrix}+\textcolor{#4fd1b5}{1}\begin{bmatrix} 2 \\-1 \end{bmatrix}+\textcolor{#4fd1b5}{(-1)}\begin{bmatrix} 0 \\ 4 \end{bmatrix} \\ &=\begin{bmatrix} 4 \\ 1 \end{bmatrix} \end{aligned}

So Ax=0Ax=0 means:

x1C1+x2C2+⋯+xnCn=0x_1 C_1+x_2 C_2+\cdots+x_n C_n=0(Cj=j-th column of A)(C_j=j\text{-th column of }A)

Every vector in the null space is a recipe: "take this much of column 1, this much of column 2, … and everything cancels to zero." If the columns are linearly independent, the only recipe is the one with all weights zero. If some columns are dependent on the others, non-zero recipes exist.

Example 1.1A null space that is a line

Find and draw the null space of A=[1224]A=\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}.

Solution

1. Look at the columns. C1=[12]C_1=\begin{bmatrix} 1 \\ 2 \end{bmatrix} and C2=[24]C_2=\begin{bmatrix} 2 \\ 4 \end{bmatrix}. Notice C2=2C1C_2=2C_1, so

2C1−1⋅C2=02C_1-1\cdot C_2=0\quad⇒x=(2,−1)∈N(A)\Rightarrow \quad x=(2,-1)\in N(A)

2. Confirm with equations. Ax=0Ax=0 means:

x+2y=02x+4y=0x+2y=0 \qquad 2x+4y=0

The second equation is twice the first, so there is really one equation: x+2y=0x+2y=0, i.e. x=−2yx=-2y. Let yy be free, y=ty=t:

(x,y)=(−2t,  t)=t (−2,1)(x,y)=(-2t,\; t)=t\, (-2,1)t∈Rt\in \mathbb{R}

3. Picture. This is a straight line through the origin (Figure 1). Every point on it gives Ax=0Ax=0. A point off the line, such as (1,1)(1,1), does not: A(1,1)=(3,6)A(1,1)=(3,6).

Answer. N(A)={t(−2,1):t∈R}=span⁡{(−2,1)}N(A)=\{t(-2,1):t\in \mathbb{R}\}=\operatorname{span}\{(-2,1)\}. It is a line, so its dimension is 1.

xy N(A): x + 2y = 0 (−2, 1)0(2, −1)(4, −2) (1, 1): A(1,1) = (3, 6) ≠ 0
Figure 1. The null space of A=[1224]A=\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} is a line through the origin. Every point on the line (blue) gives Ax=0Ax=0; the point off the line (red) does not.

1.3The null space is always a subspace

In Figure 1 the null space came out as a line through the origin. That is not a coincidence: the null space is always a subspace of Rn\mathbb{R}^n (a flat piece through the origin: a point, a line, a plane, …). All three checks follow directly from Ax=0Ax=0:

  1. It contains zero: A⋅0=0A\cdot 0=0. ✓
  2. It is closed under addition: if Au=0Au=0 and Av=0Av=0, then
A(u+v)=Au+Av=0+0=0A(u+v)=Au+Av=0+0=0
  1. It is closed under scalar multiplication: if Au=0Au=0, then for every number cc
A(cu)=c(Au)=c⋅0=0A(cu)=c(Au)=c\cdot 0=0

Because it is a subspace, it has a basis and a dimension. That dimension is called the nullity.

1.4Nullity

nullity⁡(A)=dim⁡N(A)\operatorname{nullity}(A)=\dim N(A)

Nullity measures how much freedom (how many independent directions) the solutions of Ax=0Ax=0 have. In Example 1.1 the null space is a line, so the nullity is 1.

NullityWhat the null space looks likeSolutions of Ax=0Ax=0
0Just one point: {0}\{0\}Only x=0x=0 (unique)
1A line through the originInfinitely many (one free variable)
2A plane through the originInfinitely many (two free variables)
kkA kk-dimensional subspaceInfinitely many (kk free variables)

Three examples worth remembering:

  • Identity InI_n: Inx=xI_n x=x, so Inx=0I_n x=0 only when x=0x=0. N(In)={0}N(I_n)=\{0\}, nullity 0.
  • Zero matrix 0m×n0_{m\times n}: 0x=00x=0 for every xx. N(0)=RnN(0)=\mathbb{R}^n, nullity nn.
  • Diagonal [200000005]\begin{bmatrix} 2 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 5 \end{bmatrix}: the equations are 2x1=0,  0=0,  5x3=02x_1=0,\; 0=0,\; 5x_3=0. So x1=x3=0x_1=x_3=0 and x2x_2 is anything. N=span⁡{e2}N=\operatorname{span}\{e_2 \}, nullity 1.

1.5Is a vector in the null space? Just multiply

Example 1.2Which vectors are in N(A)? (MSQ)

A=[1−12211]A=\begin{bmatrix} 1 & -1 & 2 \\ 2 & 1 & 1 \end{bmatrix}. Which vectors are in N(A)N(A)?

A
(−1,1,1)(-1,1,1)
B
(2,−2,−2)(2,-2,-2)
C
(1,1,−1)(1,1,-1)
D
(−1,1)(-1,1)
E
(0,0,0)(0,0,0)
Solution
Plan

AA has 3 columns, so only vectors with 3 entries make sense. Multiply each one by AA and see whether you get zero.

A[−111]=[−1−1+2−2+1+1]=[00]\begin{aligned} A\begin{bmatrix}-1 \\ 1 \\ 1 \end{bmatrix} &=\begin{bmatrix}-1-1+2 \\-2+1+1 \end{bmatrix} \\ &=\begin{bmatrix} 0 \\ 0 \end{bmatrix} \end{aligned}
A[11−1]=[1−1−22+1−1]=[−22]≠0\begin{aligned} A\begin{bmatrix} 1 \\ 1 \\-1 \end{bmatrix} &=\begin{bmatrix} 1-1-2 \\ 2+1-1 \end{bmatrix} \\ &=\begin{bmatrix}-2 \\ 2 \end{bmatrix}\neq 0 \end{aligned}
  • A: correct. A(−1,1,1)=(0,0)A(-1,1,1)=(0,0).
  • B: correct. (2,−2,−2)=−2⋅(−1,1,1)(2,-2,-2)=-2\cdot (-1,1,1). The null space is a subspace, so multiples stay inside (Section 1.3). You can also multiply to check.
  • C: wrong. A(1,1,−1)=(−2,2)≠0A(1,1,-1)=(-2,2)\neq 0.
  • D: wrong. It has only 2 entries, but AA has 3 columns, so the product is not even defined. The null space is in R3\mathbb{R}^3.
  • E: correct. The zero vector is in every null space.

Answer. A, B, E.

1.6Two shortcuts that save time

Shortcut 1: AejAe_j is the j-th column of A. In eje_j only the jj-th weight is 1, so Aej=CjAe_j=C_j. Therefore:

ej∈N(A)e_j \in N(A)⟺the j-th column of A is entirely zero\Longleftrightarrow \text{the }j\text{-th column of }A\text{ is entirely zero}

For example, in [310020]\begin{bmatrix} 3 & 1 & 0 \\ 0 & 2 & 0 \end{bmatrix} column 3 is zero, so e3=(0,0,1)∈N(A)e_3=(0,0,1)\in N(A). Column 1 is not zero, so e1∉N(A)e_1 \notin N(A).

Shortcut 2: spot dependent columns by eye. If one column is clearly a combination of others, that combination is a null space vector. In [120361]\begin{bmatrix} 1 & 2 & 0 \\ 3 & 6 & 1 \end{bmatrix} we have C2=2C1C_2=2C_1, so 2C1−C2+0C3=02C_1-C_2+0C_3=0, i.e. (2,−1,0)∈N(A)(2,-1,0)\in N(A). Check: A(2,−1,0)=(2−2,  6−6)=(0,0)A(2,-1,0)=(2-2,\; 6-6)=(0,0). ✓

1.7Do not confuse the null space with the row space

Row by row, Ax=0Ax=0 says: every row of A, multiplied entry by entry with x and added up, gives 0 (each row has dot product 0 with xx).

This gives a useful fact: a non-zero row of A is never in N(A). Multiply a row r=(r1,…,rn)r=(r_1,\dots,r_n) with itself:

r12+r22+⋯+rn2>0r_1^2+r_2^2+\cdots+r_n^2 >0(if r≠0)(\text{if }r\neq 0)

So that row does not give zero against itself, which means Ar≠0Ar\neq 0.

Trap (seen in graded assignments)

Options often contain the rows of the matrix (or vectors like them) and ask whether they span the null space. Rows belong to the row space, not the null space. Multiply every vector in every option by AA.

Key takeaway
  • N(A)={x:Ax=0}N(A)=\{x:Ax=0\} lives in Rn\mathbb{R}^n (n = number of columns).
  • A null space vector is a recipe that cancels the columns.
  • The null space is always a subspace and always contains 0. Nullity is its dimension.
  • N(In)={0}N(I_n)=\{0\} (nullity 0), N(0)=RnN(0)=\mathbb{R}^n (nullity n).
  • ej∈N(A)  ⟺  e_j \in N(A)\; \Longleftrightarrow \; column j is zero. A non-zero row is never in the null space.
Revision overview
DefinitionN(A) = all x with Ax = 0
lives in ℝⁿ, n = columns
Subspacecontains 0, closed under + and ×
so it has a basis
Nullitydim N(A)
number of free directions
The null spaceWeek 5 · Part 1
Quick testsmultiply the vector by A
eⱼ ∈ N(A) ⟺ column j is zero
Watch outa non-zero row is never in N(A)
wrong size = wrong option
Revision: what the null space is, on one map
Next · Rank and nullity · Part 2 of 5Finding a Basis of the Null Space
02
Rank and nullity · Part 2 of 5

Finding a Basis of the Null Space

This is the method you will use most this week. Once it is automatic, every "null space", "nullity" and "possible basis" question takes a couple of minutes.

2.1The method in 5 steps

Two terms to know

In the RREF, a variable whose column has a pivot (leading 1) is a dependent variable. A variable whose column has no pivot is an independent (free) variable: it can take any value. IIT Madras assignments use the words "dependent variables" and "independent variables".

  1. Reduce to RREF. Row operations do not change the solutions of Ax=0Ax=0, so they do not change the null space.
  2. Mark pivot and free columns. Variables of pivot columns are dependent; the rest are independent (free).
  3. Write each dependent variable in terms of the free variables. Each non-zero row of the RREF is one equation: "pivot variable = combination of free variables".
  4. Build one vector per free variable: set that free variable to 1, all other free variables to 0, and fill in the dependent variables from step 3.
  5. These vectors form a basis. Their number = number of free variables = nullity.
Formula

nullity⁡(A)\operatorname{nullity}(A) = number of independent (free) variables = number of columns without a pivot in the RREF

If there are no free variables, then N(A)={0}N(A)=\{0\}, its basis is the empty set ∅\varnothing, and the nullity is 0.

2.2Why the method gives a basis

A basis has two jobs: span the whole null space, and be linearly independent. The method does both automatically.

Spanning: every solution of Ax=0Ax=0 is completely determined by the values of the free variables. If the free variables are x2=sx_2=s and x4=tx_4=t, the solution is s⋅v1+t⋅v2s\cdot v_1+t\cdot v_2, where v1,v2v_1,v_2 are the vectors from step 4. So every solution is a combination of them.

Independence: in the free positions, each vector from step 4 has a 1 in its own slot and 0 in the other free slots (Figure 2). No vector can be built from the others, because the others all have 0 where it has its 1.

x₁x₂x₃x₄ pivotfreepivotfree v₁ =−20 v₂ =1−2 1001 The free columns show an "identity" pattern of 1s and 0s → no vector is a combination of the others → independent
Figure 2. The basis vectors from Example 2.1. The orange columns belong to the free variables. Each vector has 1 in its own free slot and 0 in the other.

2.3A complete worked example

Example 2.1Basis and nullity of a 3×4 matrix

A=[12112434120−1]A=\begin{bmatrix} 1 & 2 & 1 & 1 \\ 2 & 4 & 3 & 4 \\ 1 & 2 & 0 & -1 \end{bmatrix}. Find a basis of N(A)N(A) and nullity⁡(A)\operatorname{nullity}(A).

Solution

1. RREF. Clear the entries below the first pivot, then create a pivot in column 3:

AA→R2→R2−2R1,  R3→R3−R1[1211001200−1−2]\xrightarrow{R_2 \to R_2-2R_1,\; R_3 \to R_3-R_1}\begin{bmatrix} 1 & 2 & 1 & 1 \\ 0 & 0 & 1 & 2 \\ 0 & 0 & -1 & -2 \end{bmatrix}→R3→R3+R2[121100120000]\xrightarrow{R_3 \to R_3+R_2}\begin{bmatrix} 1 & 2 & 1 & 1 \\ 0 & 0 & 1 & 2 \\ 0 & 0 & 0 & 0 \end{bmatrix}

A pivot column also needs zeros above the pivot, so subtract R2R_2 from R1R_1:

→R1→R1−R2[120−100120000]\xrightarrow{R_1 \to R_1-R_2}\begin{bmatrix} \textcolor{#4fd1b5}{1} & \textcolor{#f5b041}{2} & 0 & \textcolor{#f5b041}{-1} \\ 0 & \textcolor{#f5b041}{0} & \textcolor{#4fd1b5}{1} & \textcolor{#f5b041}{2} \\ 0 & \textcolor{#f5b041}{0} & 0 & \textcolor{#f5b041}{0} \end{bmatrix}

2. Pivot and free columns. Pivots are in columns 1 and 3, so x1,x3x_1,x_3 are dependent and x2,x4\textcolor{#f5b041}{x_2},\textcolor{#f5b041}{x_4} are free.

3. Equations. Read the two non-zero rows as equations and isolate the pivot variable:

x1+2x2−x4=0  ⇒  x1=−2x2+x4x_1+2x_2-x_4=0\; \Rightarrow \; x_1=-2\textcolor{#f5b041}{x_2}+\textcolor{#f5b041}{x_4}
x3+2x4=0  ⇒  x3=−2x4x_3+2x_4=0\; \Rightarrow \; x_3=-2\textcolor{#f5b041}{x_4}

4. Basis vectors. First x2=1,  x4=0x_2=1,\; x_4=0: x1=−2,  x3=0x_1=-2,\; x_3=0. Then x2=0,  x4=1x_2=0,\; x_4=1: x1=1,  x3=−2x_1=1,\; x_3=-2.

v1=(−2,  1,  0,  0)v_1=(-2,\; \textcolor{#f5b041}{1},\; 0,\; \textcolor{#f5b041}{0})v2=(1,  0,  −2,  1)v_2=(1,\; \textcolor{#f5b041}{0},\;-2,\; \textcolor{#f5b041}{1})

Writing the general solution shows the spanning directly:

x=[−2x2+x4x2−2x4x4]=x2[−2100]+x4[10−21]\begin{aligned} x &=\begin{bmatrix}-2x_2+x_4 \\ x_2 \\-2x_4 \\ x_4 \end{bmatrix} \\ &=x_2 \begin{bmatrix}-2 \\ 1 \\ 0 \\ 0 \end{bmatrix}+x_4 \begin{bmatrix} 1 \\ 0 \\-2 \\ 1 \end{bmatrix} \end{aligned}
Check (always do this)

Multiply by the original AA, not the RREF:

Av1=[−2+2+0+0−4+4+0+0−2+2+0+0]=[000]\begin{aligned} Av_1 &=\begin{bmatrix}-2+2+0+0 \\-4+4+0+0 \\-2+2+0+0 \end{bmatrix} \\ &=\begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \end{aligned}Av2=[1+0−2+12+0−6+41+0+0−1]=[000]\begin{aligned} Av_2 &=\begin{bmatrix} 1+0-2+1 \\ 2+0-6+4 \\ 1+0+0-1 \end{bmatrix} \\ &=\begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \end{aligned}

Answer. Basis ={(−2,1,0,0),  (1,0,−2,1)}=\{(-2,1,0,0),\; (1,0,-2,1)\}, nullity⁡(A)=2\operatorname{nullity}(A)=2.

2.4When the RREF is already given

Example 2.2Reading a basis straight from the RREF

The RREF of a matrix AA is R=[1020−101−30200014]R=\begin{bmatrix} \textcolor{#4fd1b5}{1} & 0 & 2 & 0 & -1 \\ 0 & \textcolor{#4fd1b5}{1} & -3 & 0 & 2 \\ 0 & 0 & 0 & \textcolor{#4fd1b5}{1} & 4 \end{bmatrix}. Find a basis of N(A)N(A) and the nullity.

Solution

1. Pivot and free columns. Pivots are in columns 1, 2 and 4. Free: x3,x5\textcolor{#f5b041}{x_3},\textcolor{#f5b041}{x_5}. So the nullity is 2.

2. Dependent variables. Solve each row for its pivot variable. Moving a term to the other side flips its sign:

x1=−2x3+x5x_1=-2\textcolor{#f5b041}{x_3}+\textcolor{#f5b041}{x_5}x2=3x3−2x5x_2=3\textcolor{#f5b041}{x_3}-2\textcolor{#f5b041}{x_5}x4=−4x5x_4=-4\textcolor{#f5b041}{x_5}

3. Basis vectors. x3=1,x5=0x_3=1,x_5=0 gives v1v_1; x3=0,x5=1x_3=0,x_5=1 gives v2v_2:

v1=(−2,  3,  1,  0,  0)v_1=(-2,\; 3,\; \textcolor{#f5b041}{1},\; 0,\; \textcolor{#f5b041}{0})v2=(1,  −2,  0,  −4,  1)v_2=(1,\;-2,\; \textcolor{#f5b041}{0},\;-4,\; \textcolor{#f5b041}{1})

Answer. Basis {(−2,3,1,0,0),  (1,−2,0,−4,1)}\{(-2,3,1,0,0),\; (1,-2,0,-4,1)\}, nullity⁡(A)=2\operatorname{nullity}(A)=2. (AA and RR have the same null space, because row operations do not change solutions.)

Sign trap

Do not copy RREF entries straight into the basis vector. The row x1+2x3−x5=0x_1+2x_3-x_5=0 gives x1=−2x3+x5x_1=-2x_3+x_5: the entries change sign. Always finish by multiplying with the original AA.

2.5A matrix with a zero column ("possible basis" questions)

Example 2.3Which set is a possible basis of N(A)?

A=[2100030010040000]A=\begin{bmatrix} 2 & 1 & 0 & 0 \\ 0 & 3 & 0 & 0 \\ 1 & 0 & 0 & 4 \\ 0 & 0 & 0 & 0 \end{bmatrix}. Which sets are possible bases of N(A)N(A)?

A
{(0,0,1,0),(0,0,0,1)}\{(0,0,1,0),(0,0,0,1)\}
B
{(0,0,1,0)}\{(0,0,1,0)\}
C
{(0,1,0,0)}\{(0,1,0,0)\}
D
{(0,0,−3,0)}\{(0,0,-3,0)\}
E
{(1,0,0,0)}\{(1,0,0,0)\}
Solution

1. Write the equations. The rows of Ax=0Ax=0:

2x1+x2=02x_1+x_2=03x2=03x_2=0x1+4x4=0x_1+4x_4=00=00=0

2. Solve one by one. The second equation gives x2=0x_2=0. Then the first gives 2x1=0⇒x1=02x_1=0\Rightarrow x_1=0, and the third gives 4x4=0⇒x4=04x_4=0\Rightarrow x_4=0. x3x_3 appears in no equation, so it is free.

x=(0,0,t,0)=t (0,0,1,0)x=(0,0,\textcolor{#f5b041}{t},0)=t\, (0,0,1,0)
Shortcut

Column 3 is entirely zero, so e3∈N(A)e_3 \in N(A) (Section 1.6). The other three columns are independent, so the nullity is exactly 1.

3. Options. Nullity 1 means a basis has exactly one non-zero vector from the null space.

  • A: wrong. Two vectors, but the nullity is 1. Also (0,0,0,1)∉N(A)(0,0,0,1)\notin N(A), since Ae4Ae_4 = column 4 = (0,0,4,0)≠0(0,0,4,0)\neq 0.
  • B: correct. e3∈N(A)e_3 \in N(A), and one non-zero vector is a basis of a 1-dimensional space.
  • C: wrong. Ae2Ae_2 = column 2 = (1,3,0,0)≠0(1,3,0,0)\neq 0.
  • D: correct. (0,0,−3,0)=−3e3(0,0,-3,0)=-3e_3. Any non-zero multiple of a basis vector is also a basis. That is what "possible basis" means: bases are not unique.
  • E: wrong. Ae1Ae_1 = column 1 = (2,0,1,0)≠0(2,0,1,0)\neq 0.

Answer. B and D. nullity⁡(A)=1\operatorname{nullity}(A)=1, rank⁡(A)=3\operatorname{rank}(A)=3.

2.6When the nullity is 0

Example 2.4No free variables

Find the null space and nullity of A=[102210011]A=\begin{bmatrix} 1 & 0 & 2 \\ 2 & 1 & 0 \\ 0 & 1 & 1 \end{bmatrix}.

Solution

1. RREF

[102210011]\begin{bmatrix} 1 & 0 & 2 \\ 2 & 1 & 0 \\ 0 & 1 & 1 \end{bmatrix}→R2→R2−2R1[10201−4011]\xrightarrow{R_2 \to R_2-2R_1}\begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & -4 \\ 0 & 1 & 1 \end{bmatrix}→R3→R3−R2[10201−4005]\xrightarrow{R_3 \to R_3-R_2}\begin{bmatrix} 1 & 0 & 2 \\ 0 & 1 & -4 \\ 0 & 0 & 5 \end{bmatrix}
→R3→15R3,  R2→R2+4R3,  R1→R1−2R3[100010001]\xrightarrow{R_3 \to \frac{1}{5}R_3,\; R_2 \to R_2+4R_3,\; R_1 \to R_1-2R_3}\begin{bmatrix} \textcolor{#4fd1b5}{1} & 0 & 0 \\ 0 & \textcolor{#4fd1b5}{1} & 0 \\ 0 & 0 & \textcolor{#4fd1b5}{1} \end{bmatrix}

2. Read off. Every column has a pivot, so there are no free variables. The equations say x1=0,  x2=0,  x3=0x_1=0,\; x_2=0,\; x_3=0.

Shortcut

For a square matrix, check the determinant (expanding along the first row):

det⁡A=1(1⋅1−0⋅1)−0+2(2⋅1−1⋅0)=1+4=5≠0\begin{aligned} \det A &=1(1\cdot 1-0\cdot 1)-0+2(2\cdot 1-1\cdot 0) \\ &=1+4 \\ &=5\neq 0 \end{aligned}

A non-zero determinant means rank 3, so nullity 0.

Answer. N(A)={0}N(A)=\{0\}, basis =∅=\varnothing (the empty set), nullity⁡(A)=0\operatorname{nullity}(A)=0.

Trap

The basis of {0}\{0\} is not {(0,0,0)}\{(0,0,0)\}. Any set containing the zero vector is linearly dependent, so it cannot be a basis. The basis of {0}\{0\} is the empty set, and its dimension is 0.

2.70–1 (rating) matrices: "spans" versus "basis"

Several assignment questions encode data as vectors of 0s and 1s. With a 5-star rating, "3 stars" becomes (0,0,1,0,0)(0,0,1,0,0): 1 in position 3, 0 elsewhere. Someone who gives no rating gets a zero row. So every row of such a matrix is either zero or some eje_j.

Example 2.5A matrix of movie ratings

Five friends rate a movie from 1 to 5 stars. Riya: 3★, Kabir: 3★, Meera: 1★, Dev: no rating, Sara: 4★. Each friend's row is the 0–1 vector of their rating:

A=[0010000100100000000000010]←Riya←Kabir←Meera←Dev←SaraA=\begin{bmatrix} 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \end{bmatrix}\begin{matrix} \leftarrow \text{Riya} \\ \leftarrow \text{Kabir} \\ \leftarrow \text{Meera} \\ \leftarrow \text{Dev} \\ \leftarrow \text{Sara} \end{matrix}

Which statements are true?

A
{e1,e2,e5}\{e_1,e_2,e_5 \} spans the null space.
B
{e2,e5}\{e_2,e_5 \} spans the null space.
C
{e2,  e5,  e2+e5}\{e_2,\; e_5,\; e_2+e_5 \} spans the null space.
D
nullity⁡(A)=2\operatorname{nullity}(A)=2.
E
nullity⁡(A)=3\operatorname{nullity}(A)=3.
F
rank⁡(A)=3\operatorname{rank}(A)=3.
Solution

1. Equations. Row by row, Ax=0Ax=0 says:

x3=0  (Riya)x_3=0\; (\text{Riya})x3=0  (Kabir)x_3=0\; (\text{Kabir})x1=0  (Meera)x_1=0\; (\text{Meera})
0=0  (Dev)0=0\; (\text{Dev})x4=0  (Sara)x_4=0\; (\text{Sara})

2. Free variables. x1,x3,x4x_1,x_3,x_4 must be zero. x2,x5\textcolor{#f5b041}{x_2},\textcolor{#f5b041}{x_5} appear in no equation, so they are free. In words: nobody gave 2★ or 5★, so columns 2 and 5 are zero.

N(A)={(0,s,0,0,t)}=span⁡{e2,e5},N(A)=\{(0,s,0,0,t)\}=\operatorname{span}\{e_2,e_5 \},nullity⁡(A)=2\operatorname{nullity}(A)=2

3. Rank. The distinct non-zero rows are e3,e1,e4e_3,e_1,e_4 (Riya and Kabir have the same row; Dev's row is zero). These three are independent, so the rank is 3. Check: 3+2=53+2=5 columns. ✓

  • A: wrong. e1∉N(A)e_1 \notin N(A) (column 1 is not zero: Meera gave 1★). If even one vector of a set lies outside the null space, its span cannot equal the null space.
  • B: correct. Both vectors are in the null space, and every null space vector is a combination of them.
  • C: correct. All three are in the null space and their span is still span⁡{e2,e5}\operatorname{span}\{e_2,e_5 \}. The set spans; it is just not a basis (the third vector is redundant). The option asks about spanning, so it is true.
  • D: correct. Two free variables.
  • E: wrong. There are only two free variables (x2,x5x_2,x_5), so the nullity is 2.
  • F: correct. Three distinct non-zero 0–1 rows.

Answer. B, C, D, F.

Shortcut for 0–1 matrices

When every row is zero or some eje_j: (1) rank = number of different eje_j that appear as rows; (2) a star rating nobody gave has a zero column, and those eje_j form a basis of the null space; (3) nullity = number of zero columns.

2.8Is a given set a basis? Three checks

In MSQs you usually check options instead of finding a basis yourself. First find the nullity (count the free variables), then apply three checks to each option:

  1. Inside? Multiply every vector by the original AA. You must get zero.
  2. Right count? The number of vectors must equal the nullity. Fewer cannot span; more must be dependent.
  3. Independent? No vector may be a multiple or combination of the others. Tip: look only at the free slots. If the short vectors formed by the free slots are independent, the full vectors are independent too.

If the question asks whether a set spans N(A)N(A), check 1 is essential and the set needs at least as many independent vectors as the nullity. Extra (redundant) vectors are allowed.

Example 2.6Check the options

Take AA from Example 2.1: A=[12112434120−1]A=\begin{bmatrix} 1 & 2 & 1 & 1 \\ 2 & 4 & 3 & 4 \\ 1 & 2 & 0 & -1 \end{bmatrix} (nullity⁡=2\operatorname{nullity}=2, free x2,x4x_2,x_4). Which sets are bases of N(A)N(A)?

A
{(−2,1,0,0)}\{(-2,1,0,0)\}
B
{(−2,1,0,0),(1,0,−2,1)}\{(-2,1,0,0),(1,0,-2,1)\}
C
{(−2,1,0,0),(−4,2,0,0)}\{(-2,1,0,0),(-4,2,0,0)\}
D
{(−1,1,−2,1),(1,0,−2,1)}\{(-1,1,-2,1),(1,0,-2,1)\}
E
{(1,1,1,1),(1,0,−2,1)}\{(1,1,1,1),(1,0,-2,1)\}
F
{(−2,1,0,0),(1,0,−2,1),(−1,1,−2,1)}\{(-2,1,0,0),(1,0,-2,1),(-1,1,-2,1)\}
Solution

Checking the first vector of option D:

A[−11−21]=[−1+2−2+1−2+4−6+4−1+2+0−1]=[000]\begin{aligned} A\begin{bmatrix}-1 \\ 1 \\-2 \\ 1 \end{bmatrix} &=\begin{bmatrix}-1+2-2+1 \\-2+4-6+4 \\-1+2+0-1 \end{bmatrix} \\ &=\begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix} \end{aligned}
  • A: wrong. Only one vector, but the nullity is 2. It cannot span the null space (check 2 fails).
  • B: correct. The basis produced by the method.
  • C: wrong. (−4,2,0,0)=2(−2,1,0,0)(-4,2,0,0)=2(-2,1,0,0). Dependent (check 3 fails).
  • D: correct. Both are in the null space (the first is v1+v2v_1+v_2). Free slots (x2,x4)(x_2,x_4): (1,1)(1,1) and (0,1)(0,1), not multiples of each other, so independent. Two independent vectors and nullity 2: a basis.
  • E: wrong. A(1,1,1,1)=(5,13,2)≠0A(1,1,1,1)=(5,13,2)\neq 0 (check 1 fails).
  • F: wrong. All three are in the null space and they span it, but three vectors in a 2-dimensional space are dependent. Not a basis. (If the question asked "spans", this would be true.)

Answer. B and D.

2.9How many solutions does Ax = 0 have?

The solution set of a homogeneous system is the null space, so the nullity tells you how many solutions there are:

ConditionSolutions of Ax=0Ax=0
nullity⁡(A)=0\operatorname{nullity}(A)=0 (i.e. rank⁡=n\operatorname{rank}=n)Only one: x=0x=0 (the trivial solution)
nullity⁡(A)≥1\operatorname{nullity}(A)\ge 1 (i.e. rank⁡<n\operatorname{rank}<n)Infinitely many
More unknowns than equations (n>mn>m)Always infinitely many, because rank⁡≤m<n\operatorname{rank}\le m<n
Square matrix, det⁡A≠0\det A\neq 0Only x=0x=0
Square matrix, det⁡A=0\det A=0Infinitely many

There are never exactly two or three solutions. If one non-zero solution vv exists, then 2v,3v,−v,…2v,3v,-v,\dots are solutions too (Section 1.3). So it is either one solution or infinitely many.

2.10Application: balancing chemical equations

Balancing a chemical equation means choosing a coefficient for each molecule so that every element has the same number of atoms on both sides. This turns directly into a homogeneous system.

Method:

  1. Give each molecule an unknown coefficient x1,x2,…x_1,x_2,\dots, in the order the molecules appear.
  2. Write one equation per element (C, H, O, …): atoms on the left = atoms on the right. Each molecule contributes (its atom count) × (its coefficient).
  3. Move everything to the left: "left − right = 0". This is Ax=0Ax=0, with rows = elements and columns = molecules. Columns of the right-hand molecules get a minus sign.
  4. Find a basis of the null space. Usually the nullity is 1, so there is one basis vector.
  5. Scale the basis vector to the smallest positive whole numbers. That is the balanced equation.

Small example: x1 C+x2 O→x3 CO2x_1 \, C+x_2 \, O\to x_3 \, CO_2. Carbon: x1=x3x_1=x_3. Oxygen: x2=2x3x_2=2x_3. So x3=tx_3=t is free and the solution is t(1,2,1)t(1,2,1), i.e. C+2O→CO2C+2O\to CO_2. Here there are 2 equations and 3 unknowns: rank 2, nullity 1.

Why infinitely many ways?

Nullity 1 means every solution is t⋅vt\cdot v. Every t=1,2,3,…t=1,2,3,\dots gives a valid balance (for example 2C+4O→2CO22C+4O\to 2CO_2 is also balanced). In chemistry we simply pick the smallest whole numbers.

Example 2.7Burning methane (full method)

Balance x1 CH4+x2 O2⟶x3 CO2+x4 H2Ox_1 \, CH_4+x_2 \, O_2 \longrightarrow x_3 \, CO_2+x_4 \, H_2 O. Also give the matrix, its rank, its nullity and a basis of its null space.

Solution

1. Count atoms

ElementCH4CH_4
x1x_1
O2O_2
x2x_2
CO2CO_2
x3x_3
H2OH_2 O
x4x_4
C1010
H4002
O0221

2. Equations: left = right

C: x1=x3\text{C: }x_1=x_3H: 4x1=2x4\text{H: }4x_1=2x_4O: 2x2=2x3+x4\text{O: }2x_2=2x_3+x_4

3. Everything on the left. The product columns (x3,x4x_3,x_4) get a minus sign:

[10−10400−202−2−1]⏟A[x1x2x3x4]=[000]\underbrace{\begin{bmatrix} 1 & 0 & -1 & 0 \\ 4 & 0 & 0 & -2 \\ 0 & 2 & -2 & -1 \end{bmatrix}}_{A}\begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix}=\begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix}

4. RREF

AA→R2→R2−4R1[10−10004−202−2−1]\xrightarrow{R_2 \to R_2-4R_1}\begin{bmatrix} 1 & 0 & -1 & 0 \\ 0 & 0 & 4 & -2 \\ 0 & 2 & -2 & -1 \end{bmatrix}→R2↔R3[10−1002−2−1004−2]\xrightarrow{R_2 \leftrightarrow R_3}\begin{bmatrix} 1 & 0 & -1 & 0 \\ 0 & 2 & -2 & -1 \\ 0 & 0 & 4 & -2 \end{bmatrix}
→R2→12R2,  R3→14R3[10−1001−1−12001−12]\xrightarrow{R_2 \to \frac{1}{2}R_2,\; R_3 \to \frac{1}{4}R_3}\begin{bmatrix} 1 & 0 & -1 & 0 \\ 0 & 1 & -1 & -\frac{1}{2} \\ 0 & 0 & 1 & -\frac{1}{2} \end{bmatrix}→R1→R1+R3,  R2→R2+R3[100−12010−1001−12]\xrightarrow{R_1 \to R_1+R_3,\; R_2 \to R_2+R_3}\begin{bmatrix} \textcolor{#4fd1b5}{1} & 0 & 0 & \textcolor{#f5b041}{-\frac{1}{2}} \\ 0 & \textcolor{#4fd1b5}{1} & 0 & \textcolor{#f5b041}{-1} \\ 0 & 0 & \textcolor{#4fd1b5}{1} & \textcolor{#f5b041}{-\frac{1}{2}} \end{bmatrix}

5. Null space. Three pivots (rank 3) and one free variable x4\textcolor{#f5b041}{x_4} (nullity 4−3=14-3=1). From the rows:

x1=12x4x_1=\frac{1}{2}x_4x2=x4x_2=x_4x3=12x4x_3=\frac{1}{2}x_4

Setting x4=1x_4=1 gives the basis vector (12,1,12,1)(\frac{1}{2},1,\frac{1}{2},1). Multiply by 2 for whole numbers: (1,2,1,2)(1,2,1,2).

6. Check the atoms. C: 1=11=1. H: 4⋅1=2⋅24\cdot 1=2\cdot 2. O: 2⋅2=2⋅1+1⋅22\cdot 2=2\cdot 1+1\cdot 2. ✓

Answer. CH4+2O2→CO2+2H2OCH_4+2O_2 \to CO_2+2H_2 O. rank⁡=3\operatorname{rank}=3, nullity⁡=1\operatorname{nullity}=1, basis {(1,2,1,2)}\{(1,2,1,2)\} (or {(12,1,12,1)}\{(\frac{1}{2},1,\frac{1}{2},1)\}; both are correct).

Example 2.8Burning propane (MSQ)

Propane (C3H8C_3 H_8) has 3 carbon and 8 hydrogen atoms. Reaction: x1 C3H8+x2 O2⟶x3 CO2+x4 H2Ox_1 \, C_3 H_8+x_2 \, O_2 \longrightarrow x_3 \, CO_2+x_4 \, H_2 O. Which statements about the linear system for balancing this equation are true?

A
The nullity of the matrix is 1.
B
The nullity of the matrix is 2.
C
{(1,5,3,4)}\{(1,5,3,4)\} is a basis of the null space.
D
{(2,10,6,8)}\{(2,10,6,8)\} is a basis of the null space.
E
{(5,1,4,3)}\{(5,1,4,3)\} is a basis of the null space.
F
{(1,5,3,4),(2,10,6,8)}\{(1,5,3,4),(2,10,6,8)\} is a basis of the null space.
G
There are infinitely many ways to balance the equation.
H
The rank of the matrix is 3.
Solution

1. Equations

C: 3x1=x3\text{C: }3x_1=x_3H: 8x1=2x4\text{H: }8x_1=2x_4O: 2x2=2x3+x4\text{O: }2x_2=2x_3+x_4
A=[30−10800−202−2−1]A=\begin{bmatrix} 3 & 0 & -1 & 0 \\ 8 & 0 & 0 & -2 \\ 0 & 2 & -2 & -1 \end{bmatrix}

2. Solve quickly by substitution. Let x1=tx_1=t:

x3=3t,x_3=3t,x4=8t2=4t,x_4=\frac{8t}{2}=4t,x2=2(3t)+4t2=5tx_2=\frac{2(3t)+4t}{2}=5t
x=t (1,5,3,4)x=t\, (1,5,3,4)

One free parameter, so the nullity is 1 and the rank is 4−1=34-1=3 (rank–nullity theorem, Section 3.1).

  • A: correct. One free variable.
  • B: wrong. There is only one free parameter (tt), so the nullity is 1.
  • C: correct. t=1t=1.
  • D: correct. t=2t=2. A non-zero multiple is also a basis.
  • E: wrong. Wrong order. Carbon check: 3⋅5=153\cdot 5=15, but x3=4x_3=4. Entries always follow (x1,x2,x3,x4)(x_1,x_2,x_3,x_4), the order of molecules in the equation.
  • F: wrong. Two vectors, but the nullity is 1; the second is twice the first, so they are dependent.
  • G: correct. Every t>0t>0 gives a balance.
  • H: correct. Rank–nullity: 4−1=34-1=3.

Answer. A, C, D, G, H. Balanced: C3H8+5O2→3CO2+4H2OC_3 H_8+5O_2 \to 3CO_2+4H_2 O.

Traps

(1) Forgetting the minus sign in the product columns. (2) Writing the basis vector in a different order from the molecules in the equation. (3) Confusing the nullity with the number of molecules: molecules = columns = nn, and nullity = nn − rank.

Key takeaway
  • RREF → free variables → set one free variable to 1 (others 0) → basis vector. Their count = nullity.
  • Solving a row for its pivot variable flips signs. Check by multiplying with the original AA.
  • No free variables → N(A)={0}N(A)=\{0\}, basis ∅\varnothing, nullity 0.
  • A basis is not unique (non-zero multiples and combinations work too); the nullity is unique.
  • Basis check: inside? right count? independent? A spanning set may have extra vectors; a basis may not.
  • Ax=0Ax=0 has only x=0x=0 when the nullity is 0, otherwise infinitely many solutions.
  • Chemical equations: rows = elements, columns = molecules, product columns negative; scale the null space vector to whole numbers.
Revision overview
MethodRREF → free variables
one vector per free variable
Signssolving for the pivot variable
flips the sign
Nullity 0N(A) = {0}
basis = empty set
Basis of N(A)Week 5 · Part 2
Option checksinside? right count?
independent?
Applications0–1 rating matrices
balancing chemical equations
Revision: finding and checking a basis of the null space
Next · Rank and nullity · Part 3 of 5The Rank–Nullity Theorem
03
Rank and nullity · Part 3 of 5

The Rank–Nullity Theorem

Rank counts the pivot columns, nullity counts the free columns, and together they make up all the columns. This one fact answers most size-only and product questions.

3.1The rank–nullity theorem and why it is true

For every m×nm\times n matrix AA:

rank⁡(A)+nullity⁡(A)=n\operatorname{rank}(A)+\operatorname{nullity}(A)=n(n=number of columns)(n=\text{number of columns})

The proof is just counting. In the RREF, every column is one of two kinds (Figure 3):

  • Pivot column: their number = number of pivots = rank (from Week 4: rank = number of pivots in the RREF).
  • Free column: their number = number of free variables = nullity (Section 2.1).

Every column is either a pivot column or a free column, never both. So pivot columns + free columns = all columns = nn.

x₁x₂x₃x₄ pivotfreepivotfree 2 pivot columns + 2 free columns = 4 columns rank 2 + nullity 2 = n = 4
Figure 3. The 4 columns of the matrix in Example 2.1. Each column is either a pivot column (blue) or a free column (orange), so rank + nullity = n.

The big benefit: if you know the rank, you know the nullity, and the other way round, without solving for the null space.

nullity⁡(A)=n−rank⁡(A)\operatorname{nullity}(A)=n-\operatorname{rank}(A)rank⁡(A)=n−nullity⁡(A)\operatorname{rank}(A)=n-\operatorname{nullity}(A)

3.2n is the number of columns, not rows

The null space lives in Rn\mathbb{R}^n (n = columns), and each column is one variable. That is why the theorem uses columns.

Trap

m−rank⁡(A)m-\operatorname{rank}(A) is not the nullity; it only counts the zero rows of the RREF. For a 5×35\times 3 matrix of rank 3: nullity =3−3=0=3-3=0, while m−rank⁡=5−3=2m-\operatorname{rank}=5-3=2.

3.3Only the size is given: the possible rank and nullity

If you only know the size m×nm\times n, use these rules:

1≤rank⁡(A)≤min⁡(m,n)1\le \operatorname{rank}(A)\le \min (m,n)(if A≠0)(\text{if }A\neq 0)
nullity⁡(A)=n−rank⁡(A)\operatorname{nullity}(A)=n-\operatorname{rank}(A)
n−min⁡(m,n)≤nullity⁡(A)≤n−1n-\min (m,n)\le \operatorname{nullity}(A)\le n-1

The lower bound 1 holds because a non-zero matrix has at least one pivot. If the matrix is not said to be non-zero, the rank can also be 0 (the zero matrix), and then the nullity is nn.

Example 3.1A ∈ M₃ₓ₆(ℝ), non-zero (MSQ)

A∈M3×6(R)A\in M_{3\times 6} (\mathbb{R}) is a non-zero matrix (a 3×63\times 6 real matrix with at least one non-zero entry). Which statements are true?

A
The rank is at most 3.
B
The rank must be at least 3.
C
The nullity is at least 3.
D
The nullity is at most 5.
E
The nullity can be 6.
F
Ax=0Ax=0 has infinitely many solutions.
Solution

1. Bounds on the rank. m=3,  n=6m=3,\; n=6. The matrix is non-zero, so 1≤rank⁡≤min⁡(3,6)=31\le \operatorname{rank}\le \min (3,6)=3.

2. List every case. Nullity =6−rank⁡=6-\operatorname{rank}:

rank123
nullity = 6 − rank543
  • A: correct. Rank ≤min⁡(3,6)=3\le \min (3,6)=3.
  • B: wrong. The rank can be 1, for example a matrix with a single entry 1 and all other entries 0.
  • C: correct. The smallest possible nullity is 6−3=36-3=3.
  • D: correct. The largest possible nullity is 6−1=56-1=5.
  • E: wrong. Nullity 6 means rank 0, i.e. the zero matrix, which is excluded.
  • F: correct. Nullity ≥3>0\ge 3>0, so the null space contains non-zero vectors and all their multiples.

Answer. A, C, D, F.

Easy way to remember

More columns than rows (n>mn>m) → nullity at least n−m>0n-m>0 → always infinitely many solutions. More rows than columns → the nullity can be 0.

3.4Nullity from the RREF: which quantities are equal

Row operations do not change solutions. So if AA is the RREF of MM:

N(M)=N(A),N(M)=N(A),rank⁡(M)=rank⁡(A),\operatorname{rank}(M)=\operatorname{rank}(A),nullity⁡(M)=nullity⁡(A)\operatorname{nullity}(M)=\operatorname{nullity}(A)

Therefore the nullity of MM equals each of these:

  • n−rank⁡(M)n-\operatorname{rank}(M) and n−rank⁡(A)n-\operatorname{rank}(A)
  • the number of independent (free) variables of Mx=0Mx=0
  • the number of independent (free) variables of Ax=0Ax=0 (the same, because the solutions are the same)
  • the number of columns of the RREF without a pivot

These, on the other hand, equal the rank, not the nullity: the number of pivots in AA, and the number of non-zero rows in AA.

Example 3.2Which quantities equal the nullity? (MSQ)

M=[1−12032−2406]M=\begin{bmatrix} 1 & -1 & 2 & 0 & 3 \\ 2 & -2 & 4 & 0 & 6 \end{bmatrix} (m=2,  n=5m=2,\; n=5) and AA is its RREF. Which options equal nullity⁡(M)\operatorname{nullity}(M)?

A
m−rank⁡(M)m-\operatorname{rank}(M)
B
n−rank⁡(A)n-\operatorname{rank}(A)
C
The number of non-zero rows of MM
D
The number of pivots in AA
E
The number of independent variables of Mx=0Mx=0
F
The number of independent variables of Ax=0Ax=0
G
The number of zero columns of AA
Solution

1. RREF. Row 2 = 2 × Row 1, so:

MM→R2→R2−2R1A=[1−120300000]\xrightarrow{R_2 \to R_2-2R_1}A=\begin{bmatrix} \textcolor{#4fd1b5}{1} & \textcolor{#f5b041}{-1} & \textcolor{#f5b041}{2} & \textcolor{#f5b041}{0} & \textcolor{#f5b041}{3} \\ 0 & \textcolor{#f5b041}{0} & \textcolor{#f5b041}{0} & \textcolor{#f5b041}{0} & \textcolor{#f5b041}{0} \end{bmatrix}

2. Rank and nullity. One pivot, so rank 1 and nullity =5−1=4=5-1=4 (free: x2,x3,x4,x5x_2,x_3,x_4,x_5). Every quantity in this example has a different value, so nothing matches by accident:

  • A: wrong. 2−1=1≠42-1=1\neq 4.
  • B: correct. 5−1=45-1=4.
  • C: wrong. Both rows of MM are non-zero: 2. Non-zero rows of the original matrix mean nothing here.
  • D: wrong. Pivots = 1 = rank, not nullity.
  • E: correct. 4 free variables.
  • F: correct. Also 4 (AA and MM have the same solutions).
  • G: wrong. Only column 4 of AA is zero: 1. A free column does not have to be zero (columns 2, 3 and 5 are free but not zero).

Answer. B, E, F.

3.5Special matrices: zero, identity, scalar, diagonal

Matrix (n×n)RankNullityNull space
Zero matrix 000nnRn\mathbb{R}^n (everything)
Identity InI_nnn0{0}\{0\}
Scalar cIncI_n, c≠0c\neq 0nn0{0}\{0\}
Scalar cIncI_n, c=0c=00nnRn\mathbb{R}^n
Diagonalnumber of non-zero diagonal entriesnumber of zero diagonal entriesspan of the eje_j where the diagonal entry is 0
Any invertible matrix (det⁡≠0\det \neq 0)nn0{0}\{0\}

Why is the null space of a non-zero scalar matrix {0}\{0\}?

(cIn)x=c x=0    and    c≠0(cI_n)x=c\, x=0\; \; \text{and}\; \; c\neq 0⇒x=1c⋅0=0\Rightarrow x=\frac{1}{c}\cdot 0=0
Example 3.3Scalar matrices (MSQ)

Which statements about scalar matrices of order nn are true?

A
The null space of a scalar matrix is always the zero space {0}\{0\}.
B
The null space of a non-zero scalar matrix is always {0}\{0\}.
C
The nullity of a non-zero scalar matrix is always 0.
D
The rank of a non-zero scalar matrix is always nn (its order).
E
The rank of a scalar matrix is always nn.
F
Every non-zero scalar matrix is invertible.
Solution
  • A: wrong. c=0c=0 also gives a scalar matrix (the zero matrix), whose null space is Rn\mathbb{R}^n. One counterexample breaks an "always" statement.
  • B: correct. Shown above.
  • C: correct. The null space is {0}\{0\}, so its dimension is 0.
  • D: correct. Rank–nullity: rank⁡=n−0=n\operatorname{rank}=n-0=n. (The RREF is InI_n: divide each row by cc.)
  • E: wrong. The zero matrix has rank 0.
  • F: correct. Its inverse is 1cIn\frac{1}{c}I_n.

Answer. B, C, D, F.

Trap

The whole question turns on "scalar matrix" versus "non-zero scalar matrix". Whenever a statement says "always", check the zero case c=0c=0.

Example 3.4A diagonal matrix

Find the rank, nullity and null space of D=[3000000000000007]D=\begin{bmatrix} 3 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 7 \end{bmatrix}.

Solution

Dx=0Dx=0 means 3x1=0,  0=0,  0=0,  7x4=03x_1=0,\; 0=0,\; 0=0,\; 7x_4=0. So x1=x4=0x_1=x_4=0, and x2,x3\textcolor{#f5b041}{x_2},\textcolor{#f5b041}{x_3} are free.

Answer. rank 2 (two non-zero diagonal entries), nullity 2, N(D)=span⁡{e2,e3}N(D)=\operatorname{span}\{e_2,e_3 \}. Check: 2+2=42+2=4. ✓

3.6The rank of a product AB

If AA is m×km\times k and BB is k×pk\times p, then ABAB is m×pm\times p and

rank⁡(AB)≤min⁡(rank⁡(A),  rank⁡(B))\operatorname{rank}(AB)\le \min \big( \operatorname{rank}(A),\; \operatorname{rank}(B)\big)

Why ≤rank⁡(A)\le \operatorname{rank}(A)? ABx=A(Bx)ABx=A(Bx), so every output of ABAB is also an output of AA. The column space of ABAB cannot have more directions than the column space of AA.

Why ≤rank⁡(B)\le \operatorname{rank}(B)? If Bx=0Bx=0 then ABx=A⋅0=0ABx=A\cdot 0=0. Every null vector of BB is a null vector of ABAB, so nullity⁡(AB)≥nullity⁡(B)\operatorname{nullity}(AB)\ge \operatorname{nullity}(B). Both have pp columns, so by rank–nullity:

rank⁡(AB)=p−nullity⁡(AB)≤p−nullity⁡(B)=rank⁡(B)\begin{aligned} \operatorname{rank}(AB) &=p-\operatorname{nullity}(AB)\le p-\operatorname{nullity}(B) \\ &=\operatorname{rank}(B) \end{aligned}

Think of a pipe (Figure 4): first BB acts, then AA. The narrowest part decides how many directions survive. This maximum min⁡(rank⁡A,rank⁡B)\min (\operatorname{rank}A,\operatorname{rank}B) can always be reached by a suitable choice of matrices, so it is the answer to "maximum possible rank" questions.

ℝ⁴ (input)ℝ⁵ℝ³ (output) B (5×4)rank 3A (3×5)rank 2 4 directionsafter B: ≤ 3after A: ≤ 2 rank(AB) ≤ min(rank A, rank B) = min(2, 3) = 2
Figure 4. Applying ABAB means applying BB first, then AA. At each stage the number of surviving directions cannot exceed that matrix's rank, so the narrowest stage sets the limit.
Example 3.5Maximum rank of AB from nullities (numerical)

AA is a 3×53\times 5 matrix and BB is a 5×45\times 4 matrix. The null spaces of AA and BB have dimensions 3 and 1. What is the maximum possible rank of ABAB?

Solution

1. Each matrix has its own n. AA has 5 columns and BB has 4.

rank⁡(A)=5−3=2\operatorname{rank}(A)=5-3=2rank⁡(B)=4−1=3\operatorname{rank}(B)=4-1=3

2. Apply the bound. rank⁡(AB)≤min⁡(2,3)=2\operatorname{rank}(AB)\le \min (2,3)=2.

3. Is 2 actually reached?. Yes. Take AA with rows e1,e2,0e_1,e_2,0 in R5\mathbb{R}^5 (rank 2, nullity 3) and BB with rows e1,e2,e3,0,0e_1,e_2,e_3,0,0 in R4\mathbb{R}^4 (rank 3, nullity 1); then ABAB has rows e1,e2,0e_1,e_2,0 and rank 2.

Answer. 2

Example 3.6When one matrix sends everything to zero

AA is a 4×24\times 2 matrix and BB is a 2×42\times 4 matrix. Their null spaces are 2- and 3-dimensional. What is the maximum possible rank of ABAB?

Solution

1. Rank of A. rank⁡(A)=2−2=0\operatorname{rank}(A)=2-2=0. Only the zero matrix has rank 0, so A=0A=0.

2. The product. AB=0⋅B=0AB=0\cdot B=0, so its rank is 0. (The bound agrees: ≤min⁡(0,  4−3)=0\le \min (0,\; 4-3)=0.)

Answer. 0

Trap

When converting nullity to rank, use that matrix's own number of columns. For a 4×24\times 2 matrix, nn = 2, not 4. This is the most common mistake.

3.7Dimension of the span of a set of vectors

To find the dimension of the span of some vectors: write them as the rows of a matrix, reduce to RREF and count the non-zero rows. That number is the dimension (= dimension of the row space = rank).

Example 3.7Span of three vectors

Find the dimension of span⁡{(1,2,1),  (2,4,2),  (0,1,1)}\operatorname{span}\{(1,2,1),\; (2,4,2),\; (0,1,1)\}.

Solution
[121242011]\begin{bmatrix} 1 & 2 & 1 \\ 2 & 4 & 2 \\ 0 & 1 & 1 \end{bmatrix}→R2→R2−2R1[121000011]\xrightarrow{R_2 \to R_2-2R_1}\begin{bmatrix} 1 & 2 & 1 \\ 0 & 0 & 0 \\ 0 & 1 & 1 \end{bmatrix}→R2↔R3[121011000]\xrightarrow{R_2 \leftrightarrow R_3}\begin{bmatrix} 1 & 2 & 1 \\ 0 & 1 & 1 \\ 0 & 0 & 0 \end{bmatrix}
→R1→R1−2R2[10−1011000]\xrightarrow{R_1 \to R_1-2R_2}\begin{bmatrix} \textcolor{#4fd1b5}{1} & 0 & -1 \\ 0 & \textcolor{#4fd1b5}{1} & 1 \\ 0 & 0 & 0 \end{bmatrix}

Answer. 2 non-zero rows, so the dimension is 2. (The second vector is twice the first, so it adds nothing.)

Shortcut for 0–1 (one-hot) vectors: if every vector is either zero or some eje_j, the dimension of the span = the number of different eje_j that appear. Different eje_j are always independent (their 1s are in different places), repeats add no new direction, and the zero vector adds nothing.

Example 3.8Vectors for favourite subjects (MSQ)

Each of 6 students picks a favourite subject from 5: Maths, Stats, CT, Python, English. A student who picks subject jj gets the vector ej∈R5e_j \in \mathbb{R}^5 (Maths =e1=e_1, Stats =e2=e_2, CT =e3=e_3, Python =e4=e_4, English =e5=e_5); a student who picks nothing gets the zero vector. Which statements about the dimension of the span of these 6 row vectors are true?

A
Maths, Maths, Stats, Python, (none), Stats → dimension 3.
B
Python, CT, English, Maths, Stats, Python → dimension 5.
C
Everyone picks CT → dimension 1.
D
Stats, Stats, Stats, English, English, (none) → dimension 3.
E
Nobody picks anything → dimension 1.
Solution
  • A: correct. Different vectors: e1,e2,e4e_1,e_2,e_4 → 3.
  • B: correct. Different: e4,e3,e5,e1,e2e_4,e_3,e_5,e_1,e_2 → all 5 → 5.
  • C: correct. Only e3e_3 (six times) → 1.
  • D: wrong. Different: e2,e5e_2,e_5 → 2, not 3.
  • E: wrong. All zero vectors → span {0}\{0\} → dimension 0.

Answer. A, B, C.

Key takeaway
  • rank⁡+nullity⁡=n\operatorname{rank}+\operatorname{nullity}=n (columns): pivot columns + free columns = all columns.
  • Size only: 1≤rank⁡≤min⁡(m,n)1\le \operatorname{rank}\le \min (m,n) for a non-zero matrix, and nullity⁡=n−rank⁡\operatorname{nullity}=n-\operatorname{rank}.
  • Row reduction does not change the null space, rank or nullity. Pivots = rank; free variables = nullity.
  • Non-zero scalar matrix: rank n, nullity 0. Zero scalar matrix (c=0c=0): rank 0, nullity n.
  • rank⁡(AB)≤min⁡(rank⁡A,rank⁡B)\operatorname{rank}(AB)\le \min (\operatorname{rank}A,\operatorname{rank}B), and this minimum is the maximum possible rank. Rank 0 means the zero matrix.
  • Dimension of a span = rank of the matrix with those vectors as rows. One-hot vectors: count the different eje_j.
Revision overview
Theoremrank + nullity = n
pivot + free columns
Size only1 ≤ rank ≤ min(m, n)
for a non-zero matrix
Special matrices0: rank 0 · I: rank n
diagonal: count non-zeros
Rank–nullityWeek 5 · Part 3
Productrank(AB) ≤ min(rank A, rank B)
own columns for each matrix
Spanvectors as rows → rank
one-hot: count different eⱼ
Revision: the rank–nullity theorem and its uses
Next · Linear maps · Part 4 of 5What Is a Linear Mapping?
04
Linear maps · Part 4 of 5

What Is a Linear Mapping?

So far a matrix has been a table of numbers. From here on, think of it as a machine: a vector goes in and another vector comes out. The simplest, most well-behaved machines are called linear mappings.

4.1Functions (maps) between ℝⁿ and ℝᵐ

A function f:A→Bf:A\to B is a rule that assigns to each element of the domain AA exactly one element of the codomain BB. f:Rn→Rmf:\mathbb{R}^n \to \mathbb{R}^m takes nn numbers in and gives mm numbers out.

f(x,y)=(x+y,  x−y,  2x)f(x,y)=(x+y,\; x-y,\; 2x)f:R2→R3f:\mathbb{R}^2 \to \mathbb{R}^3

For example f(3,1)=(4,2,6)f(3,1)=(4,2,6): two numbers in, three out.

4.2A real-life starting point: a shop bill

A grocery shop sells rice at ₹50/kg, dal at ₹120/kg and oil at ₹150/litre. You buy x1x_1 kg of rice, x2x_2 kg of dal and x3x_3 litres of oil. The bill is

bill(x1,x2,x3)=50x1+120x2+150x3\text{bill}(x_1,x_2,x_3)=50x_1+120x_2+150x_3

This is a function R3→R\mathbb{R}^3 \to \mathbb{R} (3 quantities in, 1 bill out). Two properties are obvious even without maths:

  • Double the order, double the bill: 2 kg rice, 2 kg dal and 2 L oil cost twice as much.
  • Combine two orders, add the bills: buying the morning and evening orders together costs the morning bill plus the evening bill.

Now add a ₹40 delivery charge to every bill: 50x1+120x2+150x3+4050x_1+120x_2+150x_3+40. Both properties fail: doubling the order does not double the ₹40. A separate added constant is exactly what breaks linearity.

For the bills at two shops at once (shop B: ₹45, ₹130, ₹140) the output has 2 numbers:

f(x1,x2,x3)=(50x1+120x2+150x3,    45x1+130x2+140x3)f(x_1,x_2,x_3)=(50x_1+120x_2+150x_3,\; \; 45x_1+130x_2+140x_3)f:R3→R2f:\mathbb{R}^3 \to \mathbb{R}^2

Each output is just a sum of "fixed number × quantity". That is a linear mapping.

4.3Definition of a linear mapping

A function f:Rn→Rmf:\mathbb{R}^n \to \mathbb{R}^m is a linear mapping if there are fixed real numbers aija_{ij} such that

f(x1,…,xn)=[a11x1+a12x2+⋯+a1nxna21x1+a22x2+⋯+a2nxn⋮am1x1+am2x2+⋯+amnxn]f(x_1,\dots,x_n)=\begin{bmatrix} a_{11} x_1+a_{12} x_2+\cdots+a_{1n} x_n \\ a_{21} x_1+a_{22} x_2+\cdots+a_{2n} x_n \\ \vdots \\ a_{m1} x_1+a_{m2} x_2+\cdots+a_{mn} x_n \end{bmatrix}

(The output is written as a column here; writing it as a row (…,… )(\dots,\dots \,) means the same thing.)

In plain words, every component of the output must look like

(number)⋅x1+(number)⋅x2+⋯+(number)⋅xn(\text{number})\cdot x_1+(\text{number})\cdot x_2+\cdots+(\text{number})\cdot x_n

No added constant, no squares, no product of two variables, no ∣x∣|x|, sin⁡\sin or  \sqrt{\ }. Some coefficients may be 0 (so some variables can be missing), and a whole component may be 0.

4.4Every linear mapping has a matrix

Put the coefficients in a matrix: row i holds the coefficients of output i. Then

f(x)=Ax,f(x)=Ax,A is m×n    (outputs×inputs)A\text{ is }m\times n\; \; (\text{outputs}\times \text{inputs})
Example 4.1From a formula to a matrix, and back

f(x,y,z)=(2x−y+3z,  4y−z)f(x,y,z)=(2x-y+3z,\; 4y-z). Write its matrix and compute f(1,1,1)f(1,1,1) both ways.

Solution

1. Sizes. 3 numbers in, 2 numbers out, so f:R3→R2f:\mathbb{R}^3 \to \mathbb{R}^2 and the matrix is 2×32\times 3.

2. Rows. Each output's coefficients form one row. The second output has no xx, so its coefficient is 0:

2x−y+3z  →  (2,−1,3)2x-y+3z\; \to \; (2,-1,3)0x+4y−z  →  (0,4,−1)0x+4y-z\; \to \; (0,4,-1)
A=[2−1304−1]A=\begin{bmatrix} 2 & -1 & 3 \\ 0 & 4 & -1 \end{bmatrix}

3. Check

f(1,1,1)=(2−1+3,  4−1)=(4,3)f(1,1,1)=(2-1+3,\; 4-1)=(4,3)A[111]=[2−1+30+4−1]=[43]\begin{aligned} A\begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} &=\begin{bmatrix} 2-1+3 \\ 0+4-1 \end{bmatrix} \\ &=\begin{bmatrix} 4 \\ 3 \end{bmatrix} \end{aligned}
Bonus

The columns of AA are the outputs of the standard basis vectors: f(1,0,0)=(2,0)f(1,0,0)=(2,0) is column 1, f(0,1,0)=(−1,4)f(0,1,0)=(-1,4) is column 2, f(0,0,1)=(3,−1)f(0,0,1)=(3,-1) is column 3. This becomes very useful in Chapter 5.

Answer. A=[2−1304−1]A=\begin{bmatrix} 2 & -1 & 3 \\ 0 & 4 & -1 \end{bmatrix}, f(1,1,1)=(4,3)f(1,1,1)=(4,3).

Trap

The matrix is (outputs × inputs), not (inputs × outputs): R3→R2\mathbb{R}^3 \to \mathbb{R}^2 gives a 2×32\times 3 matrix. And write 0 for every variable that is missing from an output.

4.5Linear or not: a quick checklist

A component containingLinear?Why
3x3x, −y-y, 12z\frac{1}{2}z, 2 x\sqrt{2}\, x, πy\pi y✓ YesNumber × variable (the number can be anything)
00 (whole component zero)✓ YesAll coefficients are 0
4x−4y4x-4y, 7x+0y7x+0y✓ YesA sum of number × variable
x+1x+1, 7x+17x+1, 4x+6y+64x+6y+6✗ NoAn added constant: f(0)≠0f(0)\neq 0
x2x^2, y3y^3✗ NoThe power is not 1
xyxy, xzxz✗ NoA product of two variables
∣x∣|x|, 6∣x∣6|x|✗ NoIt swallows the minus sign: ∣−1∣≠−∣1∣|-1|\neq-|1|
sin⁡x\sin x, exe^x, x\sqrt{x}, 1x\frac{1}{x}, max⁡(x,y)\max (x,y)✗ NoNot straight-line behaviour

If even one component contains a "no" item, the whole function is not a linear mapping.

4.6Weighted total marks (graded assignment style)

Final marks are often weighted: some percent of Quiz 1, some of Quiz 2, some of the End sem. If the weights are the variables, the total is a linear mapping of the weights.

Example 4.2Three students, three exams (MSQ)

Marks of Asha, Bilal and Chetan (each exam out of 100):

Quiz 1Quiz 2End sem
Asha604070
Bilal308050
Chetan505060

The total takes x1%x_1 \% of Quiz 1, x2%x_2 \% of Quiz 2 and x3%x_3 \% of the End sem, giving TA(x1,x2,x3)T_A (x_1,x_2,x_3), TB(x1,x2,x3)T_B (x_1,x_2,x_3) and TC(x1,x2,x3)T_C (x_1,x_2,x_3). Which options are correct?

A
TB=1100(30x1+80x2+50x3)T_B=\frac{1}{100}(30x_1+80x_2+50x_3)
B
TB=1100(60x1+30x2+50x3)T_B=\frac{1}{100}(60x_1+30x_2+50x_3)
C
If x1=10,  x2=30,  x3=60x_1=10,\; x_2=30,\; x_3=60, then TA=60T_A=60
D
If x1=10,  x2=30,  x3=60x_1=10,\; x_2=30,\; x_3=60, then TA=57T_A=57
E
If x1=10,  x2=30,  x3=60x_1=10,\; x_2=30,\; x_3=60, then Chetan has the highest total
F
If x1=10,  x2=60,  x3=30x_1=10,\; x_2=60,\; x_3=30, then Bilal has the highest total
G
Each TiT_i is a linear mapping R3→R\mathbb{R}^3 \to \mathbb{R}
Solution

1. Where the formula comes from. x1%x_1 \% of 60 is x1100⋅60\frac{x_1}{100}\cdot 60. Do this for each exam and add. A student's formula uses that student's row:

TA=1100(60x1+40x2+70x3)T_A=\frac{1}{100}(60x_1+40x_2+70x_3)
TB=1100(30x1+80x2+50x3)T_B=\frac{1}{100}(30x_1+80x_2+50x_3)
TC=1100(50x1+50x2+60x3)T_C=\frac{1}{100}(50x_1+50x_2+60x_3)

2. Weights 10, 30, 60

TA=1100(600+1200+4200)=6000100=60\begin{aligned} T_A &=\frac{1}{100}(600+1200+4200) \\ &=\frac{6000}{100} \\ &=60 \end{aligned}
TB=1100(300+2400+3000)=5700100=57\begin{aligned} T_B &=\frac{1}{100}(300+2400+3000) \\ &=\frac{5700}{100} \\ &=57 \end{aligned}
TC=1100(500+1500+3600)=5600100=56\begin{aligned} T_C &=\frac{1}{100}(500+1500+3600) \\ &=\frac{5600}{100} \\ &=56 \end{aligned}

3. Weights 10, 60, 30

TA=1100(600+2400+2100)=5100100=51\begin{aligned} T_A &=\frac{1}{100}(600+2400+2100) \\ &=\frac{5100}{100} \\ &=51 \end{aligned}
TB=1100(300+4800+1500)=6600100=66\begin{aligned} T_B &=\frac{1}{100}(300+4800+1500) \\ &=\frac{6600}{100} \\ &=66 \end{aligned}
TC=1100(500+3000+1800)=5300100=53\begin{aligned} T_C &=\frac{1}{100}(500+3000+1800) \\ &=\frac{5300}{100} \\ &=53 \end{aligned}
  • A: correct. Bilal's row: 30, 80, 50.
  • B: wrong. 60, 30, 50 is the Quiz 1 column (all three students' Quiz 1 marks), not Bilal's row. The most common trap.
  • C: correct. 60.
  • D: wrong. 57 is Bilal's total.
  • E: wrong. 60 > 57 > 56, so Asha is on top.
  • F: correct. 66 > 53 > 51. Changing the weights changed the topper.
  • G: correct. Each formula is a sum of number × variable, with no constant.

Answer. A, C, F, G.

All three totals together form one linear mapping T:R3→R3T:\mathbb{R}^3 \to \mathbb{R}^3, whose matrix is the marks table divided by 100:

T(x1,x2,x3)=[TATBTC]=1100[604070308050505060][x1x2x3]\begin{aligned} T(x_1,x_2,x_3) &=\begin{bmatrix} T_A \\ T_B \\ T_C \end{bmatrix} \\ &=\dfrac{1}{100}\begin{bmatrix} 60 & 40 & 70 \\ 30 & 80 & 50 \\ 50 & 50 & 60 \end{bmatrix}\begin{bmatrix} x_1 \\ x_2 \\ x_3 \end{bmatrix} \end{aligned}
About percentages

If a question says "x1=20%x_1=20\%", substitute x1=20x_1=20 (the formula already contains 1100\frac{1}{100}). Substituting 0.2 makes the answer 100 times too small.

Key takeaway
  • A linear mapping Rn→Rm\mathbb{R}^n \to \mathbb{R}^m: every output component is a sum of number × variable. No constants, powers, products, |x| or sin.
  • Its matrix: row i = coefficients of output i; size = outputs × inputs; column j = f(ej)f(e_j).
  • Weighted marks: a student's row of marks gives the coefficients, with 1100\frac{1}{100}; substitute the percentage number directly.
Revision overview
Mapf: ℝⁿ → ℝᵐ
n numbers in, m out
Linear mappingeach output = sum of
number × variable
Not linearconstant, x², xy, |x|, sin
Linear mappingsWeek 5 · Part 4
Matrixrow i = coefficients of output i
size m × n, column j = f(eⱼ)
Weighted marksa student's row × weights
with 1/100
Revision: linear mappings and their matrices
Next · Linear maps · Part 5 of 5Linear Transformations, One-one and Onto
05
Linear maps · Part 5 of 5

Linear Transformations, One-one and Onto

A linear mapping was defined by its formula. A linear transformation is defined by how it behaves: it respects addition and scaling. In ℝⁿ the two ideas turn out to be the same thing, and that is what makes every graded assignment question here solvable with a matrix.

5.1Definition of a linear transformation

Let VV and WW be vector spaces (in this course mostly V=RnV=\mathbb{R}^n, W=RmW=\mathbb{R}^m). A function T:V→WT:V\to W is a linear transformation if for all u,v∈Vu,v\in V and every real number cc both rules hold:

(1) Additivity:   T(u+v)=T(u)+T(v)\text{(1) Additivity: }\; T(u+v)=T(u)+T(v)
(2) Homogeneity (scaling):   T(cu)=c T(u)\text{(2) Homogeneity (scaling): }\; T(cu)=c\, T(u)

The two rules can also be checked together in one line (an equally valid test):

T(cu+dv)=c T(u)+d T(v)T(cu+dv)=c\, T(u)+d\, T(v)for all u,v and all c,d\text{for all }u,v\text{ and all }c,d

Think of the shop bill from Section 4.2: (1) combine two orders and the bills add; (2) multiply the order by cc and the bill is multiplied by cc. Every linear mapping does both, because A(u+v)=Au+AvA(u+v)=Au+Av and A(cu)=c AuA(cu)=c\, Au.

5.2Three consequences of the definition

(a) T(0)=0T(0)=0. Put c=0c=0 in the scaling rule:

T(0)=T(0⋅v)=0⋅T(v)=0T(0)=T(0\cdot v)=0\cdot T(v)=0

This is the fastest test: if T(0)≠0T(0)\neq 0, then TT cannot be linear. But note that T(0)=0T(0)=0 does not prove linearity (see options B and E of Example 5.1).

(b) T(−v)=−T(v)T(-v)=-T(v). Put c=−1c=-1 in the scaling rule. This is the best way to catch functions like ∣x∣|x|.

(c) Combinations come out of T:

T(c1v1+c2v2+⋯+ckvk)=c1T(v1)+c2T(v2)+⋯+ckT(vk)T(c_1 v_1+c_2 v_2+\cdots+c_k v_k)=c_1 T(v_1)+c_2 T(v_2)+\cdots+c_k T(v_k)

All the questions in Sections 5.5 to 5.7 are solved with this.

5.3In ℝⁿ → ℝᵐ: linear transformation = linear mapping = matrix

For maps Rn→Rm\mathbb{R}^n \to \mathbb{R}^m these three statements say the same thing:

T is a linear transformationT\text{ is a linear transformation}⟺T is a linear mapping\Longleftrightarrow T\text{ is a linear mapping}
⟺T(x)=Ax   for some m×n matrix A\Longleftrightarrow T(x)=Ax\; \text{ for some }m\times n\text{ matrix }A

Matrix ⇒ linear transformation: A(u+v)=Au+AvA(u+v)=Au+Av and A(cu)=cAuA(cu)=cAu. Done.

Linear transformation ⇒ matrix: write x=x1e1+⋯+xnenx=x_1 e_1+\cdots+x_n e_n and apply 5.2(c):

T(x)=x1T(e1)+x2T(e2)+⋯+xnT(en)=[ T(e1)    T(e2)    ⋯    T(en) ]⏟A: columns=T(ej)[x1⋮xn]\begin{aligned} T(x) &=x_1 T(e_1)+x_2 T(e_2)+\cdots+x_n T(e_n) \\ &=\underbrace{\Big[ \, T(e_1)\; \; T(e_2)\; \; \cdots \; \; T(e_n)\, \Big]}_{A\text{: columns}=T(e_j)}\begin{bmatrix} x_1 \\ \vdots \\ x_n \end{bmatrix} \end{aligned}

So to build the matrix of TT, just put T(e1),…,T(en)T(e_1),\dots,T(e_n) in as the columns. This matrix is called the (standard) matrix of TT.

5.4How to check whether a map is linear

Step 1: is T(0) = 0? Put every variable equal to 0 Step 2: is every component (number)·x₁ + … + (number)·xₙ ? No constant, x², xy, |x| or sin x Step 3: look for a counterexample Try c = −1, or c = 2, or u = v = (1,1,…) NOT linear Linear write its matrix Found → NOT linear one failing case is enough noyes yesno / not sure
Figure 5. A flowchart for checking linearity. Step 1 quickly rejects maps with a constant; Step 2 confirms the linear ones; Step 3 catches the hidden non-linear ones (such as |x| or xy).
Example 5.1Which maps are linear transformations? (MSQ)
A
T:R2→R2,  T(x,y)=(2x−5y,  3x+y)T:\mathbb{R}^2 \to \mathbb{R}^2,\; T(x,y)=(2x-5y,\; 3x+y)
B
T:R→R2,  T(x)=(0,  4∣x∣)T:\mathbb{R}\to \mathbb{R}^2,\; T(x)=(0,\; 4|x|)
C
T:R2→R3,  T(x,y)=(x+2,  3y,  x−y)T:\mathbb{R}^2 \to \mathbb{R}^3,\; T(x,y)=(x+2,\; 3y,\; x-y)
D
T:R2→R,  T(x,y)=5y−2xT:\mathbb{R}^2 \to \mathbb{R},\; T(x,y)=5y-2x
E
T:R2→R2,  T(x,y)=(xy,  x)T:\mathbb{R}^2 \to \mathbb{R}^2,\; T(x,y)=(xy,\; x)
F
T:R3→R3,  T(x,y,z)=(x−z,  0,  7y)T:\mathbb{R}^3 \to \mathbb{R}^3,\; T(x,y,z)=(x-z,\; 0,\; 7y)
Solution
Prove A fully from the definition

(you should be able to do this once). Let u=(x1,y1)u=(x_1,y_1), v=(x2,y2)v=(x_2,y_2):

T(u+v)=( 2(x1+x2)−5(y1+y2),3(x1+x2)+(y1+y2) )\begin{aligned} T(u+v) = \big(\, & 2(x_1+x_2)-5(y_1+y_2), \\ & 3(x_1+x_2)+(y_1+y_2) \,\big) \end{aligned}
=(2x1−5y1,  3x1+y1)+(2x2−5y2,  3x2+y2)=T(u)+T(v)\begin{aligned} &= \big( 2x_1-5y_1,\; 3x_1+y_1 \big) \\ &\quad + \big( 2x_2-5y_2,\; 3x_2+y_2 \big) \\ &= T(u)+T(v) \end{aligned}
T(cu)=(2cx1−5cy1,  3cx1+cy1)=c (2x1−5y1,  3x1+y1)=c T(u)\begin{aligned} T(cu) &= \big( 2cx_1-5cy_1,\; 3cx_1+cy_1 \big) \\ &= c\, \big( 2x_1-5y_1,\; 3x_1+y_1 \big) \\ &= c\, T(u) \end{aligned}

Option B. T(0)=(0,0)T(0)=(0,0), so Step 1 passes. But there is an ∣x∣|x|, so go to Step 3 with c=−1c=-1, u=1u=1:

T(−1)=(0,  4∣−1∣)=(0,4)T(-1)=(0,\; 4|-1|)=(0,4)−T(1)=−(0,4)=(0,−4)-T(1)=-(0,4)=(0,-4)(0,4)≠(0,−4)(0,4)\neq (0,-4)

Option C. T(0,0)=(0+2,  0,  0)=(2,0,0)≠0T(0,0)=(0+2,\; 0,\; 0)=(2,0,0)\neq 0. Step 1 fails.

Option E. T(0,0)=(0,0)T(0,0)=(0,0), passes. But there is an xyxy. Take c=2c=2, u=(1,1)u=(1,1):

T(2,2)=(4,  2)T(2,2)=(4,\; 2)2 T(1,1)=2 (1,  1)=(2,2)2\, T(1,1)=2\, (1,\; 1)=(2,2)(4,2)≠(2,2)(4,2)\neq (2,2)
  • A: correct. Proved above. Matrix [2−531]\begin{bmatrix} 2 & -5 \\ 3 & 1 \end{bmatrix}.
  • B: wrong. Fails even though T(0)=0T(0)=0: T(−1)≠−T(1)T(-1)\neq-T(1).
  • C: wrong. T(0)≠0T(0)\neq 0 (the constant 2).
  • D: correct. −2x+5y-2x+5y: number × variable. Matrix [−25]\begin{bmatrix}-2 & 5 \end{bmatrix} (1×21\times 2).
  • E: wrong. xyxy is a product: T(2u)≠2T(u)T(2u)\neq 2T(u).
  • F: correct. A zero component is fine. Matrix [10−1000070]\begin{bmatrix} 1 & 0 & -1 \\ 0 & 0 & 0 \\ 0 & 7 & 0 \end{bmatrix}.

Answer. A, D, F.

Trap

Do not call a map linear just because T(0)=0T(0)=0. B and E both give T(0)=0T(0)=0 and are still not linear. T(0)=0T(0)=0 is necessary, not sufficient.

5.5Finding T from its values on the standard basis

A direct use of Section 5.3: T(x,y)=x T(1,0)+y T(0,1)T(x,y)=x\, T(1,0)+y\, T(0,1). Geometrically (Figure 6), wherever the corners e1,e2e_1,e_2 of the unit square go, the whole grid follows.

Example 5.2A formula from T(1,0) and T(0,1)

TT is linear with T(1,0)=(2,1)T(1,0)=(2,1) and T(0,1)=(−1,3)T(0,1)=(-1,3). Find T(x,y)T(x,y), its matrix, and T(3,2)T(3,2).

Solution
T(x,y)=x (2,1)+y (−1,3)=(2x−y,  x+3y)T(x,y)=x\, (2,1)+y\, (-1,3)=(2x-y,\; x+3y)
A=[2−113]A=\begin{bmatrix} 2 & -1 \\ 1 & 3 \end{bmatrix}(column 1=T(e1),  column 2=T(e2))(\text{column 1}=T(e_1),\; \text{column 2}=T(e_2))
T(3,2)=(6−2,  3+6)=(4,9)T(3,2)=(6-2,\; 3+6)=(4,9)

Answer. T(x,y)=(2x−y,  x+3y)T(x,y)=(2x-y,\; x+3y), T(3,2)=(4,9)T(3,2)=(4,9).

e₁ = (1,0)e₂ = (0,1) T(e₁) = (2,1)T(e₂) = (−1,3) (1,1)T(1,1) = (1,4) T beforeafter T
Figure 6. T(x,y)=(2x−y,  x+3y)T(x,y)=(2x-y,\; x+3y). The unit square becomes a parallelogram whose edges are T(e1)T(e_1) and T(e2)T(e_2). T(1,1)=T(e1)+T(e2)=(1,4)T(1,1)=T(e_1)+T(e_2)=(1,4): the sum came out of TT.

5.6Finding T from its values on another basis

Sometimes the values are given not at (1,0),(0,1)(1,0),(0,1) but on some other basis. Method: first write (x,y)(x,y) as a combination of that basis, then apply 5.2(c).

Example 5.3Given T(1,1) and T(1,−1)

TT is linear, T(1,1)=(3,1)T(1,1)=(3,1) and T(1,−1)=(1,5)T(1,-1)=(1,5). Find T(x,y)T(x,y) and T(4,2)T(4,2).

Solution

1. Write (x,y)=a(1,1)+b(1,−1)(x,y)=a(1,1)+b(1,-1) and match components:

a+b=xa+b=xa−b=y⇒a=x+y2,a-b=y\quad \Rightarrow \quad a=\dfrac{x+y}{2},b=x−y2b=\dfrac{x-y}{2}

2. Apply linearity:

T(x,y)=x+y2(3,1)+x−y2(1,5)T(x,y)=\dfrac{x+y}{2}(3,1)+\dfrac{x-y}{2}(1,5)
=(3x+3y+x−y2,  x+y+5x−5y2)=\left( \dfrac{3x+3y+x-y}{2},\; \dfrac{x+y+5x-5y}{2} \right)
=(4x+2y2,  6x−4y2)=(2x+y,  3x−2y)\begin{aligned} &=\left( \dfrac{4x+2y}{2},\; \dfrac{6x-4y}{2} \right) \\ &=(2x+y,\; 3x-2y) \end{aligned}

3. Check. T(1,1)=(3,1)T(1,1)=(3,1) ✓, T(1,−1)=(2−1,  3+2)=(1,5)T(1,-1)=(2-1,\; 3+2)=(1,5) ✓.

4. T(4,2)=(8+2,  12−4)=(10,8)T(4,2)=(8+2,\; 12-4)=(10,8). (Shortcut: (4,2)=3(1,1)+1(1,−1)(4,2)=3(1,1)+1(1,-1), so T(4,2)=3(3,1)+(1,5)=(10,8)T(4,2)=3(3,1)+(1,5)=(10,8).)

Answer. T(x,y)=(2x+y,  3x−2y)T(x,y)=(2x+y,\; 3x-2y), T(4,2)=(10,8)T(4,2)=(10,8).

5.7Is a third given value consistent? (questions with k)

Once T(1,0)T(1,0) and T(0,1)T(0,1) are given, linearity already fixes the value of TT at every point. If the question also gives a value at a third point, it must equal that fixed value. This gives a condition on the unknown (such as kk).

Example 5.4For which k can T be linear?

For T:R2→R2T:\mathbb{R}^2 \to \mathbb{R}^2 we know T(1,0)=(k,2)T(1,0)=(k,2), T(0,1)=(2,k)T(0,1)=(2,k) and T(1,2)=(k2+2k−2,  k2+3k−4)T(1,2)=(k^2+2k-2,\; k^2+3k-4). For which values of kk can TT be a linear transformation?

Solution

1. What T(1,2) must be by linearity. (1,2)=1⋅(1,0)+2⋅(0,1)(1,2)=1\cdot (1,0)+2\cdot (0,1), so

T(1,2)=T(1,0)+2 T(0,1)=(k,2)+(4,2k)=(k+4,  2k+2)\begin{aligned} T(1,2) &=T(1,0)+2\, T(0,1) \\ &=(k,2)+(4,2k) \\ &=(k+4,\; 2k+2) \end{aligned}

2. Equate with the given value, one component at a time

1st: k2+2k−2=k+4\text{1st: }k^2+2k-2=k+4⇒k2+k−6=0\Rightarrow k^2+k-6=0⇒(k+3)(k−2)=0\Rightarrow (k+3)(k-2)=0⇒k∈{−3, 2}\Rightarrow k\in \{-3,\, 2\}
2nd: k2+3k−4=2k+2\text{2nd: }k^2+3k-4=2k+2⇒k2+k−6=0\Rightarrow k^2+k-6=0⇒k∈{−3, 2}\Rightarrow k\in \{-3,\, 2\}

3. Both components must hold at the same time, so take the common part of the two sets: {−3,2}\{-3,2\}.

4. Check k = 2. Given: (4+4−2,  4+6−4)=(6,6)(4+4-2,\; 4+6-4)=(6,6). By linearity: (2+4,  4+2)=(6,6)(2+4,\; 4+2)=(6,6). ✓

Answer. k=−3k=-3 or k=2k=2. (The second part of this question, "not injective", is Example 5.9.)

Trap

Do not stop after finding kk from one component. Take the intersection of the conditions from both components. Sometimes one component gives two values and the other gives only one; then the answer is only the common value.

5.8Injective (one-one), surjective (onto) and bijective

Graded assignment questions often ask "is TT one-one or onto?" or "for which kk is TT not injective?". With rank, nullity and the determinant, these take a minute. The definitions hold for any function:

  • Injective (one-one): different inputs always give different outputs; two different inputs never land on the same output. Formally: T(u)=T(v)⇒u=vT(u)=T(v)\Rightarrow u=v.
  • Surjective (onto): every element of the codomain is the output of some input. Nothing in the codomain is left out.
  • Bijective: both one-one and onto. A bijective linear TT is called an isomorphism, and its inverse is also linear.
One-one, not onto Onto, not one-one Bijective one element is never reached two inputs share one output every element has one partner
Figure 7. Three situations. The red circle marks the problem: in the first, one element of the codomain is left empty (onto fails); in the second, two inputs land on one output (one-one fails).

5.9Kernel and image

For a linear T:Rn→RmT:\mathbb{R}^n \to \mathbb{R}^m, T(x)=AxT(x)=Ax, there are two special sets:

ker⁡(T)={v:  T(v)=0}=N(A)\ker (T)=\{v:\; T(v)=0\}=N(A)Im⁡(T)={T(v):  v∈Rn}\operatorname{Im}(T)=\{T(v):\; v\in \mathbb{R}^n \}
  • Kernel = the vectors that go to zero = the null space of AA. Its dimension is the nullity.
  • Image (range) = all possible outputs = the span of the columns of AA (column space). Its dimension is the rank, because AxAx is a combination of the columns.

The rank–nullity theorem in the language of transformations:

dim⁡ker⁡(T)+dim⁡Im⁡(T)=n=dim⁡(domain)\dim \ker (T)+\dim \operatorname{Im}(T)=n=\dim (\text{domain})

The nn input directions split into two parts: some are "lost" (the kernel), the rest build the output (the image).

5.10Checking injectivity and surjectivity with rank, nullity and determinant

One-one ⇔ kernel = {0} ⇔ nullity 0. If some non-zero vv goes to zero, then uu and u+vu + v have the same output: T(u+v)=T(u)+0=T(u)T(u+v)=T(u)+0=T(u). Two different inputs, one output, so TT is not one-one. Conversely, if the kernel is only {0}\{0\} and T(u)=T(v)T(u)=T(v):

T(u−v)=T(u)−T(v)=0T(u-v)=T(u)-T(v)=0⇒u−v∈ker⁡T={0}\Rightarrow u-v\in \ker T=\{0\}⇒u=v\Rightarrow u=v
T one-oneT\text{ one-one}⟺ker⁡T={0}\Longleftrightarrow \ker T=\{0\}⟺nullity⁡(A)=0\Longleftrightarrow \operatorname{nullity}(A)=0⟺rank⁡(A)=n\Longleftrightarrow \operatorname{rank}(A)=n

Onto ⇔ rank = m. Onto means the image is all of Rm\mathbb{R}^m. The dimension of the image is the rank, and a subspace of Rm\mathbb{R}^m with dimension mm is the whole Rm\mathbb{R}^m:

T ontoT\text{ onto}⟺Im⁡T=Rm\Longleftrightarrow \operatorname{Im}T=\mathbb{R}^m⟺rank⁡(A)=m\Longleftrightarrow \operatorname{rank}(A)=m

Deciding from the size alone. Remember rank⁡(A)≤min⁡(m,n)\operatorname{rank}(A)\le \min (m,n). This settles some cases immediately:

Size of T:Rn→RmT:\mathbb{R}^n \to \mathbb{R}^mCan it be one-one?Can it be onto?How to decide
n>mn>m
more inputs, e.g. R3→R2\mathbb{R}^3 \to \mathbb{R}^2
✗ Never
nullity⁡≥n−m>0\operatorname{nullity}\ge n-m>0
PossiblyOnto   ⟺  rank⁡=m\; \Longleftrightarrow \; \operatorname{rank}=m
n<mn<m
fewer inputs, e.g. R2→R3\mathbb{R}^2 \to \mathbb{R}^3
Possibly✗ Never
rank⁡≤n<m\operatorname{rank}\le n<m
One-one   ⟺  rank⁡=n\; \Longleftrightarrow \; \operatorname{rank}=n
n=mn=m
square
One-one   ⟺  \; \Longleftrightarrow \; onto   ⟺  det⁡A≠0\; \Longleftrightarrow \; \det A\neq 0Just the determinant

Recall that for a square matrix det⁡A≠0  ⟺  rank⁡(A)=n\det A\neq 0\; \Longleftrightarrow \; \operatorname{rank}(A)=n, and for 2×2, det⁡[abcd]=ad−bc.\det \begin{bmatrix} a & b \\ c & d \end{bmatrix}=ad-bc.

Why is the square case special? When n=mn=m, "rank = n" means "nullity 0" (one-one) and "rank = m" (onto) at the same time. Both are true together or false together. So for a square matrix, "one-one but not onto" or "onto but not one-one" is impossible.

n=m:det⁡A≠0n=m:\quad \det A\neq 0⟺bijective\Longleftrightarrow \text{bijective}det⁡A=0\det A=0⟺neither one-one nor onto\Longleftrightarrow \text{neither one-one nor onto}

5.11Worked examples

Example 5.5T(v) = Av with det ≠ 0 (MSQ)

T:R2→R2T:\mathbb{R}^2 \to \mathbb{R}^2, T(v)=AvT(v)=Av, where v=[xy]v=\begin{bmatrix} x \\ y \end{bmatrix} and A=[6−495]A=\begin{bmatrix} 6 & -4 \\ 9 & 5 \end{bmatrix}. Which options are correct?

A
TT is one-one but not onto.
B
TT is a linear transformation.
C
TT is both one-one and onto.
D
TT is neither one-one nor onto.
E
ker⁡T={0}\ker T=\{0\}.
Solution

1. A map given by a matrix is always linear (Section 5.3).

2. The matrix is square, so use the determinant:

det⁡A=6⋅5−(−4)⋅9=30+36=66≠0\det A=6\cdot 5-(-4)\cdot 9=30+36=66\neq 0

3. Non-zero determinant → rank 2 → nullity 0 (one-one) and rank = 2 = m (onto).

  • A: wrong. For a square matrix "one-one but not onto" is impossible.
  • B: correct. T(v)=AvT(v)=Av.
  • C: correct. det⁡≠0\det \neq 0.
  • D: wrong. That would need det⁡A=0\det A=0.
  • E: correct. Nullity 0.

Answer. B, C, E.

Example 5.6A square matrix with det = 0

A=[36−2−4]A=\begin{bmatrix} 3 & 6 \\-2 & -4 \end{bmatrix}, T(v)=AvT(v)=Av. Is TT one-one? Onto? Find the kernel and the image.

Solution
det⁡A=3(−4)−6(−2)=−12+12=0\det A=3(-4)-6(-2)=-12+12=0
Kernel

3x+6y=03x+6y=0 and −2x−4y=0-2x-4y=0 both mean x=−2yx=-2y. So ker⁡T=span⁡{(−2,1)}\ker T=\operatorname{span}\{(-2,1)\}, nullity 1.

Two inputs, one output (proof that it is not one-one)

T(0,0)=(0,0)T(0,0)=(0,0) and T(−2,1)=(−6+6,  4−4)=(0,0)T(-2,1)=(-6+6,\; 4-4)=(0,0).

Image

The columns are (3,−2)(3,-2) and (6,−4)=2(3,−2)(6,-4)=2(3,-2). The image is span⁡{(3,−2)}\operatorname{span}\{(3,-2)\}, a line, not all of R2\mathbb{R}^2. Rank 1.

Answer. Neither one-one nor onto. ker⁡=span⁡{(−2,1)}\ker=\operatorname{span}\{(-2,1)\}, Im⁡=span⁡{(3,−2)}\operatorname{Im}=\operatorname{span}\{(3,-2)\}. Check: 1+1=21+1=2. ✓

Example 5.7ℝ³ → ℝ² (more inputs)

T(x,y,z)=(x+y,  y−z)T(x,y,z)=(x+y,\; y-z). One-one? Onto?

Solution
A=[11001−1]A=\begin{bmatrix} 1 & 1 & 0 \\ 0 & 1 & -1 \end{bmatrix}→R1→R1−R2[10101−1]\xrightarrow{R_1 \to R_1-R_2}\begin{bmatrix} \textcolor{#4fd1b5}{1} & 0 & \textcolor{#f5b041}{1} \\ 0 & \textcolor{#4fd1b5}{1} & \textcolor{#f5b041}{-1} \end{bmatrix}

Rank 2 =m=m → onto. Nullity 3−2=13-2=1 → not one-one. Kernel: x=−z,  y=zx=-z,\; y=z → span⁡{(−1,1,1)}\operatorname{span}\{(-1,1,1)\}. Check: T(−1,1,1)=(−1+1,  1−1)=(0,0)T(-1,1,1)=(-1+1,\; 1-1)=(0,0). ✓

Answer. Onto, not one-one. (The size already told us it cannot be one-one: 3>23>2.)

Example 5.8ℝ² → ℝ³ (fewer inputs)

T(x,y)=(x,  y,  x+y)T(x,y)=(x,\; y,\; x+y). One-one? Onto?

Solution

A=[100111]A=\begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{bmatrix}. The first two rows already form the identity, so rank 2 =n=n → nullity 0 → one-one. Rank 2 <3=m<3=m → not onto.

A vector that is never an output: (0,0,1)(0,0,1). If T(x,y)=(0,0,1)T(x,y)=(0,0,1), then x=0,  y=0x=0,\; y=0, but the third component is x+y=0≠1x+y=0\neq 1.

Answer. One-one, not onto.

5.12Linear but not injective: questions with k

Example 5.9The second part of Example 5.4 (numerical)

T:R2→R2T:\mathbb{R}^2 \to \mathbb{R}^2: T(1,0)=(k,2)T(1,0)=(k,2), T(0,1)=(2,k)T(0,1)=(2,k), T(1,2)=(k2+2k−2,  k2+3k−4)T(1,2)=(k^2+2k-2,\; k^2+3k-4), k∈Rk\in \mathbb{R}. Find the value of kk for which TT is a linear transformation that is not injective.

Solution

1. When is T linear. From Example 5.4: k∈{−3, 2}k\in \{-3,\, 2\}.

2. The matrix. Columns =T(e1),T(e2)=T(e_1),T(e_2):

A=[k22k]A=\begin{bmatrix} k & 2 \\ 2 & k \end{bmatrix}

3. When is it not injective. The matrix is square, so not injective   ⟺  det⁡A=0\; \Longleftrightarrow \; \det A=0:

det⁡A=k⋅k−2⋅2=k2−4=0\det A=k\cdot k-2\cdot 2=k^2-4=0⇒k=2  or  k=−2\Rightarrow k=2\; \text{or}\; k=-2

4. Both conditions together. The common part of the "linear" list {−3,2}\{-3,2\} and the "det = 0" list {2,−2}\{2,-2\} is only k=2k=2.

5. Check. For k=2k=2: A=[2222]A=\begin{bmatrix} 2 & 2 \\ 2 & 2 \end{bmatrix} and T(1,−1)=(2−2,  2−2)=(0,0)T(1,-1)=(2-2,\; 2-2)=(0,0). A non-zero vector goes to zero, so TT is not injective. ✓ For k=−3k=-3, det⁡=9−4=5≠0\det=9-4=5\neq 0, so there TT is both linear and injective.

Answer. k=2k=2. (If the question asked for "linear and injective", the answer would be −3-3.)

Traps

(1) Writing k=±2k=\pm 2 from det⁡=0\det=0 alone and forgetting the linearity condition. At k=−2k=-2, TT is not even linear. (2) Building the matrix wrongly: the columns are T(e1),T(e2)T(e_1),T(e_2). (In this example the matrix is symmetric, so it makes no difference, but that is not always the case.)

Key takeaway
  • Linear transformation: T(u+v)=T(u)+T(v)T(u+v)=T(u)+T(v) and T(cu)=cT(u)T(cu)=cT(u).
  • T(0)=0T(0)=0 is necessary (if it fails, the answer is "no") but not sufficient. Try c=−1c=-1 for ∣x∣|x|, and c=2c=2 for xyxy or x2x^2.
  • Rn→Rm\mathbb{R}^n \to \mathbb{R}^m: linear transformation = linear mapping = AxAx. The columns of the matrix are T(e1),…,T(en)T(e_1),\dots,T(e_n).
  • Values on another basis: first write (x,y)(x,y) in that basis, then use linearity. A third value with kk: compute the value linearity demands, equate each component, intersect.
  • Kernel = null space (dim = nullity), image = column space (dim = rank). One-one   ⟺  \; \Longleftrightarrow \; nullity 0   ⟺  \; \Longleftrightarrow \; rank = n. Onto   ⟺  \; \Longleftrightarrow \; rank = m.
  • n>mn>m: never one-one. n<mn<m: never onto. Square: det⁡≠0  ⟺  \det \neq 0\; \Longleftrightarrow \; bijective; det⁡=0  ⟺  \det=0\; \Longleftrightarrow \; neither. A "just one of the two" option is always wrong for a square matrix.
Revision overview
DefinitionT(u + v) = T(u) + T(v)
T(cu) = c T(u)
Quick testT(0) ≠ 0 → not linear
then try c = −1 or c = 2
Matrix of Tcolumns are T(e₁), …, T(eₙ)
other basis: rewrite first
Linear transformationsWeek 5 · Part 5
Kernel and imageker T = N(A), dim = nullity
Im T = column space, dim = rank
One-one and ontoone-one ⟺ nullity 0
onto ⟺ rank = m · square: det
Revision: linear transformations, one-one and onto
Next · Graded assignment stylePractice Questions
06
Graded assignment style

Practice Questions

These 14 questions follow the graded assignment format (MSQ and numerical). Solve each one yourself first, then open "Show solution". Every solution names the section it uses.

6.1Null space, rank and nullity

Q1Basis of the null space

Multiple Select Question (MSQ): select all that apply.

A=[1302001−12613]A=\begin{bmatrix} 1 & 3 & 0 & 2 \\ 0 & 0 & 1 & -1 \\ 2 & 6 & 1 & 3 \end{bmatrix}. Which options are correct?

A
nullity⁡(A)=2\operatorname{nullity}(A)=2
B
{(−3,1,0,0),(−2,0,1,1)}\{(-3,1,0,0),(-2,0,1,1)\} is a basis of the null space
C
{(3,−1,0,0),(−2,0,1,1)}\{(3,-1,0,0),(-2,0,1,1)\} is a basis of the null space
D
{(−3,1,0,0)}\{(-3,1,0,0)\} is a basis of the null space
E
{(1,3,0,2),(0,0,1,−1)}\{(1,3,0,2),(0,0,1,-1)\} is a basis of the null space
F
rank⁡(A)=3\operatorname{rank}(A)=3
Solution

R3→R3−2R1R_3 \to R_3-2R_1 gives (0,0,1,−1)(0,0,1,-1), then R3→R3−R2R_3 \to R_3-R_2 gives a zero row. RREF:

[1302001−10000]\begin{bmatrix} \textcolor{#4fd1b5}{1} & \textcolor{#f5b041}{3} & 0 & \textcolor{#f5b041}{2} \\ 0 & \textcolor{#f5b041}{0} & \textcolor{#4fd1b5}{1} & \textcolor{#f5b041}{-1} \\ 0 & \textcolor{#f5b041}{0} & 0 & \textcolor{#f5b041}{0} \end{bmatrix}x1=−3x2−2x4,x3=x4x_1=-3x_2-2x_4,\quad x_3=x_4

Free variables x2,x4x_2,x_4 → basis {(−3,1,0,0),(−2,0,1,1)}\{(-3,1,0,0),(-2,0,1,1)\}, nullity 2, rank 2.

Answer. A, B, C. In C the first vector is multiplied by −1-1 (still fine). D has only one vector (the nullity is 2). E contains rows of A, and A(1,3,0,2)≠0A(1,3,0,2)\neq 0. F: the rank is 2. (Sections 2.1, 2.8, 1.7)

Q2Nullity from the size and the rank

Numerical Answer Type (NAT): enter a number.

A∈M4×7(R)A\in M_{4\times 7} (\mathbb{R}) has rank 3. What is nullity⁡(A)\operatorname{nullity}(A)?

Solution

nullity⁡=n−rank⁡=7−3=4\operatorname{nullity}=n-\operatorname{rank}=7-3=4. (The 4 rows, mm, play no part.) Answer: 4. (Section 3.1)

Q3Only the size is given

Multiple Select Question (MSQ): select all that apply.

A∈M6×4(R)A\in M_{6\times 4} (\mathbb{R}) is non-zero. Choose the correct statements.

A
The rank is at most 4.
B
The nullity is at most 3.
C
The nullity is at least 2.
D
Ax=0Ax=0 must have a non-zero solution.
E
The rank can be 6.
Solution

1≤rank⁡≤min⁡(6,4)=41\le \operatorname{rank}\le \min (6,4)=4, so the nullity =4−rank⁡∈{3,2,1,0}=4-\operatorname{rank}\in \{3,2,1,0\}.

Answer. A, B. C is wrong (rank 4 gives nullity 0). D is wrong (the nullity can be 0). E is wrong (there are only 4 columns). (Section 3.3)

Q4Maximum rank of a product

Numerical Answer Type (NAT): enter a number.

AA is a 5×35\times 3 matrix and BB is a 3×63\times 6 matrix. The null space of AA is 1-dimensional and the null space of BB is 5-dimensional. What is the maximum possible rank of ABAB?

Solution
rank⁡(A)=3−1=2\operatorname{rank}(A)=3-1=2rank⁡(B)=6−5=1\operatorname{rank}(B)=6-5=1rank⁡(AB)≤min⁡(2,1)=1\operatorname{rank}(AB)\le \min (2,1)=1

Answer. 1. This time the narrow pipe is BB. (Section 3.6)

Q5A diagonal matrix

Numerical Answer Type (NAT): enter a number.

DD is a 5×55\times 5 diagonal matrix with diagonal entries 0,4,0,0,90,4,0,0,9. What is nullity⁡(D)\operatorname{nullity}(D)?

Solution

Rank = number of non-zero diagonal entries = 2. Nullity =5−2=3=5-2=3, and N(D)=span⁡{e1,e3,e4}N(D)=\operatorname{span}\{e_1,e_3,e_4 \}. Answer: 3. (Section 3.5)

Q6Independent variables from the RREF

Numerical Answer Type (NAT): enter a number.

MM is a 4×64\times 6 matrix whose RREF is [10200101−100300010−2000000]\begin{bmatrix} 1 & 0 & 2 & 0 & 0 & 1 \\ 0 & 1 & -1 & 0 & 0 & 3 \\ 0 & 0 & 0 & 1 & 0 & -2 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{bmatrix}. How many independent (free) variables does Mx=0Mx=0 have?

Solution

The pivots are in columns 1, 2 and 4 (rank 3). Free: x3,x5,x6x_3,x_5,x_6. Column 5 is entirely zero, and it is free too. Answer: 3 =6−3=6-3. (Section 3.4)

6.2Ratings and chemical equations

Q7Vectors from cafe ratings

Multiple Select Question (MSQ): select all that apply.

4 customers rate a cafe from 1 to 4 stars. A rating of jj stars is the vector ej∈R4e_j \in \mathbb{R}^4; no rating is the zero vector. Which statements about the dimension of the span of the 4 row vectors are correct?

A
2★, 2★, 4★, 1★ → dimension 3
B
Everyone gives 3★ → dimension 1
C
1★, 2★, 3★, 4★ → dimension 4
D
4★, 1★, (no rating), 4★ → dimension 3
Solution

Count the different eje_j. A: e2,e4,e1e_2,e_4,e_1 → 3. B: e3e_3 → 1. C: all four → 4. D: e4,e1e_4,e_1 → 2.

Answer. A, B, C. (Section 3.7)

Q8Null space of a rating matrix

Multiple Select Question (MSQ): select all that apply.

The matrix of the ratings in option A of Q7 is A=[0100010000011000]A=\begin{bmatrix} 0 & 1 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 \end{bmatrix}. Which statements are correct?

A
{e3}\{e_3 \} is a basis of the null space.
B
nullity⁡(A)=1\operatorname{nullity}(A)=1.
C
{e1,e3}\{e_1,e_3 \} spans the null space.
D
rank⁡(A)=3\operatorname{rank}(A)=3.
E
{(0,0,5,0)}\{(0,0,5,0)\} spans the null space.
Solution

Nobody gave 3★, so only column 3 is zero. N(A)=span⁡{e3}N(A)=\operatorname{span}\{e_3 \}, nullity 1, rank 3.

Answer. A, B, D, E. C is wrong because e1∉N(A)e_1 \notin N(A) (column 1 is not zero). (Sections 2.7, 1.6)

Q9Making water

Multiple Select Question (MSQ): select all that apply.

x1 H2+x2 O2⟶x3 H2Ox_1 \, H_2+x_2 \, O_2 \longrightarrow x_3 \, H_2 O. Which options about the linear system that balances it are correct?

A
The nullity is 1.
B
{(2,1,2)}\{(2,1,2)\} is a basis of the null space.
C
{(1,2,1)}\{(1,2,1)\} is a basis of the null space.
D
The rank of the matrix is 2.
E
There are infinitely many ways to balance it.
Solution
H: 2x1=2x3\text{H: }2x_1=2x_3O: 2x2=x3\text{O: }2x_2=x_3⇒\Rightarrowx3=t,  x1=t,  x2=t2x_3=t,\; x_1=t,\; x_2=\frac{t}{2}

t=2t=2 gives (2,1,2)(2,1,2): 2H2+O2→2H2O2H_2+O_2 \to 2H_2 O. 2 equations, 3 unknowns, rank 2, nullity 1.

Answer. A, B, D, E. C is wrong: for (1,2,1)(1,2,1) hydrogen balances (2⋅1=22\cdot 1=2 on both sides), but oxygen gives 2⋅2=4≠12\cdot 2=4\neq 1. (Section 2.10)

6.3Linear mapping and linear transformation

Q10Weighted marks

Numerical Answer Type (NAT): enter a number.

Ravi scores 70 in the Quiz and 50 in the End sem; Sita scores 40 and 80. Total =x1%=x_1 \% of the Quiz +  x2%+\; x_2 \% of the End sem. What is Ravi's total for x1=40,  x2=60x_1=40,\; x_2=60?

Solution
TR=1100(70x1+50x2)=1100(2800+3000)=58\begin{aligned} T_R &=\frac{1}{100}(70x_1+50x_2) \\ &=\frac{1}{100}(2800+3000) \\ &=58 \end{aligned}

Answer. 58. (Sita: 1100(1600+4800)=64\frac{1}{100}(1600+4800)=64, so Sita is ahead.) (Section 4.6)

Q11Which maps are linear transformations?

Multiple Select Question (MSQ): select all that apply.

A
T(x,y)=(x−y,  0,  2y)T(x,y)=(x-y,\; 0,\; 2y)
B
T(x,y)=(x+y+1,  x)T(x,y)=(x+y+1,\; x)
C
T(x)=(2x,  x2)T(x)=(2x,\; x^2)
D
T(x,y,z)=3x−2y+zT(x,y,z)=3x-2y+z
E
T(x,y)=(∣x−y∣,  0)T(x,y)=(|x-y|,\; 0)
F
T(x,y)=(2 x,  πy)T(x,y)=(\sqrt{2}\, x,\; \pi y)
Solution

B: T(0,0)=(1,0)≠0T(0,0)=(1,0)\neq 0. C: T(2⋅1)=(4,4)T(2\cdot 1)=(4,4) but 2T(1)=(4,2)2T(1)=(4,2). E: T(−1,0)=(1,0)T(-1,0)=(1,0) but −T(1,0)=(−1,0)-T(1,0)=(-1,0). In A, D and F every component is "number × variable" (2\sqrt{2} and π\pi are just numbers).

Answer. A, D, F. (Section 5.4)

Q12A map with det = 0

Multiple Select Question (MSQ): select all that apply.

T(v)=AvT(v)=Av, A=[2−34−6]A=\begin{bmatrix} 2 & -3 \\ 4 & -6 \end{bmatrix}. Which options are correct?

A
TT is one-one but not onto.
B
TT is neither one-one nor onto.
C
(3,2)∈ker⁡T(3,2)\in \ker T.
D
The image is all of R2\mathbb{R}^2.
Solution

det⁡A=2(−6)−(−3)(4)=−12+12=0\det A=2(-6)-(-3)(4)=-12+12=0. Square with det 0 → neither one-one nor onto. A(3,2)=(6−6,  12−12)=(0,0)A(3,2)=(6-6,\; 12-12)=(0,0).

Answer. B, C. (Sections 5.10, 5.11)

Q13Values on another basis

Numerical Answer Type (NAT): enter a number.

TT is linear, T(1,2)=(5,0)T(1,2)=(5,0) and T(0,1)=(1,−1)T(0,1)=(1,-1). What is the first component of T(2,3)T(2,3)?

Solution

(x,y)=x(1,2)+(y−2x)(0,1)(x,y)=x(1,2)+(y-2x)(0,1). So

T(x,y)=x(5,0)+(y−2x)(1,−1)=(3x+y,  2x−y)\begin{aligned} T(x,y) &= x(5,0)+(y-2x)(1,-1) \\ &= (3x+y,\; 2x-y) \end{aligned}T(2,3)=(9,  1)T(2,3)=(9,\; 1)

Answer. 9. (Section 5.6)

Q14k: linear but not injective

Numerical Answer Type (NAT): enter a number.

T:R2→R2T:\mathbb{R}^2 \to \mathbb{R}^2: T(1,0)=(1,k)T(1,0)=(1,k), T(0,1)=(k,4)T(0,1)=(k,4), T(1,1)=(k2−5,  k2−2)T(1,1)=(k^2-5,\; k^2-2). For which value of kk is TT a linear transformation that is not injective?

Solution
Linearity

T(1,1)=T(1,0)+T(0,1)=(1+k,  k+4)T(1,1)=T(1,0)+T(0,1)=(1+k,\; k+4).

1st: k2−5=1+k\text{1st: }k^2-5=1+k⇒k2−k−6=0\Rightarrow k^2-k-6=0⇒(k−3)(k+2)=0\Rightarrow (k-3)(k+2)=0⇒k∈{3,−2}\Rightarrow k\in \{3,-2\}
2nd: k2−2=k+4\text{2nd: }k^2-2=k+4⇒k2−k−6=0\Rightarrow k^2-k-6=0⇒k∈{3,−2}\Rightarrow k\in \{3,-2\}
Not injective

A=[1kk4]A=\begin{bmatrix} 1 & k \\ k & 4 \end{bmatrix}, det⁡A=4−k2=0⇒k=±2\det A=4-k^2=0\Rightarrow k=\pm 2.

Common value

{3,−2}∩{2,−2}={−2}\{3,-2\}\cap \{2,-2\}=\{-2\}. Answer: −2. (Sections 5.7, 5.12)

Key takeaway for all of Week 5
  • Null space = the solutions of Ax=0Ax=0; nullity = free variables; rank = pivots; rank⁡+nullity⁡=n\operatorname{rank}+\operatorname{nullity}=n.
  • Basis: RREF → set one free variable = 1 at a time. Check: inside N(A)? Right count? Independent?
  • Linear = every component is a sum of "number × variable" = AxAx; T(0)=0T(0)=0 is necessary, not sufficient.
  • The columns of the matrix of T are T(ej)T(e_j). One-one   ⟺  \; \Longleftrightarrow \; nullity 0; onto   ⟺  \; \Longleftrightarrow \; rank = m; for a square matrix, use the determinant.
Next · All partsWeek 5 Summary Sheet
07
All parts

Week 5 Summary Sheet

Everything from this week on one sheet. Use it for quick revision before a quiz.

Ideas at a glance

Null space · what goes to zero
  • N(A)={x∈Rn:Ax=0}N(A) = \{x \in \mathbb{R}^n : Ax = 0\}, a subspace.
  • Nullity = number of free variables.
  • Basis: one vector per free variable.
Rank–nullity · counting columns
  • rank⁡+nullity⁡=n\operatorname{rank} + \operatorname{nullity} = n (columns).
  • Non-zero AA: 1≤rank⁡≤min⁡(m,n)1 \le \operatorname{rank} \le \min(m,n).
  • rank⁡(AB)≤min⁡(rank⁡A,rank⁡B)\operatorname{rank}(AB) \le \min(\operatorname{rank}A, \operatorname{rank}B).
Linear maps · number × variable
  • Linear mapping = AxAx = linear transformation.
  • Matrix columns are T(e1),…,T(en)T(e_1), \dots, T(e_n).
  • T(0)=0T(0) = 0 is necessary, not sufficient.
One-one and onto · rank tests
  • One-one   ⟺  \iff nullity 0   ⟺  \iff rank =n= n.
  • Onto   ⟺  \iff rank =m= m.
  • Square: det⁡A≠0  ⟺  \det A \neq 0 \iff bijective.

Formula sheet at a glance

Null space
DefinitionN(A)={x∈Rn:Ax=0}N(A) = \{x \in \mathbb{R}^n : Ax = 0\}
Nullitynullity⁡(A)=dim⁡N(A)\operatorname{nullity}(A) = \dim N(A)
Zero columnej∈N(A)  ⟺  column j of A is zeroe_j \in N(A) \iff \text{column } j \text{ of } A \text{ is zero}
Rank and nullity
Theoremrank⁡(A)+nullity⁡(A)=n\operatorname{rank}(A) + \operatorname{nullity}(A) = n
Size only1≤rank⁡(A)≤min⁡(m,n)(A≠0)1 \le \operatorname{rank}(A) \le \min(m, n) \quad (A \neq 0)
Productrank⁡(AB)≤min⁡(rank⁡A,rank⁡B)\operatorname{rank}(AB) \le \min(\operatorname{rank}A, \operatorname{rank}B)
Linear maps
As a matrixf(x)=Ax,A is m×nf(x) = Ax, \quad A \text{ is } m \times n
ColumnsA=[ T(e1)    ⋯    T(en) ]A = \big[\, T(e_1) \;\; \cdots \;\; T(e_n) \,\big]
RulesT(u+v)=T(u)+T(v),T(cu)=c T(u)T(u + v) = T(u) + T(v), \quad T(cu) = c\,T(u)
ConsequenceT(0)=0T(0) = 0
Kernel and image
Kernelker⁡T=N(A),dim⁡ker⁡T=nullity⁡(A)\ker T = N(A), \quad \dim \ker T = \operatorname{nullity}(A)
Imagedim⁡Im⁡T=rank⁡(A)\dim \operatorname{Im} T = \operatorname{rank}(A)
Togetherdim⁡ker⁡T+dim⁡Im⁡T=n\dim \ker T + \dim \operatorname{Im} T = n
One-one and onto
One-onenullity⁡(A)=0  ⟺  rank⁡(A)=n\operatorname{nullity}(A) = 0 \iff \operatorname{rank}(A) = n
Ontorank⁡(A)=m\operatorname{rank}(A) = m
Squaredet⁡A≠0  ⟺  bijective\det A \neq 0 \iff \text{bijective}

Formulas and how to use them

Null space and nullity
DefinitionN(A)={x∈Rn:Ax=0}N(A) = \{x \in \mathbb{R}^n : Ax = 0\}
Nullitynullity⁡(A)=dim⁡N(A)=number of free variables\operatorname{nullity}(A) = \dim N(A) = \text{number of free variables}

Use whenYou must find the null space, a basis of it, or the nullity of a matrix.

  1. Reduce AA to RREF and mark the pivot columns.
  2. Solve each pivot variable in terms of the free variables (signs flip).
  3. For each free variable: set it to 1, the others to 0. These vectors are a basis; their count is the nullity.
ExampleA=[1224]A = \begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix} from Example 1.1.
x+2y=0⇒x=−2yN(A)=span⁡{(−2,1)}nullity⁡(A)=1\begin{gathered} x + 2y = 0 \Rightarrow x = -2y \\[6pt] N(A) = \operatorname{span}\{(-2, 1)\} \\[6pt] \operatorname{nullity}(A) = 1 \end{gathered}
Rank–nullity theorem
Theoremrank⁡(A)+nullity⁡(A)=n\operatorname{rank}(A) + \operatorname{nullity}(A) = n
Size only1≤rank⁡(A)≤min⁡(m,n)(A≠0)1 \le \operatorname{rank}(A) \le \min(m, n) \quad (A \neq 0)

Use whenYou know the rank and want the nullity (or the other way round), or only the size of the matrix is given.

  1. Find nn, the number of columns, never the rows.
  2. Subtract: nullity =n−= n - rank.
  3. Size only: list every possible rank from 1 to min⁡(m,n)\min(m, n) and its nullity.
ExampleA∈M4×7(R)A \in M_{4 \times 7}(\mathbb{R}) with rank 3 (Practice Q2).
n=7nullity⁡(A)=7−3=4\begin{gathered} n = 7 \\[6pt] \operatorname{nullity}(A) = 7 - 3 = 4 \end{gathered}
Rank of a product
Boundrank⁡(AB)≤min⁡(rank⁡A,rank⁡B)\operatorname{rank}(AB) \le \min(\operatorname{rank}A, \operatorname{rank}B)

Use whenA question gives two matrices (often only their sizes and nullities) and asks for the maximum possible rank of ABAB.

  1. Get each rank from its own number of columns: rank =n−= n - nullity.
  2. Take the smaller rank. That minimum can always be reached.
  3. Rank 0 means the zero matrix, so then AB=0AB = 0.
ExampleAA is 3×53 \times 5 with nullity 3, BB is 5×45 \times 4 with nullity 1 (Example 3.5).
rank⁡A=5−3=2,rank⁡B=4−1=3rank⁡(AB)≤min⁡(2,3)=2\begin{gathered} \operatorname{rank}A = 5 - 3 = 2, \quad \operatorname{rank}B = 4 - 1 = 3 \\[6pt] \operatorname{rank}(AB) \le \min(2, 3) = 2 \end{gathered}
Matrix of a linear map
As a matrixf(x)=Ax,A is m×nf(x) = Ax, \quad A \text{ is } m \times n
ColumnsA=[ T(e1)    T(e2)    ⋯    T(en) ]A = \big[\, T(e_1) \;\; T(e_2) \;\; \cdots \;\; T(e_n) \,\big]

Use whenA linear map is given by a formula, or by its values on some vectors, and you need its matrix.

  1. From a formula: row ii = coefficients of output ii; write 0 for a missing variable.
  2. From values: put T(e1),…,T(en)T(e_1), \dots, T(e_n) in as columns.
  3. Values on another basis: first write (x,y)(x, y) in that basis, then use linearity.
Examplef(x,y,z)=(2x−y+3z, 4y−z)f(x, y, z) = (2x - y + 3z,\ 4y - z) from Example 4.1.
A=[2−1304−1]f(1,1,1)=(4,3)\begin{gathered} A = \begin{bmatrix} 2 & -1 & 3 \\ 0 & 4 & -1 \end{bmatrix} \\[6pt] f(1, 1, 1) = (4, 3) \end{gathered}
Linearity test
RulesT(u+v)=T(u)+T(v),T(cu)=c T(u)T(u + v) = T(u) + T(v), \quad T(cu) = c\,T(u)
ConsequenceT(0)=0T(0) = 0

Use whenYou must decide whether a given map is a linear transformation.

  1. If T(0)≠0T(0) \neq 0, it is not linear. Stop.
  2. If every component is a sum of number × variable, it is linear.
  3. Otherwise find a counterexample: c=−1c = -1 for ∣x∣|x|, c=2c = 2 for xyxy or x2x^2.
ExampleT(x)=(0, 4∣x∣)T(x) = (0,\ 4|x|) from Example 5.1 B.
T(−1)=(0,4),−T(1)=(0,−4)(0,4)≠(0,−4)⇒not linear\begin{gathered} T(-1) = (0, 4), \quad -T(1) = (0, -4) \\[6pt] (0, 4) \neq (0, -4) \Rightarrow \text{not linear} \end{gathered}
One-one and onto
One-oneker⁡T={0}  ⟺  nullity⁡(A)=0  ⟺  rank⁡(A)=n\ker T = \{0\} \iff \operatorname{nullity}(A) = 0 \iff \operatorname{rank}(A) = n
Ontorank⁡(A)=m\operatorname{rank}(A) = m
Squaredet⁡A≠0  ⟺  bijective\det A \neq 0 \iff \text{bijective}

Use whenA question asks whether T(x)=AxT(x) = Ax is one-one, onto, or for which kk it is not injective.

  1. Compare nn and mm: n>mn > m is never one-one, n<mn < m is never onto.
  2. Square: compute det⁡A\det A. Non-zero gives both, zero gives neither.
  3. Otherwise find the rank and compare it with nn and with mm.
ExampleA=[6−495]A = \begin{bmatrix} 6 & -4 \\ 9 & 5 \end{bmatrix} from Example 5.5.
det⁡A=30+36=66≠0one-one and onto\begin{gathered} \det A = 30 + 36 = 66 \neq 0 \\[6pt] \text{one-one and onto} \end{gathered}

The whole week in one table

TopicWhat to rememberHow to use it in a question
Null space, nullityN(A)={x∈Rn:Ax=0}N(A)=\{x\in \mathbb{R}^n :Ax=0\} (n = number of columns). Nullity = number of free variables.Reduce to RREF, count the free variables.
Basis of the null spaceSet one free variable = 1 (the other free ones = 0) → one vector each.Checking an option: is it in N(A)? Is the count = nullity? Independent? Multiples also work.
Zero columnej∈N(A)  ⟺  e_j \in N(A)\; \Longleftrightarrow \; column jj is zero.0–1 (rating) matrix: the star nobody gave is the eje_j in the null space.
Rank–nullity theoremrank⁡(A)+nullity⁡(A)=n\operatorname{rank}(A)+\operatorname{nullity}(A)=n.Only the size given: 1≤rank⁡≤min⁡(m,n)1\le \operatorname{rank}\le \min (m,n) for non-zero A, nullity⁡=n−rank⁡\operatorname{nullity}=n-\operatorname{rank}.
RREFRow operations do not change the null space or the rank.Nullity = n−rank⁡n-\operatorname{rank} = free variables (same in M and its RREF). Pivots = rank.
Scalar matrix cIncI_nc≠0c\neq 0: rank n, nullity 0. c=0c=0: rank 0, nullity n.Statements about "every scalar matrix" break at c=0c=0.
Product ABrank⁡(AB)≤min⁡(rank⁡A,rank⁡B)\operatorname{rank}(AB)\le \min (\operatorname{rank}A,\operatorname{rank}B).Each rank = (its own columns) − nullity; the bound is the min. Rank 0 → AB = 0.
Dimension of a spanPut the vectors as rows, find the rank.One-hot (rating) vectors: count the different eje_j.
Chemical equationsRows = elements, columns = molecules, product columns negative.Null space vector → smallest whole numbers. Nullity 1 → infinitely many ways.
Linear mappingEvery component = a sum of number × variable. Matrix: row i = output i.Marks table: a student's row × weights, with 1100\frac{1}{100}.
Linear transformationT(u+v)=T(u)+T(v)T(u+v)=T(u)+T(v), T(cu)=cT(u)T(cu)=cT(u), hence T(0)=0T(0)=0.Check T(0)T(0) → check the form → counterexample with c=−1c=-1 or c=2c=2.
Matrix of TColumns =T(e1),…,T(en)=T(e_1),\dots,T(e_n).Values on another basis: first write (x,y)(x,y) in that basis.
One-one / ontoOne-one   ⟺  nullity⁡=0\; \Longleftrightarrow \; \operatorname{nullity}=0. Onto   ⟺  rank⁡=m\; \Longleftrightarrow \; \operatorname{rank}=m.Square: det⁡≠0  ⟺  \det \neq 0\; \Longleftrightarrow \; both; det⁡=0  ⟺  \det=0\; \Longleftrightarrow \; neither.
Questions with kkThe value forced by linearity = the given value.(kk list from linearity) ∩ (kk list from the determinant).

Common traps

MistakeCorrect idea
Nullity = m−rank⁡m-\operatorname{rank}Nullity = n−rank⁡n-\operatorname{rank} (columns)
Non-zero rows of the original matrix = rankNon-zero rows of the RREF = rank
The basis of {0}\{0\} is {0}\{0\}The basis is the empty set ∅\varnothing, dimension 0
Copying an RREF entry straight into the basisThe sign flips when you solve for the pivot variable
T(0)=0T(0)=0, so T is linearNecessary, not sufficient (∣x∣|x| and xyxy also give T(0)=0T(0)=0)
Using a column of marks in the marks formulaUse the student's row of marks
Substituting 0.2 for x1=20%x_1=20\%Substitute 20 (the formula already has 1100\frac{1}{100})
Square matrix: "one-one but not onto"For a square matrix both hold together or fail together
Using the wrong nn when finding rank from nullityEach matrix has its own number of columns
Treating a row of the matrix as a null space vectorA non-zero row is never in the null space
kk: answering from det = 0 aloneApply the linearity condition first, then intersect
Back to top