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.
R2 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) is the set of all linear combinations a1v1+⋯+akvk.
If span(S)=V, every vector of V can be built from S.
The question to ask: can I reach everything?
Independence: "no vector wasted"
{v1,…,vk} is linearly independent if a1v1+⋯+akvk=0 forces a1=⋯=ak=0.
Equivalently, no vector is a combination of the others.
1.2Definition of a basis
Definition: basis
A basis of a vector space V is a set B that is linearly independent and also spansV.
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.
Figure 1. Too few vectors do not span, too many are dependent, and a basis is just right
Four sets in R²
Set
Spans R²?
Independent?
Basis?
{(1,1)}
no
yes
no
{(1,0),(0,1)}
yes
yes
yes
{(1,0),(0,1),(1,1)}
yes
no
no
{(1,2),(2,4)}
no
no
no
Both properties are needed. The last row fails both: (2,4)=2(1,2) makes it dependent, and every vector lies on one line, so it cannot span R2.
Figure 2. A basis sits where "spans V" and "independent" overlap
1.3The standard basis
Definition: standard basis
ei has 1 in the i-th coordinate and 0 elsewhere. {e1,…,en} is a basis of Rn.
Space
Standard basis
R2
(1,0),(0,1)
R3
(1,0,0),(0,1,0),(0,0,1)
Rn
e1=(1,0,…,0),…,en=(0,…,0,1)
It spans:(x,y,z)=x(1,0,0)+y(0,1,0)+z(0,0,1).
It is independent: that combination is 0 only when x=y=z=0.
Size limit: in Rn any set with more than n vectors is dependent, so a basis of Rn has at most n vectors. Topic 3 shows it has exactly n.
1.4A basis is not unique
Three different bases of R2 are {(1,0),(0,1)}, {(1,1),(1,0)} and {(1,1),(1,2)}. The vector does not change, only the recipe used to build it.
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.5Unique coordinates
Theorem: unique representation
If B={b1,…,bn} is a basis of V, every v∈V can be written in exactly one way as v=a1b1+⋯+anbn.
Existence comes from spanning.
Uniqueness comes from independence. If v=∑aibi=∑cibi, then (a1−c1)b1+⋯+(an−cn)bn=0, and independence forces ai=ci for every i.
These unique numbers are the coordinates of v in the basis B.
1.6Three ways to describe a basis
Description
Meaning
Independent and spanning
enough vectors, none wasted (the definition)
Maximal independent set
independent, and adding any vector makes it dependent
Minimal spanning set
spans V, and removing any vector breaks the span
Why they agree. If B is a basis and v∈/B, then v is a combination of B, so B∪{v} is dependent. Conversely, if B is a maximal independent set and some v lay outside span(B), then B∪{v} would still be independent, contradicting maximality; so B 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)} is a basis of R2.
Solution
Plan
Test independence, then test spanning.
Independence.a(1,1)+b(1,0)=(a+b,a)=(0,0), so a+b=0 and a=0, giving b=0. Independent.
Spanning. For any (x,y) solve a+b=x,a=y: a=y,b=x−y. Verify: y(1,1)+(x−y)(1,0)=(x,y). It spans R2.
The coordinates of (x,y) are (y,x−y). Test (3,5): (5,−2), and 5(1,1)−2(1,0)=(3,5).
Cross-check: det[1110]=0−1=−1=0; with dimR2=2, two independent vectors span automatically.
Answer. Yes, a basis, with (x,y)=y(1,1)+(x−y)(1,0).
Example 2Is {(1,2), (2,4)} a basis of R²?
Is {(1,2),(2,4)} a basis of R2?
Solution
Plan
Look for a non-trivial relation, then see what the span is.
a(1,2)+b(2,4)=(a+2b,2a+4b)=(0,0) gives a+2b=0 and 2a+4b=0. The second is twice the first, so there is one real equation in 2 unknowns: infinitely many solutions.
Take b=1,a=−2: −2(1,2)+1(2,4)=(0,0) with coefficients not both zero, so the set is dependent: (2,4)=2(1,2).
Span: a(1,2)+b(2,4)=(a+2b)(1,2)=t(1,2), the line y=2x. The vector (1,0) would need t=1 and 2t=0, impossible, so it does not span.
Cross-check: det[1224]=4−4=0.
Answer. No. The set is dependent and only spans the line y=2x.
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 V.
Start with the empty set, whose span is just {0}.
Pick a non-zero vector of V and add it.
If the span is not yet V, pick a vector of V that is not in the span of the current set, and add it.
Repeat until the span equals V. 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 starting from the empty set.
Solution
Plan
Build-up method: add a vector outside the current span until the span is R2.
Start with the empty set.S=∅ has span {0}, which is not R2, so add a vector.
Add a non-zero vector. Choose (1,1); S={(1,1)} has span {t(1,1)}={(t,t)}, the line y=x. One non-zero vector is independent, but (1,0) has x=y, so it is not on this line. Add another.
Add a vector off the line y=x. Choose (1,2) (1=2). Now S={(1,1),(1,2)}.
Independent?a(1,1)+b(1,2)=(a+b,a+2b)=(0,0): subtracting the equations gives b=0, then a=0. Yes.
Spans? Solve a+b=x,a+2b=y: b=y−x, a=x−b=2x−y.
Verify.(2x−y)(1,1)+(y−x)(1,2)=(2x−y+y−x,2x−y+2y−2x)=(x,y). Every (x,y) is reached, so we can stop.
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)}, with (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 spansV. Keep deleting a vector that is a combination of the others. Deleting such a vector never reduces the span.
Start with a spanning set of V.
Look for a vector that can be written as a combination of the other vectors in the set.
If there is one, delete it (only one) and go back to step 2.
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)} 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)} spans R2. 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.
An obvious dependency.2⋅(1,2)=(2,4), so (2,4) is a multiple of (1,2).
Delete (2,4) only. The set becomes {(1,2),(2,3),(4,5)}. It still spans R2: anything built with (2,4) can be rebuilt with 2⋅(1,2).
Independent now? 3 vectors in R2 (dim=2) must be dependent. Try (1,2)=p(2,3)+q(4,5).
Solve for p,q.2p+4q=1,3p+5q=2. Multiply by 3 and 2: 6p+12q=3,6p+10q=4. Subtract: 2q=−1, q=−21, and 2p−2=1 gives p=23.
Check.23(2,3)−21(4,5)=(3,29)−(2,25)=(1,2). Delete (1,2): the set is now {(2,3),(4,5)}.
Independent?a(2,3)+b(4,5)=0 gives 2a+4b=0, 3a+5b=0; a=−2b, then −6b+5b=−b=0, so b=0,a=0. Cross-check: 2345=10−12=−2=0.
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 also span it automatically. Nothing can be deleted now.
Conclude.{(2,3),(4,5)} is a basis (2 vectors). A different last choice also works: deleting (2,3) instead of (1,2) gives {(1,2),(4,5)} with determinant 5−8=−3=0. The bases differ, but each has exactly 2 vectors.
Answer. Delete (2,4)=2(1,2), then (1,2)=23(2,3)−21(4,5). A basis is {(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.
Figure 4. Build up grows an independent set, trim down shrinks a spanning set
2.4Is this set a basis? A quick test
Membership. Does every vector of the set really lie in V? (For a subspace given by an equation, plug each vector into the equation.)
Independence. Is no vector a combination of the others?
Spanning. Can every vector of V be built from the set?
Shortcut preview
Once you know dimV=n (Topic 3), steps 2 and 3 collapse: a set of exactly n vectors from V 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}.
Solve for one variable: z=y+w−x. The variables x,y,w are free.
Write the general vector: (x,y,z,w)=(x,y,y+w−x,w).
Split by the free variables: (x,y,z,w)=x(1,0,−1,0)+y(0,1,1,0)+w(0,0,1,1).
So V=span{(1,0,−1,0),(0,1,1,0),(0,0,1,1)}. These three are independent because the x,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=0 in R3.
Solution
Plan
Recipe for a subspace given by an equation: solve the condition, write the general vector, split it by the free variables.
Solve for one variable.z=−x−y. It is determined by the others, while x and y can be chosen freely: the free variables are x and y.
General vector.(x,y,z)=(x,y,−x−y).
Split by the free variables.(x,y,−x−y)=(x,0,−x)+(0,y,−y)=x(1,0,−1)+y(0,1,−1).
Spanning set. So V=span{(1,0,−1),(0,1,−1)}.
Membership.(1,0,−1): 1+0−1=0. (0,1,−1): 0+1−1=0. Both lie in V.
Test the recipe.(2,3,−5) is in V (2+3−5=0), and 2(1,0,−1)+3(0,1,−1)=(2,0,−2)+(0,3,−3)=(2,3,−5).
Conclude. The set spans V, is independent and lies in V, so it is a basis. With 2 free variables, dimV=2: a plane has 2 basis vectors (one equation removes one dimension from the 3 of R3).
Answer. A basis of the plane x+y+z=0 is {(1,0,−1),(0,1,−1)}, so its dimension is 2.
Example 8Which sets are bases of V?
Let V={(x,y,z,w):x+z=y+w}⊆R4. Which of these sets is a basis of V? (Multiple select: choose all that apply.)
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)}
3
{(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)}
Solution
Plan
A vector is in V only if (sum of 1st and 3rd coordinates) = (sum of 2nd and 4th). First test membership of every vector, then independence.
Find dimV.z=y+w−x, with x,y,w free, so dimV=3 and a basis needs exactly 3 vectors. All four options have 3 vectors, so the count eliminates none.
Strategy. (a) For each vector compute x+z and y+w; if they differ for even one vector, that option fails. (b) If all 3 are in V, check independence: three independent vectors in a 3-dimensional space are automatically a basis.
Option 1, membership.
Vector
x+z
y+w
In V?
(1,0,0,0)
1
0
No (1 ≠ 0)
(0,1,0,0)
0
1
No (0 ≠ 1)
(0,0,0,1)
0
1
No (0 ≠ 1)
None lies in V. Option 1 fails.
Option 2, membership.
Vector
x+z
y+w
In V?
(1,1,0,0)
1
1
Yes
(0,1,−1,0)
−1
1
No (−1 ≠ 1)
(0,−1,0,1)
0
0
Yes
(0,1,−1,0) is not in V. Option 2 fails.
Option 3, membership.
Vector
x+z
y+w
In V?
u1=(1,0,−1,0)
0
0
Yes
u2=(1,1,0,0)
1
1
Yes
u3=(1,0,0,1)
1
1
Yes
All three are in V.
Option 3, independence.au1+bu2+cu3=(a+b+c,b,−a,c)=0 gives a+b+c=0, b=0, −a=0, c=0. The y, z, w equations give b=a=c=0, and the first then reads 0=0. Independent, so Option 3 is a basis.
Option 4, membership.
Vector
x+z
y+w
In V?
t1=(1,1,0,0)
1
1
Yes
t2=(0,1,1,0)
1
1
Yes
t3=(0,−1,0,1)
0
0
Yes
Option 4, independence.at1+bt2+ct3=(a,a+b−c,b,c)=0: a=0, b=0, c=0 directly, and the y-equation reads 0+0−0=0. Independent, so Option 4 is a basis.
Final tally.
#
All vectors in V?
Independent?
Basis?
1
No
–
No
2
No
–
No
3
Yes
Yes
Yes
4
Yes
Yes
Yes
Answer. Options 3 and 4 are bases of V. Options 1 and 2 contain vectors that are not in V.
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
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 V, written dim(V), is the number of vectors in a basis of V.
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.
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 has n vectors, dim(Rn)=n. For matrices, let Eij be the matrix with a 1 in row i, column j and zeros elsewhere. The mn matrices Eij form a basis of Mm×n(R).
Space
Dimension
A basis
{0} (zero space)
0
the empty set
Rn
n
e1,…,en
Mm×n(R)
mn
all Eij
M2×2(R)
4
E11,E12,E21,E22
Symmetric 2×2
3
E11,E12+E21,E22
Diagonal 2×2
2
E11,E22
Scalar 2×2
1
E11+E22 (the identity)
Upper triangular 2×2
3
E11,E12,E22
Lower triangular 2×2
3
E11,E21,E22
3.3Finding the dimension of a subspace
Build a basis of the subspace (Topic 2).
Count the vectors in it. That count is the dimension.
Example. Let W=span{(1,0,0),(0,1,0),(3,5,0)}⊆R3. The third vector is 3(1,0,0)+5(0,1,0), so it can be dropped. The remaining {(1,0,0),(0,1,0)} is independent and spans W, so it is a basis and dimW=2. Indeed all three vectors lie in the xy-plane.
3.4Handy consequences of "all bases have the same size"
Suppose dimV=n. Then:
Fact
Why it helps
Any set of more than n vectors in V is dependent
Too many vectors: some are redundant
Any set of fewer than n vectors cannot span V
Too few vectors: some directions are missed
n independent vectors in V form a basis
Only check independence, spanning is automatic
n vectors that spanV form a basis
Only check spanning, independence is automatic
If W is a subspace of V, then dimW≤dimV, and dimW=dimV only if W=V
A proper subspace is strictly smaller
Counting equations
A subspace of Rn cut out by kindependent homogeneous equations has dimension n−k. For example, one equation in R4 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
dimM1×2(R)=2
2
dimM2×1(R)=1
3
dimM3×3(R)=3
4
{E11,E12,E21,E22} is a basis of M2×2(R)
Solution
Plan
Everything follows from one fact: dimMm×n(R)=mn. First we see why it is true, then test the four options.
Building-block matrices.Eij has a 1 in row i, column j and 0 elsewhere. For 2×2: E11=[1000], E12=[0010], E21=[0100], E22=[0001].
They span.[acbd]=aE11+bE12+cE21+dE22. In general A=∑aijEij.
They are independent.∑cijEij is the matrix whose (i,j) entry is cij; it is the zero matrix only if every cij=0.
Count. One Eij per position: m rows ×n columns, so dimMm×n(R)=mn.
Option 1.m=1,n=2, so mn=2. Concretely (ab)=a(10)+b(01). True.
Option 2.m=2,n=1, so mn=2, not 1: (ab)=a(10)+b(01) needs two matrices. False.
Option 3.m=n=3, so mn=9, not 3. A 3×3 matrix has 9 independent entries. False.
Option 4. These are exactly the four matrices of step 1; they span and are independent, and match mn=2⋅2=4. True.
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.
V1 symmetric. Entry (1,2) equals entry (2,1): [abbc]=a[1000]+b[0110]+c[0001]. Independent, since the combination is zero only when a=b=c=0. dimV1=3.
V2 scalar. A number times the identity: [a00a]=a[1001]. The identity is non-zero, so {I} is independent. dimV2=1.
V3 diagonal.[a00d]=aE11+dE22, and these are independent. dimV3=2.
V4 upper triangular (entry below the diagonal is 0): [a0bc]=aE11+bE12+cE22; independent (their 1s sit in different positions). dimV4=3.
V5 lower triangular (entry above the diagonal is 0): [ab0c]=aE11+bE21+cE22; independent. dimV5=3.
Cross-check by counting conditions.M2×2(R) has dimension 4. Write a general matrix as [prqs]; then dim=4−(number of conditions).
Type
Conditions
How many
4−that
Symmetric
q=r
1
3
Scalar
q=0,r=0,p=s
3
1
Diagonal
q=0,r=0
2
2
Upper triangular
r=0
1
3
Lower triangular
q=0
1
3
These agree with steps 1 to 5.
Pick out dimension 3.dimV1=3,dimV2=1,dimV3=2,dimV4=3,dimV5=3. So dimension 3 holds for V1, V4 and V5.
Find the dimension of V={A∈M3×2(R):the sum of entries in each row is 0}.
Solution
Plan
A 3imes2 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.
General matrix.A=p1p2p3q1q2q3; row i holds pi and qi.
Apply the rule to every row.p1+q1=0,p2+q2=0,p3+q3=0, so q1=−p1,q2=−p2,q3=−p3.
Free entries. Each qi is decided by pi; p1,p2,p3 can be chosen freely: 3 free entries. A typical matrix is p1p2p3−p1−p2−p3.
Split by the free entries.A=p1B1+p2B2+p3B3 with B1=100−100, B2=0100−10, B3=00100−1. Each Bi is itself in V (its only non-zero row (1,−1) sums to 0), so B1,B2,B3 span V.
Independence.p1B1+p2B2+p3B3 is the matrix from step 3; it is zero only when p1=p2=p3=0 (look at the first column).
Count.{B1,B2,B3} is a basis of V, so dimV=3.
Cross-check by counting equations.M3×2(R) has dimension 3⋅2=6. We imposed 3 conditions, independent because each involves different entries (p1,q1 only, then p2,q2 only, then p3,q3 only). So dimV=6−3=3 ✓.
Answer.dimV=3, with basis B1,B2,B3 (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}.
Solution
Plan
Two equations in R4. Solve them together, find the free variables, and split the general vector.
Everything on the left.x+y−z−w=0(E1) and x−y−z+w=0(E2).
Subtract E2 from E1 to remove x and z: (x+y−z−w)−(x−y−z+w)=2y−2w=0, so y=w.
Substitute y=w into E1.x+y=z+y, so x=z.
Free variables.z=x and w=y: x and y are free, z,w are copies of them. Two free variables.
General vector.(x,y,z,w)=(x,y,x,y). Check E1: x+y=x+y ✓. E2: x+w=x+y and y+z=y+x, equal ✓.
Conclude and cross-check. A basis is {(1,0,1,0),(0,1,0,1)}, so dimV=2. Two equations in R4 give 4−2=2, valid because E1 and E2 are independent (their coefficient lists (1,1,−1,−1) and (1,−1,−1,1) are not multiples of each other).
Answer.V={(x,y,x,y)} has basis {(1,0,1,0),(0,1,0,1)}, so dimV=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
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↔Rj.
Scale a row by a non-zero number: Ri→cRi.
Add a multiple of one row to another: Ri→Ri+cRj.
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.
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×n matrix A is the number of linearly independent columns of A, 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).
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= number of non-zero rows of a REF = number of pivots. Zero rows never count.
Worked examples
Example 13Rank from both sides
Let A=1−1420−23−12. 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.
Name them. Columns c1=(1,−1,4),c2=(2,0,−2),c3=(3,−1,2). Rows r1=(1,2,3),r2=(−1,0,−1),r3=(4,−2,2).
Column relation. Try c3=αc1+βc2: (3,−1,2)=(α+2β,−α,4α−2β). The second equation gives α=1; the third becomes 4−2β=2, so β=1; the first checks: 1+2=3 ✓. So c1+c2=(3,−1,2)=c3, and the column rank is at most 2.
Are c1,c2 independent?ac1+bc2=(a+2b,−a,4a−2b)=0: the middle coordinate gives a=0, the first then gives 2b=0, so b=0. Independent. Column rank = 2.
Row relation. Try r3=αr1+βr2: (4,−2,2)=(α−β,2α,3α−β). The second equation gives α=−1; the first gives −1−β=4, so β=−5; the third checks: −3+5=2 ✓. So −r1−5r2=(−1,−2,−3)+(5,0,5)=(4,−2,2)=r3: the third row is redundant.
Are r1,r2 independent?ar1+br2=(a−b,2a,3a−b)=0: the middle gives a=0, then −b=0. Independent. Row rank = 2.
Gaussian elimination, part 1. The first pivot is the 1 at (1,1). R2+R1=(−1,0,−1)+(1,2,3)=(0,2,2) and R3−4R1=(4,−2,2)−4(1,2,3)=(0,−10,−10): 10022−1032−10.
Part 2. Scale R2 by 21: (0,1,1). Then R3+10R2=(0,−10,−10)+10(0,1,1)=(0,0,0). The echelon form is 100210310.
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), i.e. column 3 = column 1 + column 2, the same relation c3=c1+c2 found in step 2.
Compare.
Method
What we counted
Result
Columns
independent columns
2
Rows
independent rows
2
Elimination
non-zero rows / pivots
2
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=15−1230−101002.
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.
Largest possible rank.A is 3×4, so rank(A)≤min{3,4}=3. We will see whether all 3 rows are independent.
Column 1. The pivot is the 1 in row 1. R2−5R1=(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): 1002−72−150002.
Column 2: make the pivot 1. The second pivot is −7. Multiply R2 by −71 (allowed since −71=0): (0,1,−75,0).
Column 3: make the pivot 1. The third pivot is 710. Multiply R3 by 107: (0,0,1,57). The echelon form is 100210−1−7510057.
Count the pivots. Pivots in columns 1, 2 and 3 and three non-zero rows, so rank(A)=3.
What this tells us. The rank equals the largest value allowed, min{3,4}=3, so all three rows are independent. The column space lives in R3 and the row space in R4, 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.
4.3Facts about rank
Fact
Reason / example
rank(A)≤min{m,n} for an m×n matrix
Cannot have more pivots than rows or columns
rank(AB)≤min{rank(A),rank(B)}
Multiplying cannot create new independent directions
Row rank = column rank
Always true
rank(zero matrix)=0
No pivots at all
rank(In)=n
The identity has n pivots
A non-zero matrix with all entries equal has rank 1
Every row is a multiple of the first row
4.4Method 1: dimension and basis using rows
Write the given vectors as the rows of a matrix A.
Row reduce A to a row echelon form.
The non-zero rows of the REF form a basis of the span W. Their number is dimW.
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 dimW for W=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 W.
Read off the basis. The non-zero rows (1,0,0) and (0,1,0) form a basis of W. Row operations never change the span of the rows, so these two still span W; rows with pivots in different columns are independent, so nothing is wasted.
Count. 2 non-zero rows, so dimW=2.
Cross-check with section 3.3.(3,5,0)=3(1,0,0)+5(0,1,0) is a combination of the first two: exactly why R3 became the zero row. All three vectors lie in the xy-plane, which has dimension 2 ✓.
Answer. A basis of W is {(1,0,0),(0,1,0)} and dimW=2.
4.5Method 2: basis using columns
Write the given vectors as the columns of a matrix A.
Row reduce A to a REF (or RREF), call it R.
Find the pivot columns of R. The columns of the original matrix A 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]→[1010]. The first has column space span{(1,1)}, the second span{(1,0)}. So use R only to locate the pivot columns, then pick those columns from A.
Why does this work?
Row operations never change which columns depend on which: a relation c1col1+⋯+cncoln=0 holds for A exactly when it holds for R. The pivot columns of R are independent and every other column of R is a combination of the pivot columns to its left. The same is therefore true for the matching columns of A.
Figure 7. The same subspace handled by both methods. They give different bases of the same plane
Rows method
Columns method
Vectors go in as
Rows
Columns
What you read off
Non-zero rows of the REF
Pivot positions of the REF
Basis vectors come from
The reduced matrix (new vectors)
The original matrix (given vectors)
Same for both
The number of basis vectors is dimW=rank
The number of basis vectors is dimW=rank
Example 16Columns method, 3 vectors in R³
Find a basis of W=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.
Vectors as columns.v1=(1,1,2),v2=(2,−1,4),v3=(3,0,6) give A=1122−14306.
Clear below the first pivot.R2−R1=(1,−1,0)−(1,2,3)=(0,−3,−3) and R3−2R1=(2,4,6)−2(1,2,3)=(0,0,0): 1002−303−30.
Second pivot to 1. Multiply R2 by −31: (0,1,1). Call the result R=100210310.
Locate the pivot columns. The pivots are in column 1 and column 2. Column 3 has no pivot.
Take those columns from the ORIGINAL matrix A. Column 1 of A is (1,1,2) and column 2 is (2,−1,4). A basis is {(1,1,2),(2,−1,4)}; with 2 vectors, dimW=2.
Check the dropped vector. The third column of R is (3,1,0)=1⋅(1,0,0)+1⋅(2,1,0), i.e. column 3 = column 1 + column 2. The same must hold in A: (1,1,2)+(2,−1,4)=(3,0,6)=v3 ✓.
Why we must NOT use the columns of R. Row operations change the column space. Every vector of W has the form 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 R is (1,0,0), where z=0 while 2x=2. So (1,0,0)∈/W, and the columns of R would not even be vectors of W.
Answer. A basis of W is {(1,1,2),(2,−1,4)} and dimW=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)}. Find a basis and dimW.
Solution
Plan
Columns method again, now with 4 vectors in R4. Put them in as columns, eliminate, find the pivot columns, and read the basis from the original matrix.
Vectors as columns.v1=(1,1,0,0),v2=(2,1,−1,4),v3=(3,4,1,−4),v4=(3,2,−1,4) give A=110021−14341−432−14.
Column 1. The pivot is the 1 in row 1; rows 3 and 4 already have 0 there, so only R2 needs work: R2−R1=(1,1,4,2)−(1,2,3,3)=(0,−1,1,−1).
Column 2. The second pivot is the −1 in row 2. R3−R2=(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).
Second pivot to 1.−R2=(0,1,−1,1), so R=100021003−1003100.
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.
Pivot columns from the ORIGINAL matrix.basis={v1,v2}={(1,1,0,0),(2,1,−1,4)}, dimW=2. (Use the columns of A, not of R.)
Express the other two vectors. Column 3 of R is (3,−1,0,0): α(1,0,0,0)+β(2,1,0,0)=(3,−1,0,0) gives β=−1 and α+2β=3, so α=5. Column 4 of R is (3,1,0,0): β=1 and α+2=3, so α=1. Row operations keep these relations true for the columns of A: v3=5v1−v2 and v4=v1+v2.
Verify directly.5(1,1,0,0)−(2,1,−1,4)=(5,5,0,0)−(2,1,−1,4)=(3,4,1,−4)=v3 ✓ and (1,1,0,0)+(2,1,−1,4)=(3,2,−1,4)=v4 ✓.
Answer. A basis of W is {(1,1,0,0),(2,1,−1,4)}, dimW=2.
Example 18Pick a basis out of five vectors
Can a basis of R3 be obtained from {(1,1,1),(2,4,0),(0,1,1),(2,2,4),(3,4,5)}?
Solution
Plan
5 vectors in R3; a basis needs exactly 3 independent vectors. The columns method tells us which to keep.
Columns.A=111240011224345.
Clear below the first pivot.R2−R1=(0,2,1,0,1) and R3−R1=(1,0,1,4,5)−(1,2,0,2,3)=(0,−2,1,2,2).
Second pivot. It is the 2 in row 2. R3+R2=(0,−2,1,2,2)+(0,2,1,0,1)=(0,0,2,2,3). The matrix is now 100220012202313, with pivots 1,2,2.
Pivot columns. The pivots are in columns 1, 2, 3. Columns 4 and 5 have no pivot. The rank is 3.
Take them from the ORIGINAL matrix.{(1,1,1),(2,4,0),(0,1,1)}, the first three of the given vectors.
Why a basis of R3. The three chosen vectors are independent (pivot columns) and dimR3=3; three independent vectors in a 3-dimensional space automatically span it. Equivalently, the column space has dimension rank=3 and sits inside R3, so it isR3.
Second pivot. It is the 1 in row 2. The entry to clear is −23, so add 23R2 to R3: (0,−23,a−2)+23(0,1,−2)=(0,0,a−5).
Echelon form.200−3104−2a−5.
Cases. Rows 1 and 2 are non-zero for every a (pivots 2 and 1), so the rank is at least 2. If a−5=0 there are 3 pivots and the rank is 3. If a−5=0 the last row is zero and the rank is 2.
Choose a. We want rank 2, so a−5=0, i.e. a=5.
Cross-check with the determinant.detA=2(a−6)+(6−4)=2a−10, which is zero exactly when a=5; also the product of the pivots is 2⋅1⋅(a−5)=2a−10 ✓.
Check a=5. The third row (1,−3,5)=21(2,−3,4)−23(0,1,−2) ✓, so the rows are dependent and the rank is 2.
Answer.a=5 (then the last row becomes zero and rankA=2).
4.7More practice on rank
Example 20Rank of a 3×4 matrix
Find the rank of A=013102300113.
Solution
Plan
Reduce to echelon form and count the non-zero rows. The first entry of row 1 is 0, so first bring a row with a non-zero first entry to the top.
A is 3×4, so rank≤3.
Swap. The (1,1) entry is 0, so swap R1↔R2 (no arithmetic needed): 103012030113.
Clear column 1. Row 2 already has 0. R3−3R1=(3,2,0,3)−3(1,0,0,1)=(0,2,0,0).
Clear column 2. The second pivot is the 1 in row 2. R3−2R2=(0,2,0,0)−2(0,1,3,1)=(0,0,−6,−2). The matrix is 10001003−611−2, pivots 1,1,−6 in columns 1, 2, 3.
Count. All three rows are non-zero, so the rank is 3. This is the largest possible rank for a 3×4 matrix, min{3,4}=3, so all three rows are independent.
Answer.rank(A)=3.
Example 21Upper triangular matrix
For the matrix a00bd0cef with a,b,c,d,e,f real, which statements are correct? (Multiple select.)
1
If f=0, the rank is at most 2
2
If f=0, the rank is exactly 2
3
If a,b,c,d,e,f are all non-zero, the rank is 3
4
If a,d,f are non-zero, the rank is 3
Solution
Plan
Rank = number of independent rows. Prove one general fact, then judge each option.
Key fact: if a,d,f are all non-zero, the rank is 3. Rows r1=(a,b,c),r2=(0,d,e),r3=(0,0,f). Suppose αr1+βr2+γr3=0: (αa,αb+βd,αc+βe+γf)=0. First: αa=0 and a=0 give α=0. Second, with α=0: βd=0, d=0, so β=0. Third: γf=0, f=0, so γ=0. The rows are independent, so the rank is 3. The entries b,c,e were never used; they can be anything. (In echelon language the matrix is already in echelon form with pivots a,d,f.)
Option 1. If f=0 the third row is (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. True.
Option 2. "At most 2" is not "exactly 2". Counter-example: a=b=c=d=e=0,f=0 is the zero matrix, rank 0, not 2. Another: a=1 and all else 0 has rank 1. False.
Option 3. All six are non-zero, so in particular a,d,f=0; by the key fact the rank is 3. True.
Option 4. Exactly the key fact, whatever b,c,e are. True. (Option 3 is a special case of Option 4.)
Cross-check. A triangular determinant is a⋅d⋅f, non-zero exactly when a,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=1xx21yy21zz2 where x,y,z are distinct non-zero integers?
Solution
Plan
Eliminate with letters. Show that all three pivots are non-zero; since x,y,z are distinct, differences like y−x are never 0.
First pivot. The 1 in row 1, column 1.
Clear column 1.R2−xR1=(0,y−x,z−x) and R3−x2R1=(0,y2−x2,z2−x2).
Second pivot is y−x. We need m with y2−x2−m(y−x)=0. Since y2−x2=(y−x)(y+x), m=x+y. Replace R3 by R3−(x+y)R2. Column 2 becomes (y−x)(y+x)−(x+y)(y−x)=0. Column 3 becomes (z−x)(z+x)−(x+y)(z−x)=(z−x)(z−y).
Echelon form.1001y−x01z−x(z−x)(z−y), with pivots 1,y−x,(z−x)(z−y).
All pivots non-zero.1=0; y−x=0 since x=y; z−x=0 and z−y=0 since z differs from both, so their product is non-zero. Three non-zero rows: rank 3.
Numeric check. For x=1,y=2,z=3: A=111124139; the pivots are 1,y−x=1,(z−x)(z−y)=2⋅1=2, product 2. Directly, detA=1(18−12)−1(9−3)+1(4−2)=6−6+2=2 ✓, non-zero, so the rank is 3.
Remark. The product of the pivots (y−x)(z−x)(z−y) is the famous Vandermonde determinant. It vanishes only if two of x,y,z coincide. "Non-zero" in the question is not needed; only "distinct" matters.
Answer.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 0
3
A matrix whose entries are all the same non-zero real number has rank 1
4
The rank of the n×n identity matrix is 1 for every n
Solution
Option 1. This is the basic theorem about rank, and why we can speak of "the rank". Example: the 3×4 matrix of Example 14 has row rank 3 and column rank 3, even though its rows live in R4 and its columns in R3. True.
Option 2. Every column of the zero matrix is the zero vector, whose span is {0}, dimension 0; there are no pivots. True.
Option 3. If every entry is c=0, every row (c,c,…,c) equals the first. Subtract R1 from the other rows: ccccccccc→c00c00c00. One non-zero row (non-zero since c=0): one pivot, rank 1. True.
Option 4. The identity is already in echelon form with a pivot in every row. The rows of I2, (1,0) and (0,1), are independent, so rank(I2)=2, not 1. In general rank(In)=n. False.
Tally.
#
Statement
Verdict
1
row rank = column rank
True
2
rank of zero matrix is 0
True
3
all entries equal and non-zero: rank 1
True
4
rank(In)=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
Use whenA subspace is given by an equation (or equations) and you want a basis and its dimension.
Solve for the pivot variables in terms of the free ones.
Make one basis vector per free variable: set it to 1 and the other free ones to 0.
The number of those vectors is the dimension.
ExampleThe plane x+y+z=0 in R3: x and y are free, z=−x−y.
x=1,y=0⇒(1,0,−1)x=0,y=1⇒(0,1,−1)dim=2
Dimensions worth remembering
Space
Dimension
A basis
Rn
n
e1,…,en
Mm×n(R)
mn
all Eij
Symmetric 2×2
3
E11,E12+E21,E22
Diagonal 2×2
2
E11,E22
Scalar 2×2
1
E11+E22
Upper or lower triangular 2×2
3
E11,E12,E22 or E11,E21,E22
{(x,y,z,w):x+z=y+w}
3
(1,0,−1,0),(0,1,1,0),(0,0,1,1)
Plane x+y+z=0 in R3
2
(1,0,−1),(0,1,−1)
Which tool, and what to avoid
Question
What to do
Is B a basis of V?
Check independent and spanning; if dimV=n, n 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: rank(In)=n.
Saying dimM3×3(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): A 3×4 matrix can never have rank above 3.