Weeks
Mathematics 2Week 4 · Basis, Dimension and Rank
Week 4 Notes

Mathematics for
Data Science 2

Basis and dimension: what a basis is, how to find one, the dimension of a vector space, and rank by Gaussian elimination with the rows and columns methods.

5 chapters23 worked examples~46 min read
BasisDimensionRankGaussian elimination

Chapters

  1. 01What Is a Basis?Part 1
  2. 02Finding BasesPart 2
  3. 03DimensionPart 3
  4. 04Rank by Gaussian EliminationPart 4
  5. 05Week 4 Summary SheetAll parts
01
Basis and dimension · Part 1 of 4

What Is a Basis for a Vector Space?

R2\mathbb{R}^2 has infinitely many vectors. A basis is a small, finite list of vectors that is enough to build every one of them, with not one more than needed.

1.1Two ideas to recall

Spanning: "enough vectors"
  • span⁡(S)\operatorname{span}(S) is the set of all linear combinations a1v1+⋯+akvka_1v_1 + \cdots + a_kv_k.
  • If span⁡(S)=V\operatorname{span}(S) = V, every vector of VV can be built from SS.
  • The question to ask: can I reach everything?
Independence: "no vector wasted"
  • {v1,…,vk}\{v_1, \dots, v_k\} is linearly independent if a1v1+⋯+akvk=0a_1v_1 + \cdots + a_kv_k = 0 forces a1=⋯=ak=0a_1 = \cdots = a_k = 0.
  • Equivalently, no vector is a combination of the others.

1.2Definition of a basis

Definition: basis

A basis of a vector space VV is a set BB that is linearly independent and also spans VV.

In simple words

A basis is the smallest set of vectors that still gives complete information. It must be enough (it spans) and have no waste (it is independent).

Hinglish analogy

The screen makes every colour from Red, Green and Blue. You need all three and no more: an extra orange bulb is made from red and green, so it adds nothing. That is a dependent vector.

Too few1 vector: only a lineJust rightevery point reachableToo manyw = e₁ + e₂ is spareve₁e₂e₁e₂w
Figure 1. Too few vectors do not span, too many are dependent, and a basis is just right

Four sets in R²

SetSpans R²?Independent?Basis?
{(1,1)}\{(1,1)\}noyesno
{(1,0),(0,1)}\{(1,0),(0,1)\}yesyesyes
{(1,0),(0,1),(1,1)}\{(1,0),(0,1),(1,1)\}yesnono
{(1,2),(2,4)}\{(1,2),(2,4)\}nonono
Both properties are needed. The last row fails both: (2,4)=2(1,2)(2,4) = 2(1,2) makes it dependent, and every vector lies on one line, so it cannot span R2\mathbb{R}^2.
Spans Vspare vectorsIndependenttoo fewBASISjust rightremove spare vectors →← add missing vectors
Figure 2. A basis sits where "spans V" and "independent" overlap

1.3The standard basis

Definition: standard basis

eie_i has 11 in the ii-th coordinate and 00 elsewhere. {e1,…,en}\{e_1, \dots, e_n\} is a basis of Rn\mathbb{R}^n.

SpaceStandard basis
R2\mathbb{R}^2(1,0), (0,1)(1,0),\ (0,1)
R3\mathbb{R}^3(1,0,0), (0,1,0), (0,0,1)(1,0,0),\ (0,1,0),\ (0,0,1)
Rn\mathbb{R}^ne1=(1,0,…,0), …, en=(0,…,0,1)e_1 = (1,0,\dots,0),\ \dots,\ e_n = (0,\dots,0,1)
  • It spans: (x,y,z)=x(1,0,0)+y(0,1,0)+z(0,0,1)(x,y,z) = x(1,0,0) + y(0,1,0) + z(0,0,1).
  • It is independent: that combination is 00 only when x=y=z=0x = y = z = 0.
  • Size limit: in Rn\mathbb{R}^n any set with more than nn vectors is dependent, so a basis of Rn\mathbb{R}^n has at most nn vectors. Topic 3 shows it has exactly nn.

1.4A basis is not unique

Three different bases of R2\mathbb{R}^2 are {(1,0),(0,1)}\{(1,0),(0,1)\}, {(1,1),(1,0)}\{(1,1),(1,0)\} and {(1,1),(1,2)}\{(1,1),(1,2)\}. The vector does not change, only the recipe used to build it.

w = (3, 5)e₁e₂b₁b₂Same vector, two recipesStandard basis e₁, e₂w = 3·e₁ + 5·e₂coordinates (3, 5)Basis b₁ = (1,1), b₂ = (1,2)w = 1·b₁ + 2·b₂coordinates (1, 2)1·(1,1) + 2·(1,2) = (3,5) ✓
Figure 3. The vector w = (3, 5) in the standard basis and in the basis b₁ = (1,1), b₂ = (1,2)

Check: 1(1,1)+2(1,2)=(1,1)+(2,4)=(3,5)1(1,1) + 2(1,2) = (1,1) + (2,4) = (3,5).

1.5Unique coordinates

Theorem: unique representation

If B={b1,…,bn}B = \{b_1, \dots, b_n\} is a basis of VV, every v∈Vv \in V can be written in exactly one way as v=a1b1+⋯+anbnv = a_1b_1 + \cdots + a_nb_n.

  • Existence comes from spanning.
  • Uniqueness comes from independence. If v=∑aibi=∑cibiv = \sum a_ib_i = \sum c_ib_i, then (a1−c1)b1+⋯+(an−cn)bn=0(a_1 - c_1)b_1 + \cdots + (a_n - c_n)b_n = 0, and independence forces ai=cia_i = c_i for every ii.
  • These unique numbers are the coordinates of vv in the basis BB.

1.6Three ways to describe a basis

DescriptionMeaning
Independent and spanningenough vectors, none wasted (the definition)
Maximal independent setindependent, and adding any vector makes it dependent
Minimal spanning setspans VV, and removing any vector breaks the span

Why they agree. If BB is a basis and v∉Bv \notin B, then vv is a combination of BB, so B∪{v}B \cup \{v\} is dependent. Conversely, if BB is a maximal independent set and some vv lay outside span⁡(B)\operatorname{span}(B), then B∪{v}B \cup \{v\} would still be independent, contradicting maximality; so BB spans. The minimal spanning case works the same way.

This gives two strategies: keep adding to an independent set until it spans, or keep deleting from a spanning set until it is independent. That is Topic 2.

Worked examples

Example 1Is {(1,1), (1,0)} a basis of R²?

Show that {(1,1),(1,0)}\{(1,1),(1,0)\} is a basis of R2\mathbb{R}^2.

Solution
Plan

Test independence, then test spanning.

  1. Independence. a(1,1)+b(1,0)=(a+b, a)=(0,0)a(1,1) + b(1,0) = (a+b,\ a) = (0,0), so a+b=0a + b = 0 and a=0a = 0, giving b=0b = 0. Independent.
  2. Spanning. For any (x,y)(x,y) solve a+b=x, a=ya + b = x,\ a = y: a=y, b=x−ya = y,\ b = x - y. Verify: y(1,1)+(x−y)(1,0)=(x, y)y(1,1) + (x-y)(1,0) = (x,\ y). It spans R2\mathbb{R}^2.
  3. The coordinates of (x,y)(x,y) are (y, x−y)(y,\ x - y). Test (3,5)(3,5): (5,−2)(5,-2), and 5(1,1)−2(1,0)=(3,5)5(1,1) - 2(1,0) = (3,5).
  4. Cross-check: det⁡[1110]=0−1=−1≠0\det\begin{bmatrix}1&1\\1&0\end{bmatrix} = 0 - 1 = -1 \neq 0; with dim⁡R2=2\dim\mathbb{R}^2 = 2, two independent vectors span automatically.

Answer. Yes, a basis, with (x,y)=y(1,1)+(x−y)(1,0)(x,y) = y(1,1) + (x-y)(1,0).

Example 2Is {(1,2), (2,4)} a basis of R²?

Is {(1,2),(2,4)}\{(1,2),(2,4)\} a basis of R2\mathbb{R}^2?

Solution
Plan

Look for a non-trivial relation, then see what the span is.

  1. a(1,2)+b(2,4)=(a+2b, 2a+4b)=(0,0)a(1,2) + b(2,4) = (a + 2b,\ 2a + 4b) = (0,0) gives a+2b=0a + 2b = 0 and 2a+4b=02a + 4b = 0. The second is twice the first, so there is one real equation in 2 unknowns: infinitely many solutions.
  2. Take b=1, a=−2b = 1,\ a = -2: −2(1,2)+1(2,4)=(0,0)-2(1,2) + 1(2,4) = (0,0) with coefficients not both zero, so the set is dependent: (2,4)=2(1,2)(2,4) = 2(1,2).
  3. Span: a(1,2)+b(2,4)=(a+2b)(1,2)=t(1,2)a(1,2) + b(2,4) = (a + 2b)(1,2) = t(1,2), the line y=2xy = 2x. The vector (1,0)(1,0) would need t=1t = 1 and 2t=02t = 0, impossible, so it does not span.
  4. Cross-check: det⁡[1224]=4−4=0\det\begin{bmatrix}1&2\\2&4\end{bmatrix} = 4 - 4 = 0.

Answer. No. The set is dependent and only spans the line y=2xy = 2x.

Example 3Is {(1,0,0), (0,1,0)} a basis of R³?

Is {(1,0,0),(0,1,0)}\{(1,0,0),(0,1,0)\} a basis of R3\mathbb{R}^3?

Solution
Plan

Independent, but does it reach every point of R³?

  1. ae1+be2=(a,b,0)=(0,0,0)a e_1 + b e_2 = (a, b, 0) = (0,0,0) forces a=b=0a = b = 0: independent.
  2. Every combination (a,b,0)(a, b, 0) has third coordinate 00. The vector (0,0,1)(0,0,1) would need 0=10 = 1, so it is not in the span: the set does not span R3\mathbb{R}^3.
  3. dim⁡R3=3\dim\mathbb{R}^3 = 3, so every basis needs exactly 3 vectors; this set has only 2.
  4. It is, however, a basis of the xyxy-plane W={(x,y,0)}W = \{(x,y,0)\}, since (x,y,0)=xe1+ye2(x,y,0) = xe_1 + ye_2 and they are independent.

Answer. No. Independent, but it cannot reach (0,0,1)(0,0,1). It is a basis of the xyxy-plane only.

Example 4A new basis from an old one

If {v1,v2,v3}\{v_1, v_2, v_3\} is a basis of R3\mathbb{R}^3, show that {v1, v1+v2, v1+v3}\{v_1,\ v_1 + v_2,\ v_1 + v_3\} is also a basis.

Solution
Plan

Let u1=v1, u2=v1+v2, u3=v1+v3u_1 = v_1,\ u_2 = v_1 + v_2,\ u_3 = v_1 + v_3. Test independence, then spanning.

  1. Independence. au1+bu2+cu3=0au_1 + bu_2 + cu_3 = 0 gives (a+b+c)v1+b v2+c v3=0(a + b + c)v_1 + b\,v_2 + c\,v_3 = 0. Since the viv_i are independent, a+b+c=0, b=0, c=0a + b + c = 0,\ b = 0,\ c = 0, so a=0a = 0 too.
  2. Spanning. v1=u1, v2=u2−u1, v3=u3−u1v_1 = u_1,\ v_2 = u_2 - u_1,\ v_3 = u_3 - u_1. Any w=αv1+βv2+γv3=(α−β−γ)u1+βu2+γu3w = \alpha v_1 + \beta v_2 + \gamma v_3 = (\alpha - \beta - \gamma)u_1 + \beta u_2 + \gamma u_3, so the uiu_i span R3\mathbb{R}^3.
  3. Matrix check: the coefficient matrix [111010001]\begin{bmatrix}1&1&1\\0&1&0\\0&0&1\end{bmatrix} has determinant 1≠01 \neq 0, so the change of basis is invertible.

Answer. Independent (only a=b=c=0a = b = c = 0) and spanning, so it is a basis.

Revision overview
Definitionlinearly independent AND spans V
enough vectors, none wasted
Standard basise₁, …, eₙ: one 1, the rest 0
many other bases exist
Other ways to say itmaximal independent set
minimal spanning set
What is a basis?Week 4 · Part 1
Too few, too manytoo few: does not span
too many: not independent
basis: just right
Why it mattersevery vector is a unique
combination of the basis
Revision: what a basis is, on one map
Next · Basis and dimension · Part 2 of 4Finding Bases for Vector Spaces
02
Basis and dimension · Part 2 of 4

Finding Bases for Vector Spaces

Knowing what a basis is, how do we find one? There are two strategies, build up and trim down, plus a recipe for subspaces described by an equation.

2.1Route 1: build up from nothing

Idea

Start with no vectors. Keep adding a vector that is not yet reachable (outside the current span) until the span is all of VV.

  1. Start with the empty set, whose span is just {0}\{0\}.
  2. Pick a non-zero vector of VV and add it.
  3. If the span is not yet VV, pick a vector of VV that is not in the span of the current set, and add it.
  4. Repeat until the span equals VV. The set you built is a basis.

Each new vector lies outside the span of the earlier ones, so it can never be a combination of them. That is why the set stays independent at every step.

Example 5Build a basis of R² from scratch

Build a basis of R2\mathbb{R}^2 starting from the empty set.

Solution
Plan

Build-up method: add a vector outside the current span until the span is R2\mathbb{R}^2.

  1. Start with the empty set. S=∅S = \varnothing has span {0}\{0\}, which is not R2\mathbb{R}^2, so add a vector.
  2. Add a non-zero vector. Choose (1,1)(1,1); S={(1,1)}S = \{(1,1)\} has span {t(1,1)}={(t,t)}\{t(1,1)\} = \{(t,t)\}, the line y=xy = x. One non-zero vector is independent, but (1,0)(1,0) has x≠yx \neq y, so it is not on this line. Add another.
  3. Add a vector off the line y=xy = x. Choose (1,2)(1,2) (1≠21 \neq 2). Now S={(1,1),(1,2)}S = \{(1,1),(1,2)\}.
  4. Independent? a(1,1)+b(1,2)=(a+b, a+2b)=(0,0)a(1,1) + b(1,2) = (a + b,\ a + 2b) = (0,0): subtracting the equations gives b=0b = 0, then a=0a = 0. Yes.
  5. Spans? Solve a+b=x, a+2b=ya + b = x,\ a + 2b = y: b=y−xb = y - x, a=x−b=2x−ya = x - b = 2x - y.
  6. Verify. (2x−y)(1,1)+(y−x)(1,2)=(2x−y+y−x, 2x−y+2y−2x)=(x,y)(2x - y)(1,1) + (y - x)(1,2) = (2x - y + y - x,\ 2x - y + 2y - 2x) = (x, y). Every (x,y)(x,y) is reached, so we can stop.
  7. Conclude. The set is independent and spans, so it is a basis with 2 vectors. Other starting vectors give other bases, but the count is always 2.

Answer. {(1,1),(1,2)}\{(1,1),(1,2)\}, with (x,y)=(2x−y)(1,1)+(y−x)(1,2)(x,y) = (2x - y)(1,1) + (y - x)(1,2).

2.2Route 2: trim down from a spanning set

Idea

Start with a set that already spans VV. Keep deleting a vector that is a combination of the others. Deleting such a vector never reduces the span.

  1. Start with a spanning set of VV.
  2. Look for a vector that can be written as a combination of the other vectors in the set.
  3. If there is one, delete it (only one) and go back to step 2.
  4. If no vector is a combination of the others, the set is independent. It is a basis.
Delete one vector at a time
  • In {(1,2),(2,4)}\{(1,2),(2,4)\} each vector is a combination of the other, but deleting both would leave nothing. Remove one, then re-check the rest.
Example 6Trim a spanning set of R²

The set {(1,2),(2,3),(2,4),(4,5)}\{(1,2),(2,3),(2,4),(4,5)\} spans R2\mathbb{R}^2. Trim it down to a basis.

Solution
Plan

Trim-down method: delete one vector at a time that is a combination of the others, until nothing can be deleted.

  1. An obvious dependency. 2⋅(1,2)=(2,4)2\cdot(1,2) = (2,4), so (2,4)(2,4) is a multiple of (1,2)(1,2).
  2. Delete (2,4)(2,4) only. The set becomes {(1,2),(2,3),(4,5)}\{(1,2),(2,3),(4,5)\}. It still spans R2\mathbb{R}^2: anything built with (2,4)(2,4) can be rebuilt with 2⋅(1,2)2\cdot(1,2).
  3. Independent now? 3 vectors in R2\mathbb{R}^2 (dim⁡=2\dim = 2) must be dependent. Try (1,2)=p(2,3)+q(4,5)(1,2) = p(2,3) + q(4,5).
  4. Solve for p,qp, q. 2p+4q=1, 3p+5q=22p + 4q = 1,\ 3p + 5q = 2. Multiply by 3 and 2: 6p+12q=3, 6p+10q=46p + 12q = 3,\ 6p + 10q = 4. Subtract: 2q=−12q = -1, q=−12q = -\tfrac12, and 2p−2=12p - 2 = 1 gives p=32p = \tfrac32.
  5. Check. 32(2,3)−12(4,5)=(3,92)−(2,52)=(1,2)\tfrac32(2,3) - \tfrac12(4,5) = (3, \tfrac92) - (2, \tfrac52) = (1,2). Delete (1,2)(1,2): the set is now {(2,3),(4,5)}\{(2,3),(4,5)\}.
  6. Independent? a(2,3)+b(4,5)=0a(2,3) + b(4,5) = 0 gives 2a+4b=02a + 4b = 0, 3a+5b=03a + 5b = 0; a=−2ba = -2b, then −6b+5b=−b=0-6b + 5b = -b = 0, so b=0, a=0b = 0,\ a = 0. Cross-check: ∣2435∣=10−12=−2≠0\begin{vmatrix}2&4\\3&5\end{vmatrix} = 10 - 12 = -2 \neq 0.
  7. Still spans? Each deletion removed a vector that was a combination of those that stayed, so the span never shrank. Two independent vectors in the 2-dimensional R2\mathbb{R}^2 also span it automatically. Nothing can be deleted now.
  8. Conclude. {(2,3),(4,5)}\{(2,3),(4,5)\} is a basis (2 vectors). A different last choice also works: deleting (2,3)(2,3) instead of (1,2)(1,2) gives {(1,2),(4,5)}\{(1,2),(4,5)\} with determinant 5−8=−3≠05 - 8 = -3 \neq 0. The bases differ, but each has exactly 2 vectors.

Answer. Delete (2,4)=2(1,2)(2,4) = 2(1,2), then (1,2)=32(2,3)−12(4,5)(1,2) = \tfrac32(2,3) - \tfrac12(4,5). A basis is {(2,3),(4,5)}\{(2,3),(4,5)\}.

2.3The two routes side by side

Hinglish analogy

Cricket selectors build a squad in two ways. Build up: start with an empty squad and add a player who brings a new skill nobody has. Trim down: start with a squad of 25 and drop a player whose role is already covered. Either way you end with a tight squad where every player is needed and every role is covered. That is a basis.

Build upstart small, add what is missingTrim downstart big, remove what is spareStart with the empty setDoes the set span V?Add a vector of V that isnot in the span of the setStop: the set is a basisNoYesStart with a spanning setIs some vector a combinationof the others?Delete that vector(only one at a time)Stop: the set is a basisYesNoBoth routes end at a basis. The bases may differ, but they always have the same number of vectors.
Figure 4. Build up grows an independent set, trim down shrinks a spanning set

2.4Is this set a basis? A quick test

  1. Membership. Does every vector of the set really lie in VV? (For a subspace given by an equation, plug each vector into the equation.)
  2. Independence. Is no vector a combination of the others?
  3. Spanning. Can every vector of VV be built from the set?
Shortcut preview

Once you know dim⁡V=n\dim V = n (Topic 3), steps 2 and 3 collapse: a set of exactly nn vectors from VV is a basis as soon as it is independent. You then do not need to check spanning separately.

2.5A basis for a subspace given by an equation

Subspaces are often described by a condition, not a list of vectors. The recipe: solve the condition, write the general vector, split it by the free variables. Take V={(x,y,z,w)∈R4:x+z=y+w}V = \{(x,y,z,w) \in \mathbb{R}^4 : x + z = y + w\}.

  1. Solve for one variable: z=y+w−xz = y + w - x. The variables x,y,wx, y, w are free.
  2. Write the general vector: (x,y,z,w)=(x, y, y+w−x, w)(x,y,z,w) = (x,\ y,\ y + w - x,\ w).
  3. Split by the free variables: (x,y,z,w)=x(1,0,−1,0)+y(0,1,1,0)+w(0,0,1,1)(x,y,z,w) = x(1,0,-1,0) + y(0,1,1,0) + w(0,0,1,1).
  4. So V=span⁡{(1,0,−1,0),(0,1,1,0),(0,0,1,1)}V = \operatorname{span}\{(1,0,-1,0),(0,1,1,0),(0,0,1,1)\}. These three are independent because the x,y,wx, y, w coordinates form the identity pattern: each vector is the only one with a non-zero entry in its own free coordinate.
Rule of thumb

One basis vector per free variable. Here there are 3 free variables, so the basis has 3 vectors.

Example 7A basis of a plane

Find a basis of the plane x+y+z=0x + y + z = 0 in R3\mathbb{R}^3.

Solution
Plan

Recipe for a subspace given by an equation: solve the condition, write the general vector, split it by the free variables.

  1. Solve for one variable. z=−x−yz = -x - y. It is determined by the others, while xx and yy can be chosen freely: the free variables are xx and yy.
  2. General vector. (x,y,z)=(x, y, −x−y)(x,y,z) = (x,\ y,\ -x - y).
  3. Split by the free variables. (x,y,−x−y)=(x,0,−x)+(0,y,−y)=x(1,0,−1)+y(0,1,−1)(x, y, -x - y) = (x, 0, -x) + (0, y, -y) = x(1,0,-1) + y(0,1,-1).
  4. Spanning set. So V=span⁡{(1,0,−1),(0,1,−1)}V = \operatorname{span}\{(1,0,-1),(0,1,-1)\}.
  5. Membership. (1,0,−1)(1,0,-1): 1+0−1=01 + 0 - 1 = 0. (0,1,−1)(0,1,-1): 0+1−1=00 + 1 - 1 = 0. Both lie in VV.
  6. Independence. a(1,0,−1)+b(0,1,−1)=(a, b, −a−b)=0a(1,0,-1) + b(0,1,-1) = (a,\ b,\ -a - b) = 0 gives a=0a = 0, b=0b = 0. Independent.
  7. Test the recipe. (2,3,−5)(2,3,-5) is in VV (2+3−5=02 + 3 - 5 = 0), and 2(1,0,−1)+3(0,1,−1)=(2,0,−2)+(0,3,−3)=(2,3,−5)2(1,0,-1) + 3(0,1,-1) = (2,0,-2) + (0,3,-3) = (2,3,-5).
  8. Conclude. The set spans VV, is independent and lies in VV, so it is a basis. With 2 free variables, dim⁡V=2\dim V = 2: a plane has 2 basis vectors (one equation removes one dimension from the 3 of R3\mathbb{R}^3).

Answer. A basis of the plane x+y+z=0x + y + z = 0 is {(1,0,−1),(0,1,−1)}\{(1,0,-1),(0,1,-1)\}, so its dimension is 22.

Example 8Which sets are bases of V?

Let V={(x,y,z,w):x+z=y+w}⊆R4V = \{(x,y,z,w) : x + z = y + w\} \subseteq \mathbb{R}^4. Which of these sets is a basis of VV? (Multiple select: choose all that apply.)

1
{(1,0,0,0),(0,1,0,0),(0,0,0,1)}\{(1,0,0,0),(0,1,0,0),(0,0,0,1)\}
2
{(1,1,0,0),(0,1,−1,0),(0,−1,0,1)}\{(1,1,0,0),(0,1,-1,0),(0,-1,0,1)\}
3
{(1,0,−1,0),(1,1,0,0),(1,0,0,1)}\{(1,0,-1,0),(1,1,0,0),(1,0,0,1)\}
4
{(1,1,0,0),(0,1,1,0),(0,−1,0,1)}\{(1,1,0,0),(0,1,1,0),(0,-1,0,1)\}
Solution
Plan

A vector is in VV only if (sum of 1st and 3rd coordinates) = (sum of 2nd and 4th). First test membership of every vector, then independence.

  1. Find dim⁡V\dim V. z=y+w−xz = y + w - x, with x,y,wx, y, w free, so dim⁡V=3\dim V = 3 and a basis needs exactly 3 vectors. All four options have 3 vectors, so the count eliminates none.
  2. Strategy. (a) For each vector compute x+zx + z and y+wy + w; if they differ for even one vector, that option fails. (b) If all 3 are in VV, check independence: three independent vectors in a 3-dimensional space are automatically a basis.
  3. Option 1, membership.
    Vectorx+zx + zy+wy + wIn V?
    (1,0,0,0)(1,0,0,0)10No (1 ≠ 0)
    (0,1,0,0)(0,1,0,0)01No (0 ≠ 1)
    (0,0,0,1)(0,0,0,1)01No (0 ≠ 1)
    None lies in VV. Option 1 fails.
  4. Option 2, membership.
    Vectorx+zx + zy+wy + wIn V?
    (1,1,0,0)(1,1,0,0)11Yes
    (0,1,−1,0)(0,1,-1,0)−11No (−1 ≠ 1)
    (0,−1,0,1)(0,-1,0,1)00Yes
    (0,1,−1,0)(0,1,-1,0) is not in VV. Option 2 fails.
  5. Option 3, membership.
    Vectorx+zx + zy+wy + wIn V?
    u1=(1,0,−1,0)u_1 = (1,0,-1,0)00Yes
    u2=(1,1,0,0)u_2 = (1,1,0,0)11Yes
    u3=(1,0,0,1)u_3 = (1,0,0,1)11Yes
    All three are in VV.
  6. Option 3, independence. au1+bu2+cu3=(a+b+c, b, −a, c)=0au_1 + bu_2 + cu_3 = (a + b + c,\ b,\ -a,\ c) = 0 gives a+b+c=0a + b + c = 0, b=0b = 0, −a=0-a = 0, c=0c = 0. The yy, zz, ww equations give b=a=c=0b = a = c = 0, and the first then reads 0=00 = 0. Independent, so Option 3 is a basis.
  7. Option 4, membership.
    Vectorx+zx + zy+wy + wIn V?
    t1=(1,1,0,0)t_1 = (1,1,0,0)11Yes
    t2=(0,1,1,0)t_2 = (0,1,1,0)11Yes
    t3=(0,−1,0,1)t_3 = (0,-1,0,1)00Yes
  8. Option 4, independence. at1+bt2+ct3=(a, a+b−c, b, c)=0at_1 + bt_2 + ct_3 = (a,\ a + b - c,\ b,\ c) = 0: a=0a = 0, b=0b = 0, c=0c = 0 directly, and the yy-equation reads 0+0−0=00 + 0 - 0 = 0. Independent, so Option 4 is a basis.
  9. Final tally.
    #All vectors in V?Independent?Basis?
    1No–No
    2No–No
    3YesYesYes
    4YesYesYes

Answer. Options 3 and 4 are bases of VV. Options 1 and 2 contain vectors that are not in VV.

Revision overview
Build upstart from the empty set
add vectors outside the span
Trim downstart from a spanning set
delete a vector that is a
combination of the others
Equation subspacessolve for one variable
one basis vector per free variable
Finding basesWeek 4 · Methods
Where they endindependent and spanning
different routes, same size
Be carefuldelete one vector at a time
check vectors really lie in V
Revision: finding bases on one page
Next · Basis and dimension · Part 3 of 4Dimension: the Rank of a Vector Space
03
Basis and dimension · Part 3 of 4

Dimension: the Rank of a Vector Space

A space has many bases, but here is a surprising fact: every basis of a given space has the same number of vectors. That common number tells you how "big" the space is.

3.1Definition of dimension

Definition: dimension

The dimension of a vector space VV, written dim⁡(V)\dim(V), is the number of vectors in a basis of VV.

In simple words

Dimension is the number of independent directions in the space, or equivalently the number of independent numbers you need to describe one point of the space.

Another name

In the lecture videos this number is called the rank of the vector space. The textbook uses the word dimension. They mean the same thing. (Do not confuse it with the rank of a matrix, which comes in Topic 4. The two are linked, as you will see.)

Hinglish analogy

An auto-rickshaw runs on one straight road: 1 number (how many km ahead) is enough to say where it is, so the dimension is 1. A fielder on a cricket ground needs 2 numbers (front-back and left-right): dimension 2. A drone needs 3 numbers (height too): dimension 3. Dimension means: how many independent numbers it takes to give a position.

Point0just the zero vectorbasis: no vectorsLine1a line through the originbasis: 1 vectorPlane2a plane through the originbasis: 2 vectorsSpace3all of R³basis: 3 vectors
Figure 5. Inside R³: a point, a line, a plane and the whole space have dimensions 0, 1, 2 and 3

3.2Dimensions you should know

Since the standard basis of Rn\mathbb{R}^n has nn vectors, dim⁡(Rn)=n\dim(\mathbb{R}^n) = n. For matrices, let EijE_{ij} be the matrix with a 11 in row ii, column jj and zeros elsewhere. The mnmn matrices EijE_{ij} form a basis of Mm×n(R)M_{m\times n}(\mathbb{R}).

SpaceDimensionA basis
{0}\{0\} (zero space)0the empty set
Rn\mathbb{R}^nnne1,…,ene_1, \dots, e_n
Mm×n(R)M_{m\times n}(\mathbb{R})mnmnall EijE_{ij}
M2×2(R)M_{2\times 2}(\mathbb{R})4E11,E12,E21,E22E_{11}, E_{12}, E_{21}, E_{22}
Symmetric 2×22\times 23E11, E12+E21, E22E_{11},\ E_{12} + E_{21},\ E_{22}
Diagonal 2×22\times 22E11, E22E_{11},\ E_{22}
Scalar 2×22\times 21E11+E22E_{11} + E_{22} (the identity)
Upper triangular 2×22\times 23E11, E12, E22E_{11},\ E_{12},\ E_{22}
Lower triangular 2×22\times 23E11, E21, E22E_{11},\ E_{21},\ E_{22}

3.3Finding the dimension of a subspace

  1. Build a basis of the subspace (Topic 2).
  2. Count the vectors in it. That count is the dimension.

Example. Let W=span⁡{(1,0,0),(0,1,0),(3,5,0)}⊆R3W = \operatorname{span}\{(1,0,0),(0,1,0),(3,5,0)\} \subseteq \mathbb{R}^3. The third vector is 3(1,0,0)+5(0,1,0)3(1,0,0) + 5(0,1,0), so it can be dropped. The remaining {(1,0,0),(0,1,0)}\{(1,0,0),(0,1,0)\} is independent and spans WW, so it is a basis and dim⁡W=2\dim W = 2. Indeed all three vectors lie in the xyxy-plane.

3.4Handy consequences of "all bases have the same size"

Suppose dim⁡V=n\dim V = n. Then:

FactWhy it helps
Any set of more than nn vectors in VV is dependentToo many vectors: some are redundant
Any set of fewer than nn vectors cannot span VVToo few vectors: some directions are missed
nn independent vectors in VV form a basisOnly check independence, spanning is automatic
nn vectors that span VV form a basisOnly check spanning, independence is automatic
If WW is a subspace of VV, then dim⁡W≤dim⁡V\dim W \le \dim V, and dim⁡W=dim⁡V\dim W = \dim V only if W=VW = VA proper subspace is strictly smaller
Counting equations

A subspace of Rn\mathbb{R}^n cut out by kk independent homogeneous equations has dimension n−kn - k. For example, one equation in R4\mathbb{R}^4 leaves dimension 3, as we saw. Always check that the equations are really independent. (This is the idea behind the rank-nullity theorem you will meet later.)

Worked examples

Example 9Dimensions of matrix spaces

Choose the correct options.

1
dim⁡M1×2(R)=2\dim M_{1\times 2}(\mathbb{R}) = 2
2
dim⁡M2×1(R)=1\dim M_{2\times 1}(\mathbb{R}) = 1
3
dim⁡M3×3(R)=3\dim M_{3\times 3}(\mathbb{R}) = 3
4
{E11,E12,E21,E22}\{E_{11}, E_{12}, E_{21}, E_{22}\} is a basis of M2×2(R)M_{2\times 2}(\mathbb{R})
Solution
Plan

Everything follows from one fact: dim⁡Mm×n(R)=mn\dim M_{m\times n}(\mathbb{R}) = mn. First we see why it is true, then test the four options.

  1. Building-block matrices. EijE_{ij} has a 11 in row ii, column jj and 00 elsewhere. For 2×22\times 2: E11=[1000]E_{11} = \begin{bmatrix}1&0\\0&0\end{bmatrix}, E12=[0100]E_{12} = \begin{bmatrix}0&1\\0&0\end{bmatrix}, E21=[0010]E_{21} = \begin{bmatrix}0&0\\1&0\end{bmatrix}, E22=[0001]E_{22} = \begin{bmatrix}0&0\\0&1\end{bmatrix}.
  2. They span. [abcd]=aE11+bE12+cE21+dE22\begin{bmatrix}a&b\\c&d\end{bmatrix} = aE_{11} + bE_{12} + cE_{21} + dE_{22}. In general A=∑aijEijA = \sum a_{ij}E_{ij}.
  3. They are independent. ∑cijEij\sum c_{ij}E_{ij} is the matrix whose (i,j)(i,j) entry is cijc_{ij}; it is the zero matrix only if every cij=0c_{ij} = 0.
  4. Count. One EijE_{ij} per position: mm rows ×\times nn columns, so dim⁡Mm×n(R)=mn\dim M_{m\times n}(\mathbb{R}) = mn.
  5. Option 1. m=1, n=2m = 1,\ n = 2, so mn=2mn = 2. Concretely (a  b)=a(1  0)+b(0  1)(a\ \ b) = a(1\ \ 0) + b(0\ \ 1). True.
  6. Option 2. m=2, n=1m = 2,\ n = 1, so mn=2mn = 2, not 1: (ab)=a(10)+b(01)\begin{pmatrix}a\\b\end{pmatrix} = a\begin{pmatrix}1\\0\end{pmatrix} + b\begin{pmatrix}0\\1\end{pmatrix} needs two matrices. False.
  7. Option 3. m=n=3m = n = 3, so mn=9mn = 9, not 3. A 3×33\times 3 matrix has 9 independent entries. False.
  8. Option 4. These are exactly the four matrices of step 1; they span and are independent, and match mn=2⋅2=4mn = 2\cdot 2 = 4. True.
  9. Tally.
    #ClaimCorrect valueVerdict
    1dim⁡M1×2=2\dim M_{1\times 2} = 21⋅2=21\cdot 2 = 2True
    2dim⁡M2×1=1\dim M_{2\times 1} = 12⋅1=22\cdot 1 = 2False
    3dim⁡M3×3=3\dim M_{3\times 3} = 33⋅3=93\cdot 3 = 9False
    4E11,E12,E21,E22E_{11},E_{12},E_{21},E_{22} is a basisstandard basisTrue

Answer. Options 1 and 4 are correct.

Example 10Dimensions of special 2×2 matrices

Find the dimensions of: V1V_1 symmetric, V2V_2 scalar, V3V_3 diagonal, V4V_4 upper triangular, V5V_5 lower triangular 2×22\times 2 matrices.

Solution
Plan

For each type: (i) write the general element using the defining rule, (ii) split it into a combination of fixed matrices, (iii) check they are independent, (iv) count them.

  1. V1V_1 symmetric. Entry (1,2)(1,2) equals entry (2,1)(2,1): [abbc]=a[1000]+b[0110]+c[0001]\begin{bmatrix}a&b\\b&c\end{bmatrix} = a\begin{bmatrix}1&0\\0&0\end{bmatrix} + b\begin{bmatrix}0&1\\1&0\end{bmatrix} + c\begin{bmatrix}0&0\\0&1\end{bmatrix}. Independent, since the combination is zero only when a=b=c=0a = b = c = 0. dim⁡V1=3\dim V_1 = 3.
  2. V2V_2 scalar. A number times the identity: [a00a]=a[1001]\begin{bmatrix}a&0\\0&a\end{bmatrix} = a\begin{bmatrix}1&0\\0&1\end{bmatrix}. The identity is non-zero, so {I}\{I\} is independent. dim⁡V2=1\dim V_2 = 1.
  3. V3V_3 diagonal. [a00d]=aE11+dE22\begin{bmatrix}a&0\\0&d\end{bmatrix} = aE_{11} + dE_{22}, and these are independent. dim⁡V3=2\dim V_3 = 2.
  4. V4V_4 upper triangular (entry below the diagonal is 0): [ab0c]=aE11+bE12+cE22\begin{bmatrix}a&b\\0&c\end{bmatrix} = aE_{11} + bE_{12} + cE_{22}; independent (their 1s sit in different positions). dim⁡V4=3\dim V_4 = 3.
  5. V5V_5 lower triangular (entry above the diagonal is 0): [a0bc]=aE11+bE21+cE22\begin{bmatrix}a&0\\b&c\end{bmatrix} = aE_{11} + bE_{21} + cE_{22}; independent. dim⁡V5=3\dim V_5 = 3.
  6. Cross-check by counting conditions. M2×2(R)M_{2\times 2}(\mathbb{R}) has dimension 4. Write a general matrix as [pqrs]\begin{bmatrix}p&q\\r&s\end{bmatrix}; then dim⁡=4−(number of conditions)\dim = 4 - (\text{number of conditions}).
    TypeConditionsHow many4−that4 - that
    Symmetricq=rq = r13
    Scalarq=0, r=0, p=sq = 0,\ r = 0,\ p = s31
    Diagonalq=0, r=0q = 0,\ r = 022
    Upper triangularr=0r = 013
    Lower triangularq=0q = 013
    These agree with steps 1 to 5.
  7. Pick out dimension 3. dim⁡V1=3, dim⁡V2=1, dim⁡V3=2, dim⁡V4=3, dim⁡V5=3\dim V_1 = 3,\ \dim V_2 = 1,\ \dim V_3 = 2,\ \dim V_4 = 3,\ \dim V_5 = 3. So dimension 3 holds for V1V_1, V4V_4 and V5V_5.

Answer. dim⁡V1=3\dim V_1 = 3 (symmetric), dim⁡V2=1\dim V_2 = 1 (scalar), dim⁡V3=2\dim V_3 = 2 (diagonal), dim⁡V4=3\dim V_4 = 3 (upper), dim⁡V5=3\dim V_5 = 3 (lower).

Example 11Matrices with zero row sums

Find the dimension of V={A∈M3×2(R):the sum of entries in each row is 0}V = \{A \in M_{3\times 2}(\mathbb{R}) : \text{the sum of entries in each row is } 0\}.

Solution
Plan

A 3imes23 imes 2 matrix has 6 entries. The rule "each row sums to 0" is 3 conditions. Find the free entries, split the general matrix into pieces, count the pieces.

  1. General matrix. A=[p1q1p2q2p3q3]A = \begin{bmatrix}p_1&q_1\\p_2&q_2\\p_3&q_3\end{bmatrix}; row ii holds pip_i and qiq_i.
  2. Apply the rule to every row. p1+q1=0, p2+q2=0, p3+q3=0p_1 + q_1 = 0,\ p_2 + q_2 = 0,\ p_3 + q_3 = 0, so q1=−p1, q2=−p2, q3=−p3q_1 = -p_1,\ q_2 = -p_2,\ q_3 = -p_3.
  3. Free entries. Each qiq_i is decided by pip_i; p1,p2,p3p_1, p_2, p_3 can be chosen freely: 3 free entries. A typical matrix is [p1−p1p2−p2p3−p3]\begin{bmatrix}p_1&-p_1\\p_2&-p_2\\p_3&-p_3\end{bmatrix}.
  4. Split by the free entries. A=p1B1+p2B2+p3B3A = p_1B_1 + p_2B_2 + p_3B_3 with B1=[1−10000]B_1 = \begin{bmatrix}1&-1\\0&0\\0&0\end{bmatrix}, B2=[001−100]B_2 = \begin{bmatrix}0&0\\1&-1\\0&0\end{bmatrix}, B3=[00001−1]B_3 = \begin{bmatrix}0&0\\0&0\\1&-1\end{bmatrix}. Each BiB_i is itself in VV (its only non-zero row (1,−1)(1,-1) sums to 0), so B1,B2,B3B_1, B_2, B_3 span VV.
  5. Independence. p1B1+p2B2+p3B3p_1B_1 + p_2B_2 + p_3B_3 is the matrix from step 3; it is zero only when p1=p2=p3=0p_1 = p_2 = p_3 = 0 (look at the first column).
  6. Count. {B1,B2,B3}\{B_1, B_2, B_3\} is a basis of VV, so dim⁡V=3\dim V = 3.
  7. Cross-check by counting equations. M3×2(R)M_{3\times 2}(\mathbb{R}) has dimension 3⋅2=63\cdot 2 = 6. We imposed 3 conditions, independent because each involves different entries (p1,q1p_1, q_1 only, then p2,q2p_2, q_2 only, then p3,q3p_3, q_3 only). So dim⁡V=6−3=3\dim V = 6 - 3 = 3 ✓.

Answer. dim⁡V=3\dim V = 3, with basis B1,B2,B3B_1, B_2, B_3 (one for each row).

Example 12Two equations in R⁴

Find the dimension of V={(x,y,z,w):x+y=z+w, x+w=y+z}V = \{(x,y,z,w) : x + y = z + w,\ x + w = y + z\}.

Solution
Plan

Two equations in R4\mathbb{R}^4. Solve them together, find the free variables, and split the general vector.

  1. Everything on the left. x+y−z−w=0 (E1)x + y - z - w = 0\ (E_1) and x−y−z+w=0 (E2)x - y - z + w = 0\ (E_2).
  2. Subtract E2E_2 from E1E_1 to remove xx and zz: (x+y−z−w)−(x−y−z+w)=2y−2w=0(x + y - z - w) - (x - y - z + w) = 2y - 2w = 0, so y=wy = w.
  3. Substitute y=wy = w into E1E_1. x+y=z+yx + y = z + y, so x=zx = z.
  4. Free variables. z=xz = x and w=yw = y: xx and yy are free, z,wz, w are copies of them. Two free variables.
  5. General vector. (x,y,z,w)=(x,y,x,y)(x,y,z,w) = (x,y,x,y). Check E1E_1: x+y=x+yx + y = x + y ✓. E2E_2: x+w=x+yx + w = x + y and y+z=y+xy + z = y + x, equal ✓.
  6. Split. (x,y,x,y)=(x,0,x,0)+(0,y,0,y)=x(1,0,1,0)+y(0,1,0,1)(x,y,x,y) = (x,0,x,0) + (0,y,0,y) = x(1,0,1,0) + y(0,1,0,1).
  7. Independence. a(1,0,1,0)+b(0,1,0,1)=(a,b,a,b)=0a(1,0,1,0) + b(0,1,0,1) = (a,b,a,b) = 0 gives a=0, b=0a = 0,\ b = 0 ✓.
  8. Conclude and cross-check. A basis is {(1,0,1,0),(0,1,0,1)}\{(1,0,1,0),(0,1,0,1)\}, so dim⁡V=2\dim V = 2. Two equations in R4\mathbb{R}^4 give 4−2=24 - 2 = 2, valid because E1E_1 and E2E_2 are independent (their coefficient lists (1,1,−1,−1)(1,1,-1,-1) and (1,−1,−1,1)(1,-1,-1,1) are not multiples of each other).

Answer. V={(x,y,x,y)}V = \{(x,y,x,y)\} has basis {(1,0,1,0),(0,1,0,1)}\{(1,0,1,0),(0,1,0,1)\}, so dim⁡V=2\dim V = 2.

Revision overview
Definitiondim V = size of any basis
same for every basis of V
Standard valuesdim ℝⁿ = n
dim Mₘ×ₙ(ℝ) = mn
zero space has dimension 0
Counting trickbuild a basis, then count it
free variables = dimension
DimensionWeek 4 · Rank of a space
n vectors in dim nn independent: a basis
n spanning: a basis
Subspace W of Vdim W ≤ dim V
equal only when W = V
Revision: dimension on one page
Next · Basis and dimension · Part 4 of 4Rank and Dimension Using Gaussian Elimination
04
Basis and dimension · Part 4 of 4

Rank and Dimension Using Gaussian Elimination

Hunting for bases by hand works for small examples. Gaussian elimination makes it mechanical: reduce a matrix to a staircase shape, then read the rank, a basis and the dimension straight off it.

4.1Gaussian elimination in a minute

You can change a matrix using three elementary row operations:

  • Swap two rows: Ri↔RjR_i \leftrightarrow R_j.
  • Scale a row by a non-zero number: Ri→cRiR_i \to cR_i.
  • Add a multiple of one row to another: Ri→Ri+cRjR_i \to R_i + cR_j.

Use them to reach a row echelon form (REF): all-zero rows at the bottom, and the first non-zero entry (the pivot) of each row sits to the right of the pivot above it, with zeros below every pivot.

≠ 0∗∗∗∗0≠ 0∗∗∗000≠ 0∗00000zeros below the staircasePivot: first non-zero entry of a row∗Any number, zero allowed1. Each pivot is to the right of the pivot above it2. All-zero rows sit at the bottom3 pivots = 3 non-zero rows, so rank = 3
Figure 6. A row echelon form is a staircase of pivots with zeros below
Why this is allowed

Every row operation can be undone by another row operation. So the rows of the new matrix can build exactly the same vectors as the old rows. Row operations do not change the row space, and therefore do not change the number of independent rows.

4.2Rank of a matrix

Definition: rank

The rank of an m×nm \times n matrix AA is the number of linearly independent columns of AA, which is the dimension of its column space. The dimension of the row space is the row rank.

A very important fact: row rank = column rank. So we simply call it the rank, written rank⁡(A)\operatorname{rank}(A).

Hinglish analogy

Think of the notes of three students in a class. The third student's notes are made only by mixing the first two, i.e. copy-paste. They give no new information. The rows of a matrix are like that: a row that can be made from the other rows is a copy. Rank = how many rows really give new information.

Count the pivots

rank⁡=\operatorname{rank} = number of non-zero rows of a REF == number of pivots. Zero rows never count.

Worked examples

Example 13Rank from both sides

Let A=[123−10−14−22]A = \begin{bmatrix}1&2&3\\-1&0&-1\\4&-2&2\end{bmatrix}. Find the column rank and the row rank.

Solution
Plan

Compute the rank three ways and see that they agree: count independent columns, count independent rows, and use Gaussian elimination.

  1. Name them. Columns c1=(1,−1,4), c2=(2,0,−2), c3=(3,−1,2)c_1 = (1,-1,4),\ c_2 = (2,0,-2),\ c_3 = (3,-1,2). Rows r1=(1,2,3), r2=(−1,0,−1), r3=(4,−2,2)r_1 = (1,2,3),\ r_2 = (-1,0,-1),\ r_3 = (4,-2,2).
  2. Column relation. Try c3=αc1+βc2c_3 = \alpha c_1 + \beta c_2: (3,−1,2)=(α+2β, −α, 4α−2β)(3,-1,2) = (\alpha + 2\beta,\ -\alpha,\ 4\alpha - 2\beta). The second equation gives α=1\alpha = 1; the third becomes 4−2β=24 - 2\beta = 2, so β=1\beta = 1; the first checks: 1+2=31 + 2 = 3 ✓. So c1+c2=(3,−1,2)=c3c_1 + c_2 = (3,-1,2) = c_3, and the column rank is at most 2.
  3. Are c1,c2c_1, c_2 independent? ac1+bc2=(a+2b, −a, 4a−2b)=0ac_1 + bc_2 = (a + 2b,\ -a,\ 4a - 2b) = 0: the middle coordinate gives a=0a = 0, the first then gives 2b=02b = 0, so b=0b = 0. Independent. Column rank = 2.
  4. Row relation. Try r3=αr1+βr2r_3 = \alpha r_1 + \beta r_2: (4,−2,2)=(α−β, 2α, 3α−β)(4,-2,2) = (\alpha - \beta,\ 2\alpha,\ 3\alpha - \beta). The second equation gives α=−1\alpha = -1; the first gives −1−β=4-1 - \beta = 4, so β=−5\beta = -5; the third checks: −3+5=2-3 + 5 = 2 ✓. So −r1−5r2=(−1,−2,−3)+(5,0,5)=(4,−2,2)=r3-r_1 - 5r_2 = (-1,-2,-3) + (5,0,5) = (4,-2,2) = r_3: the third row is redundant.
  5. Are r1,r2r_1, r_2 independent? ar1+br2=(a−b, 2a, 3a−b)=0ar_1 + br_2 = (a - b,\ 2a,\ 3a - b) = 0: the middle gives a=0a = 0, then −b=0-b = 0. Independent. Row rank = 2.
  6. Gaussian elimination, part 1. The first pivot is the 11 at (1,1)(1,1). R2+R1=(−1,0,−1)+(1,2,3)=(0,2,2)R_2 + R_1 = (-1,0,-1) + (1,2,3) = (0,2,2) and R3−4R1=(4,−2,2)−4(1,2,3)=(0,−10,−10)R_3 - 4R_1 = (4,-2,2) - 4(1,2,3) = (0,-10,-10): [1230220−10−10]\begin{bmatrix}1&2&3\\0&2&2\\0&-10&-10\end{bmatrix}.
  7. Part 2. Scale R2R_2 by 12\tfrac12: (0,1,1)(0,1,1). Then R3+10R2=(0,−10,−10)+10(0,1,1)=(0,0,0)R_3 + 10R_2 = (0,-10,-10) + 10(0,1,1) = (0,0,0). The echelon form is [123011000]\begin{bmatrix}1&2&3\\0&1&1\\0&0&0\end{bmatrix}.
  8. Read the rank. 2 non-zero rows (2 pivots, in columns 1 and 2), so the rank is 2. The third column of the echelon form is (3,1,0)=1⋅(1,0,0)+1⋅(2,1,0)(3,1,0) = 1\cdot(1,0,0) + 1\cdot(2,1,0), i.e. column 3 = column 1 + column 2, the same relation c3=c1+c2c_3 = c_1 + c_2 found in step 2.
  9. Compare.
    MethodWhat we countedResult
    Columnsindependent columns2
    Rowsindependent rows2
    Eliminationnon-zero rows / pivots2
    All agree, as the theorem "row rank = column rank" promises.

Answer. Column rank = 2 and row rank = 2 (the number of pivots is 2).

Example 14A matrix that is not square

Find the rank of A=[12−105300−1012]A = \begin{bmatrix}1&2&-1&0\\5&3&0&0\\-1&0&1&2\end{bmatrix}.

Solution
Plan

The rank is the number of pivots (non-zero rows) in a row echelon form. Reduce one column at a time, making each pivot 1 and clearing the entries below it.

  1. Largest possible rank. AA is 3×43 \times 4, so rank⁡(A)≤min⁡{3,4}=3\operatorname{rank}(A) \le \min\{3,4\} = 3. We will see whether all 3 rows are independent.
  2. Column 1. The pivot is the 11 in row 1. R2−5R1=(5,3,0,0)−5(1,2,−1,0)=(0,−7,5,0)R_2 - 5R_1 = (5,3,0,0) - 5(1,2,-1,0) = (0,-7,5,0) and R3+R1=(−1,0,1,2)+(1,2,−1,0)=(0,2,0,2)R_3 + R_1 = (-1,0,1,2) + (1,2,-1,0) = (0,2,0,2): [12−100−7500202]\begin{bmatrix}1&2&-1&0\\0&-7&5&0\\0&2&0&2\end{bmatrix}.
  3. Column 2: make the pivot 1. The second pivot is −7-7. Multiply R2R_2 by −17-\tfrac17 (allowed since −17≠0-\tfrac17 \neq 0): (0,1,−57,0)(0, 1, -\tfrac57, 0).
  4. Column 2: clear below. R3−2R2=(0,2,0,2)−2(0,1,−57,0)=(0,0,107,2)R_3 - 2R_2 = (0,2,0,2) - 2(0,1,-\tfrac57,0) = (0,0,\tfrac{10}{7},2).
  5. Column 3: make the pivot 1. The third pivot is 107\tfrac{10}{7}. Multiply R3R_3 by 710\tfrac{7}{10}: (0,0,1,75)(0,0,1,\tfrac75). The echelon form is [12−1001−57000175]\begin{bmatrix}1&2&-1&0\\0&1&-\tfrac57&0\\0&0&1&\tfrac75\end{bmatrix}.
  6. Count the pivots. Pivots in columns 1, 2 and 3 and three non-zero rows, so rank⁡(A)=3\operatorname{rank}(A) = 3.
  7. What this tells us. The rank equals the largest value allowed, min⁡{3,4}=3\min\{3,4\} = 3, so all three rows are independent. The column space lives in R3\mathbb{R}^3 and the row space in R4\mathbb{R}^4, yet both have dimension 3 (row rank = column rank). The 4th column has no pivot: it is a combination of the three pivot columns.

Answer. rank⁡(A)=3\operatorname{rank}(A) = 3.

4.3Facts about rank

FactReason / example
rank⁡(A)≤min⁡{m,n}\operatorname{rank}(A) \le \min\{m,n\} for an m×nm \times n matrixCannot have more pivots than rows or columns
rank⁡(AB)≤min⁡{rank⁡(A),rank⁡(B)}\operatorname{rank}(AB) \le \min\{\operatorname{rank}(A), \operatorname{rank}(B)\}Multiplying cannot create new independent directions
Row rank = column rankAlways true
rank⁡(zero matrix)=0\operatorname{rank}(\text{zero matrix}) = 0No pivots at all
rank⁡(In)=n\operatorname{rank}(I_n) = nThe identity has nn pivots
A non-zero matrix with all entries equal has rank 1Every row is a multiple of the first row

4.4Method 1: dimension and basis using rows

  1. Write the given vectors as the rows of a matrix AA.
  2. Row reduce AA to a row echelon form.
  3. The non-zero rows of the REF form a basis of the span WW. Their number is dim⁡W\dim W.
The basis may be new vectors
  • The basis you read off need not be made of vectors from the original set. Row operations create new rows. It is still a perfectly good basis of the same space.
Example 15Rows method

Find dim⁡W\dim W for W=span⁡{(1,0,0),(0,1,0),(3,5,0)}W = \operatorname{span}\{(1,0,0),(0,1,0),(3,5,0)\} using the rows method.

Solution
Plan

Write the given vectors as the rows of a matrix, reduce to echelon form; the non-zero rows are a basis of the span WW.

  1. Vectors as rows. A=[100010350]A = \begin{bmatrix}1&0&0\\0&1&0\\3&5&0\end{bmatrix}.
  2. Clear column 1. R3−3R1=(3,5,0)−3(1,0,0)=(0,5,0)R_3 - 3R_1 = (3,5,0) - 3(1,0,0) = (0,5,0).
  3. Clear column 2. R3−5R2=(0,5,0)−5(0,1,0)=(0,0,0)R_3 - 5R_2 = (0,5,0) - 5(0,1,0) = (0,0,0). REF =[100010000]= \begin{bmatrix}1&0&0\\0&1&0\\0&0&0\end{bmatrix}.
  4. Read off the basis. The non-zero rows (1,0,0)(1,0,0) and (0,1,0)(0,1,0) form a basis of WW. Row operations never change the span of the rows, so these two still span WW; rows with pivots in different columns are independent, so nothing is wasted.
  5. Count. 2 non-zero rows, so dim⁡W=2\dim W = 2.
  6. Cross-check with section 3.3. (3,5,0)=3(1,0,0)+5(0,1,0)(3,5,0) = 3(1,0,0) + 5(0,1,0) is a combination of the first two: exactly why R3R_3 became the zero row. All three vectors lie in the xyxy-plane, which has dimension 2 ✓.

Answer. A basis of WW is {(1,0,0),(0,1,0)}\{(1,0,0),(0,1,0)\} and dim⁡W=2\dim W = 2.

4.5Method 2: basis using columns

  1. Write the given vectors as the columns of a matrix AA.
  2. Row reduce AA to a REF (or RREF), call it RR.
  3. Find the pivot columns of RR. The columns of the original matrix AA in those same positions form a basis of the column space.
Take columns from the ORIGINAL matrix
  • Row operations keep the row space but change the column space. Example: [1111]→[1100]\begin{bmatrix}1&1\\1&1\end{bmatrix} \to \begin{bmatrix}1&1\\0&0\end{bmatrix}. The first has column space span⁡{(1,1)}\operatorname{span}\{(1,1)\}, the second span⁡{(1,0)}\operatorname{span}\{(1,0)\}. So use RR only to locate the pivot columns, then pick those columns from AA.
Why does this work?

Row operations never change which columns depend on which: a relation c1col⁡1+⋯+cncol⁡n=0c_1\operatorname{col}_1 + \cdots + c_n\operatorname{col}_n = 0 holds for AA exactly when it holds for RR. The pivot columns of RR are independent and every other column of RR is a combination of the pivot columns to its left. The same is therefore true for the matching columns of AA.

Method 1: vectors as rowsW = span{(1,1,2), (2,−1,4), (3,0,6)}Method 2: vectors as columnsW = span{(1,1,2), (2,−1,4), (3,0,6)}Step 1 · write the vectors in a matrixStep 1 · write the vectors in a matrix1122−143061231−10246Step 2 · row reduceStep 2 · row reduce1120−30000123011000Step 3 · read off the basisStep 3 · read off the basis(1, 1, 2), (0, −3, 0)(1, 1, 2), (2, −1, 4)non-zero rows of the reduced matrixcolumns 1 and 2 of the ORIGINAL matrix
Figure 7. The same subspace handled by both methods. They give different bases of the same plane
Rows methodColumns method
Vectors go in asRowsColumns
What you read offNon-zero rows of the REFPivot positions of the REF
Basis vectors come fromThe reduced matrix (new vectors)The original matrix (given vectors)
Same for bothThe number of basis vectors is dim⁡W=rank⁡\dim W = \operatorname{rank}The number of basis vectors is dim⁡W=rank⁡\dim W = \operatorname{rank}
Example 16Columns method, 3 vectors in R³

Find a basis of W=span⁡{(1,1,2),(2,−1,4),(3,0,6)}W = \operatorname{span}\{(1,1,2),(2,-1,4),(3,0,6)\} using columns.

Solution
Plan

Write the given vectors as the columns of a matrix, reduce to echelon form to locate the pivot columns, then take those same columns from the original matrix.

  1. Vectors as columns. v1=(1,1,2), v2=(2,−1,4), v3=(3,0,6)v_1 = (1,1,2),\ v_2 = (2,-1,4),\ v_3 = (3,0,6) give A=[1231−10246]A = \begin{bmatrix}1&2&3\\1&-1&0\\2&4&6\end{bmatrix}.
  2. Clear below the first pivot. R2−R1=(1,−1,0)−(1,2,3)=(0,−3,−3)R_2 - R_1 = (1,-1,0) - (1,2,3) = (0,-3,-3) and R3−2R1=(2,4,6)−2(1,2,3)=(0,0,0)R_3 - 2R_1 = (2,4,6) - 2(1,2,3) = (0,0,0): [1230−3−3000]\begin{bmatrix}1&2&3\\0&-3&-3\\0&0&0\end{bmatrix}.
  3. Second pivot to 1. Multiply R2R_2 by −13-\tfrac13: (0,1,1)(0,1,1). Call the result R=[123011000]R = \begin{bmatrix}1&2&3\\0&1&1\\0&0&0\end{bmatrix}.
  4. Locate the pivot columns. The pivots are in column 1 and column 2. Column 3 has no pivot.
  5. Take those columns from the ORIGINAL matrix AA. Column 1 of AA is (1,1,2)(1,1,2) and column 2 is (2,−1,4)(2,-1,4). A basis is {(1,1,2),(2,−1,4)}\{(1,1,2),(2,-1,4)\}; with 2 vectors, dim⁡W=2\dim W = 2.
  6. Check the dropped vector. The third column of RR is (3,1,0)=1⋅(1,0,0)+1⋅(2,1,0)(3,1,0) = 1\cdot(1,0,0) + 1\cdot(2,1,0), i.e. column 3 = column 1 + column 2. The same must hold in AA: (1,1,2)+(2,−1,4)=(3,0,6)=v3(1,1,2) + (2,-1,4) = (3,0,6) = v_3 ✓.
  7. Why we must NOT use the columns of RR. Row operations change the column space. Every vector of WW has the form a(1,1,2)+b(2,−1,4)=(a+2b, a−b, 2a+4b)a(1,1,2) + b(2,-1,4) = (a + 2b,\ a - b,\ 2a + 4b), whose third coordinate is twice its first. But the first column of RR is (1,0,0)(1,0,0), where z=0z = 0 while 2x=22x = 2. So (1,0,0)∉W(1,0,0) \notin W, and the columns of RR would not even be vectors of WW.

Answer. A basis of WW is {(1,1,2),(2,−1,4)}\{(1,1,2),(2,-1,4)\} and dim⁡W=2\dim W = 2.

Example 17Columns method, 4 vectors in R⁴

Let W=span⁡{(1,1,0,0),(2,1,−1,4),(3,4,1,−4),(3,2,−1,4)}W = \operatorname{span}\{(1,1,0,0),(2,1,-1,4),(3,4,1,-4),(3,2,-1,4)\}. Find a basis and dim⁡W\dim W.

Solution
Plan

Columns method again, now with 4 vectors in R4\mathbb{R}^4. Put them in as columns, eliminate, find the pivot columns, and read the basis from the original matrix.

  1. Vectors as columns. v1=(1,1,0,0), v2=(2,1,−1,4), v3=(3,4,1,−4), v4=(3,2,−1,4)v_1 = (1,1,0,0),\ v_2 = (2,1,-1,4),\ v_3 = (3,4,1,-4),\ v_4 = (3,2,-1,4) give A=[123311420−11−104−44]A = \begin{bmatrix}1&2&3&3\\1&1&4&2\\0&-1&1&-1\\0&4&-4&4\end{bmatrix}.
  2. Column 1. The pivot is the 11 in row 1; rows 3 and 4 already have 00 there, so only R2R_2 needs work: R2−R1=(1,1,4,2)−(1,2,3,3)=(0,−1,1,−1)R_2 - R_1 = (1,1,4,2) - (1,2,3,3) = (0,-1,1,-1).
  3. Column 2. The second pivot is the −1-1 in row 2. R3−R2=(0,−1,1,−1)−(0,−1,1,−1)=(0,0,0,0)R_3 - R_2 = (0,-1,1,-1) - (0,-1,1,-1) = (0,0,0,0) and R4+4R2=(0,4,−4,4)+4(0,−1,1,−1)=(0,0,0,0)R_4 + 4R_2 = (0,4,-4,4) + 4(0,-1,1,-1) = (0,0,0,0).
  4. Second pivot to 1. −R2=(0,1,−1,1)-R_2 = (0,1,-1,1), so R=[123301−1100000000]R = \begin{bmatrix}1&2&3&3\\0&1&-1&1\\0&0&0&0\\0&0&0&0\end{bmatrix}.
  5. Locate the pivot columns. Rows 3 and 4 are zero rows, so there are only 2 pivots, in column 1 and column 2. Columns 3 and 4 have no pivot.
  6. Pivot columns from the ORIGINAL matrix. basis={v1,v2}={(1,1,0,0),(2,1,−1,4)}\text{basis} = \{v_1, v_2\} = \{(1,1,0,0),(2,1,-1,4)\}, dim⁡W=2\dim W = 2. (Use the columns of AA, not of RR.)
  7. Express the other two vectors. Column 3 of RR is (3,−1,0,0)(3,-1,0,0): α(1,0,0,0)+β(2,1,0,0)=(3,−1,0,0)\alpha(1,0,0,0) + \beta(2,1,0,0) = (3,-1,0,0) gives β=−1\beta = -1 and α+2β=3\alpha + 2\beta = 3, so α=5\alpha = 5. Column 4 of RR is (3,1,0,0)(3,1,0,0): β=1\beta = 1 and α+2=3\alpha + 2 = 3, so α=1\alpha = 1. Row operations keep these relations true for the columns of AA: v3=5v1−v2v_3 = 5v_1 - v_2 and v4=v1+v2v_4 = v_1 + v_2.
  8. Verify directly. 5(1,1,0,0)−(2,1,−1,4)=(5,5,0,0)−(2,1,−1,4)=(3,4,1,−4)=v35(1,1,0,0) - (2,1,-1,4) = (5,5,0,0) - (2,1,-1,4) = (3,4,1,-4) = v_3 ✓ and (1,1,0,0)+(2,1,−1,4)=(3,2,−1,4)=v4(1,1,0,0) + (2,1,-1,4) = (3,2,-1,4) = v_4 ✓.

Answer. A basis of WW is {(1,1,0,0),(2,1,−1,4)}\{(1,1,0,0),(2,1,-1,4)\}, dim⁡W=2\dim W = 2.

Example 18Pick a basis out of five vectors

Can a basis of R3\mathbb{R}^3 be obtained from {(1,1,1),(2,4,0),(0,1,1),(2,2,4),(3,4,5)}\{(1,1,1),(2,4,0),(0,1,1),(2,2,4),(3,4,5)\}?

Solution
Plan

5 vectors in R3\mathbb{R}^3; a basis needs exactly 3 independent vectors. The columns method tells us which to keep.

  1. Columns. A=[120231412410145]A = \begin{bmatrix}1&2&0&2&3\\1&4&1&2&4\\1&0&1&4&5\end{bmatrix}.
  2. Clear below the first pivot. R2−R1=(0,2,1,0,1)R_2 - R_1 = (0,2,1,0,1) and R3−R1=(1,0,1,4,5)−(1,2,0,2,3)=(0,−2,1,2,2)R_3 - R_1 = (1,0,1,4,5) - (1,2,0,2,3) = (0,-2,1,2,2).
  3. Second pivot. It is the 22 in row 2. R3+R2=(0,−2,1,2,2)+(0,2,1,0,1)=(0,0,2,2,3)R_3 + R_2 = (0,-2,1,2,2) + (0,2,1,0,1) = (0,0,2,2,3). The matrix is now [120230210100223]\begin{bmatrix}1&2&0&2&3\\0&2&1&0&1\\0&0&2&2&3\end{bmatrix}, with pivots 1,2,21, 2, 2.
  4. Pivot columns. The pivots are in columns 1, 2, 3. Columns 4 and 5 have no pivot. The rank is 3.
  5. Take them from the ORIGINAL matrix. {(1,1,1),(2,4,0),(0,1,1)}\{(1,1,1),(2,4,0),(0,1,1)\}, the first three of the given vectors.
  6. Why a basis of R3\mathbb{R}^3. The three chosen vectors are independent (pivot columns) and dim⁡R3=3\dim\mathbb{R}^3 = 3; three independent vectors in a 3-dimensional space automatically span it. Equivalently, the column space has dimension rank⁡=3\operatorname{rank} = 3 and sits inside R3\mathbb{R}^3, so it is R3\mathbb{R}^3.
  7. Cross-check. ∣120141101∣=1(4⋅1−1⋅0)−2(1⋅1−1⋅1)+0=4≠0\begin{vmatrix}1&2&0\\1&4&1\\1&0&1\end{vmatrix} = 1(4\cdot 1 - 1\cdot 0) - 2(1\cdot 1 - 1\cdot 1) + 0 = 4 \neq 0 ✓.

Answer. Yes. The rank is 3, and {(1,1,1),(2,4,0),(0,1,1)}\{(1,1,1),(2,4,0),(0,1,1)\} is a basis of R3\mathbb{R}^3 chosen from the given vectors.

4.6Finding an unknown so that the rank is smaller

If a matrix contains a letter, reduce it and force a zero row by choosing the letter.

Example 19Value of a for rank 2

The matrix A=[2−3401−21−3a]A = \begin{bmatrix}2&-3&4\\0&1&-2\\1&-3&a\end{bmatrix} has rank 2. Find aa.

Solution
Plan

Eliminate while keeping aa as a letter, then choose aa so exactly one row becomes zero.

  1. First pivot. It is the 22 in row 1. Row 2 already has 00 in column 1, so only R3R_3 needs clearing.
  2. Multiplier 12\tfrac12. R3−12R1=(1,−3,a)−12(2,−3,4)=(0, −32, a−2)R_3 - \tfrac12R_1 = (1,-3,a) - \tfrac12(2,-3,4) = (0,\ -\tfrac32,\ a - 2).
  3. Second pivot. It is the 11 in row 2. The entry to clear is −32-\tfrac32, so add 32R2\tfrac32R_2 to R3R_3: (0,−32,a−2)+32(0,1,−2)=(0,0,a−5)(0,-\tfrac32,a - 2) + \tfrac32(0,1,-2) = (0,0,a - 5).
  4. Echelon form. [2−3401−200a−5]\begin{bmatrix}2&-3&4\\0&1&-2\\0&0&a-5\end{bmatrix}.
  5. Cases. Rows 1 and 2 are non-zero for every aa (pivots 2 and 1), so the rank is at least 2. If a−5≠0a - 5 \neq 0 there are 3 pivots and the rank is 3. If a−5=0a - 5 = 0 the last row is zero and the rank is 2.
  6. Choose aa. We want rank 2, so a−5=0a - 5 = 0, i.e. a=5a = 5.
  7. Cross-check with the determinant. det⁡A=2(a−6)+(6−4)=2a−10\det A = 2(a - 6) + (6 - 4) = 2a - 10, which is zero exactly when a=5a = 5; also the product of the pivots is 2⋅1⋅(a−5)=2a−102\cdot 1\cdot(a - 5) = 2a - 10 ✓.
  8. Check a=5a = 5. The third row (1,−3,5)=12(2,−3,4)−32(0,1,−2)(1,-3,5) = \tfrac12(2,-3,4) - \tfrac32(0,1,-2) ✓, so the rows are dependent and the rank is 2.

Answer. a=5a = 5 (then the last row becomes zero and rank⁡A=2\operatorname{rank}A = 2).

4.7More practice on rank

Example 20Rank of a 3×4 matrix

Find the rank of A=[013110013203]A = \begin{bmatrix}0&1&3&1\\1&0&0&1\\3&2&0&3\end{bmatrix}.

Solution
Plan

Reduce to echelon form and count the non-zero rows. The first entry of row 1 is 00, so first bring a row with a non-zero first entry to the top.

  1. AA is 3×43 \times 4, so rank⁡≤3\operatorname{rank} \le 3.
  2. Swap. The (1,1)(1,1) entry is 00, so swap R1↔R2R_1 \leftrightarrow R_2 (no arithmetic needed): [100101313203]\begin{bmatrix}1&0&0&1\\0&1&3&1\\3&2&0&3\end{bmatrix}.
  3. Clear column 1. Row 2 already has 00. R3−3R1=(3,2,0,3)−3(1,0,0,1)=(0,2,0,0)R_3 - 3R_1 = (3,2,0,3) - 3(1,0,0,1) = (0,2,0,0).
  4. Clear column 2. The second pivot is the 11 in row 2. R3−2R2=(0,2,0,0)−2(0,1,3,1)=(0,0,−6,−2)R_3 - 2R_2 = (0,2,0,0) - 2(0,1,3,1) = (0,0,-6,-2). The matrix is [1001013100−6−2]\begin{bmatrix}1&0&0&1\\0&1&3&1\\0&0&-6&-2\end{bmatrix}, pivots 1,1,−61, 1, -6 in columns 1, 2, 3.
  5. Count. All three rows are non-zero, so the rank is 3. This is the largest possible rank for a 3×43\times 4 matrix, min⁡{3,4}=3\min\{3,4\} = 3, so all three rows are independent.

Answer. rank⁡(A)=3\operatorname{rank}(A) = 3.

Example 21Upper triangular matrix

For the matrix [abc0de00f]\begin{bmatrix}a&b&c\\0&d&e\\0&0&f\end{bmatrix} with a,b,c,d,e,fa, b, c, d, e, f real, which statements are correct? (Multiple select.)

1
If f=0f = 0, the rank is at most 2
2
If f=0f = 0, the rank is exactly 2
3
If a,b,c,d,e,fa, b, c, d, e, f are all non-zero, the rank is 3
4
If a,d,fa, d, f are non-zero, the rank is 3
Solution
Plan

Rank = number of independent rows. Prove one general fact, then judge each option.

  1. Key fact: if a,d,fa, d, f are all non-zero, the rank is 3. Rows r1=(a,b,c), r2=(0,d,e), r3=(0,0,f)r_1 = (a,b,c),\ r_2 = (0,d,e),\ r_3 = (0,0,f). Suppose αr1+βr2+γr3=0\alpha r_1 + \beta r_2 + \gamma r_3 = 0: (αa, αb+βd, αc+βe+γf)=0(\alpha a,\ \alpha b + \beta d,\ \alpha c + \beta e + \gamma f) = 0. First: αa=0\alpha a = 0 and a≠0a \neq 0 give α=0\alpha = 0. Second, with α=0\alpha = 0: βd=0\beta d = 0, d≠0d \neq 0, so β=0\beta = 0. Third: γf=0\gamma f = 0, f≠0f \neq 0, so γ=0\gamma = 0. The rows are independent, so the rank is 3. The entries b,c,eb, c, e were never used; they can be anything. (In echelon language the matrix is already in echelon form with pivots a,d,fa, d, f.)
  2. Option 1. If f=0f = 0 the third row is (0,0,0)(0,0,0). A zero row is never part of an independent set, so at most the first two rows can be independent: rank ≤2\le 2. True.
  3. Option 2. "At most 2" is not "exactly 2". Counter-example: a=b=c=d=e=0, f=0a = b = c = d = e = 0,\ f = 0 is the zero matrix, rank 0, not 2. Another: a=1a = 1 and all else 0 has rank 1. False.
  4. Option 3. All six are non-zero, so in particular a,d,f≠0a, d, f \neq 0; by the key fact the rank is 3. True.
  5. Option 4. Exactly the key fact, whatever b,c,eb, c, e are. True. (Option 3 is a special case of Option 4.)
  6. Cross-check. A triangular determinant is a⋅d⋅fa\cdot d\cdot f, non-zero exactly when a,d,fa, d, f are all non-zero, exactly when the rank is 3 ✓.

Answer. Options 1, 3 and 4 are correct. Option 2 is false (the rank can drop below 2).

Example 22A Vandermonde-style matrix

What is the rank of A=[111xyzx2y2z2]A = \begin{bmatrix}1&1&1\\x&y&z\\x^2&y^2&z^2\end{bmatrix} where x,y,zx, y, z are distinct non-zero integers?

Solution
Plan

Eliminate with letters. Show that all three pivots are non-zero; since x,y,zx, y, z are distinct, differences like y−xy - x are never 00.

  1. First pivot. The 11 in row 1, column 1.
  2. Clear column 1. R2−xR1=(0, y−x, z−x)R_2 - xR_1 = (0,\ y - x,\ z - x) and R3−x2R1=(0, y2−x2, z2−x2)R_3 - x^2R_1 = (0,\ y^2 - x^2,\ z^2 - x^2).
  3. Second pivot is y−xy - x. We need mm with y2−x2−m(y−x)=0y^2 - x^2 - m(y - x) = 0. Since y2−x2=(y−x)(y+x)y^2 - x^2 = (y - x)(y + x), m=x+ym = x + y. Replace R3R_3 by R3−(x+y)R2R_3 - (x + y)R_2. Column 2 becomes (y−x)(y+x)−(x+y)(y−x)=0(y - x)(y + x) - (x + y)(y - x) = 0. Column 3 becomes (z−x)(z+x)−(x+y)(z−x)=(z−x)(z−y)(z - x)(z + x) - (x + y)(z - x) = (z - x)(z - y).
  4. Echelon form. [1110y−xz−x00(z−x)(z−y)]\begin{bmatrix}1&1&1\\0&y-x&z-x\\0&0&(z-x)(z-y)\end{bmatrix}, with pivots 1, y−x, (z−x)(z−y)1,\ y - x,\ (z - x)(z - y).
  5. All pivots non-zero. 1≠01 \neq 0; y−x≠0y - x \neq 0 since x≠yx \neq y; z−x≠0z - x \neq 0 and z−y≠0z - y \neq 0 since zz differs from both, so their product is non-zero. Three non-zero rows: rank 3.
  6. Numeric check. For x=1, y=2, z=3x = 1,\ y = 2,\ z = 3: A=[111123149]A = \begin{bmatrix}1&1&1\\1&2&3\\1&4&9\end{bmatrix}; the pivots are 1, y−x=1, (z−x)(z−y)=2⋅1=21,\ y - x = 1,\ (z - x)(z - y) = 2\cdot 1 = 2, product 22. Directly, det⁡A=1(18−12)−1(9−3)+1(4−2)=6−6+2=2\det A = 1(18 - 12) - 1(9 - 3) + 1(4 - 2) = 6 - 6 + 2 = 2 ✓, non-zero, so the rank is 3.
  7. Remark. The product of the pivots (y−x)(z−x)(z−y)(y - x)(z - x)(z - y) is the famous Vandermonde determinant. It vanishes only if two of x,y,zx, y, z coincide. "Non-zero" in the question is not needed; only "distinct" matters.

Answer. rank⁡(A)=3\operatorname{rank}(A) = 3.

Example 23True or false about rank

Choose the correct options. (Multiple select.)

1
Row rank and column rank of a matrix are always equal
2
The rank of the zero matrix is always 00
3
A matrix whose entries are all the same non-zero real number has rank 11
4
The rank of the n×nn \times n identity matrix is 11 for every nn
Solution
  1. Option 1. This is the basic theorem about rank, and why we can speak of "the rank". Example: the 3×43\times 4 matrix of Example 14 has row rank 3 and column rank 3, even though its rows live in R4\mathbb{R}^4 and its columns in R3\mathbb{R}^3. True.
  2. Option 2. Every column of the zero matrix is the zero vector, whose span is {0}\{0\}, dimension 0; there are no pivots. True.
  3. Option 3. If every entry is c≠0c \neq 0, every row (c,c,…,c)(c,c,\dots,c) equals the first. Subtract R1R_1 from the other rows: [ccccccccc]→[ccc000000]\begin{bmatrix}c&c&c\\c&c&c\\c&c&c\end{bmatrix} \to \begin{bmatrix}c&c&c\\0&0&0\\0&0&0\end{bmatrix}. One non-zero row (non-zero since c≠0c \neq 0): one pivot, rank 1. True.
  4. Option 4. The identity is already in echelon form with a pivot in every row. The rows of I2I_2, (1,0)(1,0) and (0,1)(0,1), are independent, so rank⁡(I2)=2\operatorname{rank}(I_2) = 2, not 1. In general rank⁡(In)=n\operatorname{rank}(I_n) = n. False.
  5. Tally.
    #StatementVerdict
    1row rank = column rankTrue
    2rank of zero matrix is 0True
    3all entries equal and non-zero: rank 1True
    4rank⁡(In)=1\operatorname{rank}(I_n) = 1 (it is n)False

Answer. Options 1, 2 and 3 are correct.

Revision overview
Ranknumber of non-zero rows of a REF
same as the number of pivots
Rows methodvectors as rows, then reduce
non-zero rows form a basis
Columns methodvectors as columns, then reduce
take pivot columns of the ORIGINAL
Rank by eliminationWeek 4 · Rank
Factsrow rank = column rank
rank(A) ≤ min(m, n)
rank(Iₙ) = n
Unknown entryreduce, then force a zero row
example: a = 5
Revision: rank by elimination on one page
Next · All partsWeek 4 Summary Sheet
05
All parts

Week 4 Summary Sheet

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

Ideas at a glance

Basis · smallest complete set
  • BB independent and span⁡(B)=V\operatorname{span}(B) = V.
  • Maximal independent = minimal spanning = basis.
  • Every vector has a unique combination of the basis.
Dimension · size of a basis
  • dim⁡V\dim V = number of vectors in any basis.
  • dim⁡Rn=n\dim\mathbb{R}^n = n, dim⁡Mm×n=mn\dim M_{m\times n} = mn.
  • W⊆V⇒dim⁡W≤dim⁡VW \subseteq V \Rightarrow \dim W \le \dim V.
Rank · independent rows or columns
  • rank⁡(A)\operatorname{rank}(A) = number of pivots of a REF.
  • Row rank = column rank.
  • rank⁡(A)≤min⁡(m,n)\operatorname{rank}(A) \le \min(m,n).
Methods · how to compute
  • Rows: non-zero rows of the REF.
  • Columns: pivot columns of the ORIGINAL matrix.
  • Equation: one basis vector per free variable.

Formula sheet at a glance

Basis
DefinitionB independent and span⁡(B)=VB \text{ independent and } \operatorname{span}(B) = V
Unique combinationv=α1b1+⋯+αnbn (one choice of αi)v = \alpha_1 b_1 + \cdots + \alpha_n b_n \ \text{(one choice of } \alpha_i)
Dimension
Definitiondim⁡V=number of vectors in any basis\dim V = \text{number of vectors in any basis}
Standard spacesdim⁡Rn=n,dim⁡Mm×n=mn\dim\mathbb{R}^n = n, \quad \dim M_{m \times n} = mn
SubspaceW⊆V⇒dim⁡W≤dim⁡VW \subseteq V \Rightarrow \dim W \le \dim V
Rank
Definitionrank⁡(A)=number of pivots of a REF of A\operatorname{rank}(A) = \text{number of pivots of a REF of } A
Row rank = column rankrank⁡(A)≤min⁡(m,n)\operatorname{rank}(A) \le \min(m, n)
Basis of a row space and column space
Row spacethe non-zero rows of the REF\text{the non-zero rows of the REF}
Column spacepivot columns of the ORIGINAL matrix\text{pivot columns of the ORIGINAL matrix}
Basis of a solution set
Free variablesdim⁡=number of free variables\dim = \text{number of free variables}

Formulas and how to use them

Basis
DefinitionB independent and span⁡(B)=VB \text{ independent and } \operatorname{span}(B) = V
Unique combinationv=α1b1+⋯+αnbn (one choice of αi)v = \alpha_1 b_1 + \cdots + \alpha_n b_n \ \text{(one choice of } \alpha_i)

Use whenYou must check whether a set B is a basis of V, or write a vector in terms of a basis.

  1. Check B is linearly independent.
  2. Check B spans V. (If you already know dim⁡V=n\dim V = n, then n independent vectors are enough.)
  3. Every vector then has exactly one set of coefficients.
ExampleB={(1,0),(0,1)}B = \{(1, 0), (0, 1)\} in R2\mathbb{R}^2 and the vector (3,4)(3, 4).
(3,4)=3 (1,0)+4 (0,1)the only choice: α1=3, α2=4\begin{gathered} (3, 4) = 3\,(1, 0) + 4\,(0, 1) \\[6pt] \text{the only choice: } \alpha_1 = 3, \ \alpha_2 = 4 \end{gathered}
Dimension
Definitiondim⁡V=number of vectors in any basis\dim V = \text{number of vectors in any basis}
Standard spacesdim⁡Rn=n,dim⁡Mm×n=mn\dim\mathbb{R}^n = n, \quad \dim M_{m \times n} = mn
SubspaceW⊆V⇒dim⁡W≤dim⁡VW \subseteq V \Rightarrow \dim W \le \dim V

Use whenYou want the size of a space, or to know how many independent directions it has.

  1. Find or recall a basis; its size is the dimension.
  2. For matrices: one dimension per free entry.
  3. A subspace never has a bigger dimension than the space around it.
ExampleM3×3(R)M_{3 \times 3}(\mathbb{R}) and the symmetric 2×22 \times 2 matrices.
dim⁡M3×3=3⋅3=9symmetric 2×2: E11, E12+E21, E22⇒dim⁡=3\begin{gathered} \dim M_{3 \times 3} = 3 \cdot 3 = 9 \\[6pt] \text{symmetric } 2 \times 2: \ E_{11},\ E_{12} + E_{21},\ E_{22} \\[6pt] \Rightarrow \dim = 3 \end{gathered}
Rank
Definitionrank⁡(A)=number of pivots of a REF of A\operatorname{rank}(A) = \text{number of pivots of a REF of } A
Row rank = column rankrank⁡(A)≤min⁡(m,n)\operatorname{rank}(A) \le \min(m, n)

Use whenYou want the number of independent rows (or columns) of a matrix.

  1. Row-reduce A to a row echelon form (REF).
  2. Count the pivots: non-zero rows only, never the zero rows.
  3. Check rank⁡(A)≤min⁡(m,n)\operatorname{rank}(A) \le \min(m, n).
ExampleA=[123246101]A = \begin{bmatrix} 1 & 2 & 3 \\ 2 & 4 & 6 \\ 1 & 0 & 1 \end{bmatrix}.
R2−2R1, R3−R1:[1230000−2−2]2 pivots⇒rank⁡(A)=2\begin{gathered} R_2 - 2R_1, \ R_3 - R_1: \\[6pt] \begin{bmatrix} 1 & 2 & 3 \\[6pt] 0 & 0 & 0 \\[6pt] 0 & -2 & -2 \end{bmatrix} \\[6pt] 2 \text{ pivots} \Rightarrow \operatorname{rank}(A) = 2 \end{gathered}
Basis of a row space and column space
Row spacethe non-zero rows of the REF\text{the non-zero rows of the REF}
Column spacepivot columns of the ORIGINAL matrix\text{pivot columns of the ORIGINAL matrix}

Use whenYou want a basis of the span of the rows, or of the columns, of a matrix.

  1. Row-reduce to a REF and mark the pivot positions.
  2. Rows: keep the non-zero rows of the REF.
  3. Columns: keep the columns of the original matrix at the pivot positions (row operations change the column space).
ExampleThe same matrix A: pivots in columns 1 and 2 of the REF.
row basis: (1,2,3), (0,−2,−2)column basis: (1,2,1)T, (2,4,0)T\begin{gathered} \text{row basis: } (1, 2, 3),\ (0, -2, -2) \\[6pt] \text{column basis: } (1, 2, 1)^T,\ (2, 4, 0)^T \end{gathered}
Basis of a solution set
Free variablesdim⁡=number of free variables\dim = \text{number of free variables}

Use whenA subspace is given by an equation (or equations) and you want a basis and its dimension.

  1. Solve for the pivot variables in terms of the free ones.
  2. Make one basis vector per free variable: set it to 1 and the other free ones to 0.
  3. The number of those vectors is the dimension.
ExampleThe plane x+y+z=0x + y + z = 0 in R3\mathbb{R}^3: x and y are free, z=−x−yz = -x - y.
x=1,y=0⇒(1,0,−1)x=0,y=1⇒(0,1,−1)dim⁡=2\begin{gathered} x = 1, y = 0 \Rightarrow (1, 0, -1) \\[6pt] x = 0, y = 1 \Rightarrow (0, 1, -1) \\[6pt] \dim = 2 \end{gathered}

Dimensions worth remembering

SpaceDimensionA basis
Rn\mathbb{R}^nnne1,…,ene_1, \dots, e_n
Mm×n(R)M_{m\times n}(\mathbb{R})mnmnall EijE_{ij}
Symmetric 2×22\times 23E11, E12+E21, E22E_{11},\ E_{12} + E_{21},\ E_{22}
Diagonal 2×22\times 22E11, E22E_{11},\ E_{22}
Scalar 2×22\times 21E11+E22E_{11} + E_{22}
Upper or lower triangular 2×22\times 23E11,E12,E22E_{11},E_{12},E_{22} or E11,E21,E22E_{11},E_{21},E_{22}
{(x,y,z,w):x+z=y+w}\{(x,y,z,w) : x + z = y + w\}3(1,0,−1,0),(0,1,1,0),(0,0,1,1)(1,0,-1,0),(0,1,1,0),(0,0,1,1)
Plane x+y+z=0x + y + z = 0 in R3\mathbb{R}^32(1,0,−1),(0,1,−1)(1,0,-1),(0,1,-1)

Which tool, and what to avoid

QuestionWhat to do
Is BB a basis of VV?Check independent and spanning; if dim⁡V=n\dim V = n, nn independent vectors are enough.
Basis of a span?Rows: keep the non-zero rows. Columns: keep the pivot columns of the original matrix.
Rank or dimension?Row reduce, then count pivots (non-zero rows); dimension = size of a basis.
Basis of an equation?Solve for the pivot variables; one basis vector per free variable.
Common mistakes
  • Using the columns of the REF as the basis (columns method): Use the columns of the original matrix at the pivot positions; row operations change the column space.
  • Calling a set a basis after checking only spanning or only independence: You need both, unless you already know the dimension and have exactly that many vectors.
  • Deleting several dependent vectors at once: Delete one, then re-check; mutually dependent vectors cannot all go.
  • Counting zero rows when finding the rank: Only non-zero rows (pivots) count.
  • Saying rank⁡(In)=1\operatorname{rank}(I_n) = 1: rank⁡(In)=n\operatorname{rank}(I_n) = n.
  • Saying dim⁡M3×3(R)=3\dim M_{3\times 3}(\mathbb{R}) = 3: It is 9: one dimension per entry.
  • Using a vector that does not satisfy the defining equation: Basis vectors of a subspace must themselves lie in the subspace; test each one.
  • Forgetting rank⁡(A)≤min⁡(m,n)\operatorname{rank}(A) \le \min(m,n): A 3×43 \times 4 matrix can never have rank above 3.
Back to top