🧮 Linear Algebra Kingdom · Linear Algebra
Linear Combinations
Build one vector out of others: evaluate a combination such as 3u - 2v, work backwards to find the weights that reach a target, decide whether a target can be reached at all, and see that a matrix times a vector is nothing more than a combination of the columns.
In short
- A linear combination is c1u + c2v + c3w: scale each vector by its own weight, then add. The weights may be negative or zero, and each belongs to exactly one vector.
- Finding the weights is solving a system: each entry of the target gives one equation, so the vectors supply the unknowns and their length supplies the equations.
- A target is reachable in exactly one way, in no way at all, or in infinitely many ways — and never in exactly two. Row-reduce the augmented matrix and read the pivots to tell which.
- Ax is the combination of the columns of A weighted by the entries of x, so Ax = b is the same backwards question written in three symbols.
- A mixture, feed or portfolio problem is Ax = b once each ingredient is written as a vector of what one unit of it yields.
So many of this one, and so many of that one
Cartwright Vela sets two poles in the ground at Basis Camp and refuses to give directions any other way. Every field on the isle, she says, is "so many of this one and so many of that one". That sentence is the whole craft.
A linear combination of the vectors u, v, w is anything you can build by scaling each one and adding the results:
c1*u + c2*v + c3*w
The numbers c1, c2, c3 are the weights (also called coefficients or scalars). They may be positive, negative, or zero, and each one belongs to exactly one vector.
Working one out is two jobs in order — stretch, then add:
u = [1, 3], v = [4, 1] 3u - 2v = 3[1, 3] - 2[4, 1] = [3, 9] - [8, 2] = [-5, 7]
Nothing here is new; it is the arithmetic of the last craft used deliberately. What is new is the question you ask with it. Forwards, you are given the weights and asked for the vector, and that is arithmetic. Backwards, you are given the vector and asked for the weights, and that is a whole subject.
Almost every later idea in this kingdom is a question about combinations wearing different clothes. A span is the set of all of them. Independence asks which combinations can reach the zero vector. A basis asks for a set that reaches everything exactly once. Getting comfortable here pays for all of it.
Working backwards: the weights are a system of equations
Here is the question that matters: given u, v and a target b, which weights make c1u + c2v = b?
The trick is to stop looking at it as a vector equation and read it one slot at a time. A vector equation in R2 says two things at once, and each of them is an ordinary equation.
u = [2, 3], v = [3, 1], b = [11, 6]
c1[2, 3] + c2[3, 1] = [11, 6]
first entries: 2c1 + 3c2 = 11 second entries: 3c1 + c2 = 6
That is a system of two equations in two unknowns, and you already know how to solve one. From the second equation, c2 = 6 - 3c1. Substituting: 2c1 + 18 - 9c1 = 11, so -7c1 = -7 and c1 = 1, which gives c2 = 3.
Always check by putting the weights back. 1[2, 3] + 3[3, 1] = [2, 3] + [9, 3] = [11, 6]. It holds.
The same reading works in any dimension, and the count of equations comes from the length of the vectors, while the count of unknowns comes from how many vectors there are. Three vectors in R3 give three equations in three unknowns. Two vectors in R3 give three equations in only two unknowns — and then the third equation is a genuine condition, not a formality: it may or may not agree, and whether it agrees is the whole question of the next section.
Two habits save most of the marks here. Keep the weights in the order the vectors are listed, because c1 belongs to the first vector and swapping them gives a different answer to a different question. And when a system has more equations than unknowns, solve with two of them and use the rest as a check, never as an afterthought.
One answer, none, or infinitely many
Not every target can be reached. Ask whether b is a combination of u and v at all, and there are exactly three possible replies — and the third one surprises people.
Exactly one choice of weights. The usual case: the system is consistent and the vectors pull in genuinely different directions, so there is one and only one way to build b.
No choice at all. The system is inconsistent. Somewhere in the reduction a row collapses to something like 0 = 1, which no weights can fix. Two vectors in R3 only ever reach the flat plane through the origin that contains them; a target off that plane is simply not reachable, however clever the weights.
Infinitely many choices. This happens when the vectors are not all pulling in different directions — when one of them is already a combination of the others. If v = 2u, then u and v reach only the one line through the origin along u, and every point of that line can be written in endlessly many ways: 5u + 0v, 3u + 1v, 1u + 2v, and so on for ever.
A system of linear equations has one solution, none, or infinitely many. It never has exactly two. If you ever find two different sets of weights that both work, you have automatically found infinitely many, because the difference between them can be added on in any amount.
The way to decide is always the same: build the augmented matrix, with the vectors as columns and the target as the last column, and reduce it.
c1[5, 3] + c2[2, 4] = [24, 20] becomes [[5, 2 | 24], [3, 4 | 20]]
Then read the pivots. A pivot in the last column means an impossible row, so no answer. A weight column with no pivot means that weight is free to be anything, so infinitely many. A pivot in every weight column and none in the last means exactly one.
Ax is a combination of the columns of A
This section is short and it is the most important one in the craft.
Write the vectors u and v as the columns of a matrix A, and write the weights as the entries of a vector x. Then the combination c1u + c2v is exactly what everyone calls the matrix-vector product Ax.
A = [[1, 4], [3, 1]] so the columns are [1, 3] and [4, 1] x = [2, 5]
Ax = 2*[1, 3] + 5*[4, 1] = [2, 6] + [20, 5] = [22, 11]
Ax is the combination of the columns of A, weighted by the entries of x. Read it that way and a great deal of what follows becomes obvious rather than memorised. The product only makes sense when A has as many columns as x has entries, because every column needs its own weight — and the answer has as many entries as A has rows, because that is how long the columns are.
The classic error is to read across the rows instead of down the columns. A column runs down the matrix, taking one entry from each row, and reading it the wrong way computes a different product entirely.
Once you can see it, the two big questions of this craft become one question:
- Ax = ? with x given is the forwards question: work out the combination.
- Ax = b with b given is the backwards question: find the weights. It is the same system of equations as before, now written in three symbols.
And that is what a word problem is too. Two seams of ore, each yielding so much iron and so much silver per crate; an order calling for exact totals. Make each seam a vector of what one crate yields, make the order the target b, and the number of crates from each seam are the weights. Mixtures, feeds, rations, portfolios, dyes — they are all Ax = b once the columns are named.
Worked examples
Example 1
u = [3, 1, -2], v = [1, 4, 5] and w = [2, -1, 0]. Work out 2u - 3v + w.
- Scale each vector first. 2u = [6, 2, -4].
- And 3v = [3, 12, 15], which is going to be taken away.
- And 1w = [2, -1, 0], unchanged.
- Now add and subtract one slot at a time. First entry: 6 - 3 + 2 = 5.
- Second entry: 2 - 12 - 1 = -11.
- Third entry: -4 - 15 + 0 = -19.
- So 2u - 3v + w = [5, -11, -19]. The minus in front of 3v reached all three of its entries, which is the step worth slowing down for.
Example 2
u = [2, 1, 1] and v = [1, 3, 4]. Is b = [7, 9, 11] a combination of u and v, and if so with which weights?
- Read the vector equation c1u + c2v = b one slot at a time, which gives three equations: 2c1 + c2 = 7, c1 + 3c2 = 9, and c1 + 4c2 = 11.
- Two unknowns, so solve with the first two and keep the third as the test.
- From the first, c2 = 7 - 2c1. Substituting into the second: c1 + 21 - 6c1 = 9, so -5c1 = -12.
- That gives c1 = 12/5, which is not whole — but nothing says weights have to be whole, so carry on: c2 = 7 - 24/5 = 11/5.
- Now the third equation decides everything: c1 + 4c2 = 12/5 + 44/5 = 56/5, which is 11.2, not 11.
- The third equation does not hold, so the system is inconsistent and b is **not** a combination of u and v. It sits just off the plane that u and v span.
- The lesson is in the last step: with more equations than unknowns, the leftover equations are the answer, not a formality.
Example 3
A = [[1, 4], [3, 1]] and b = [11, 11]. Find x with Ax = b, reading Ax as a combination of the columns of A.
- Name the columns by reading down, not across: the first column is [1, 3] and the second is [4, 1].
- Ax = b says x1*[1, 3] + x2*[4, 1] = [11, 11].
- One slot at a time: x1 + 4x2 = 11 from the first entries, and 3x1 + x2 = 11 from the second.
- From the second equation, x2 = 11 - 3x1. Substituting into the first: x1 + 44 - 12x1 = 11, so -11x1 = -33 and x1 = 3.
- Then x2 = 11 - 9 = 2, so x = [3, 2].
- Check by combining the columns: 3*[1, 3] + 2*[4, 1] = [3, 9] + [8, 2] = [11, 11]. It holds.
Example 4
One crate from the North seam yields 1 measure of iron and 4 measures of silver. One crate from the South seam yields 3 measures of iron and 1 measure of silver. An order calls for exactly 17 measures of iron and 13 measures of silver. How many crates come from each seam?
- Make each seam a vector of what one crate yields, iron first and silver second: North is [1, 4] and South is [3, 1].
- The order is the target b = [17, 13], and the counts of crates are the weights.
- So the question is c1*[1, 4] + c2*[3, 1] = [17, 13].
- Iron: c1 + 3c2 = 17. Silver: 4c1 + c2 = 13.
- From the iron equation, c1 = 17 - 3c2. Substituting into the silver equation: 68 - 12c2 + c2 = 13, so -11c2 = -55 and c2 = 5.
- Then c1 = 17 - 15 = 2, so 2 crates come from the North seam and 5 from the South seam.
- Check both lines at once: iron 2 + 15 = 17, silver 8 + 5 = 13. Both hold, which is what made it one problem rather than two.
Practice problems, with solutions
Three problems of increasing difficulty, each with the full working. In the game these are generated fresh every time; these three are fixed so this page always shows the same ones.
Problem 1
Difficulty 1 of 5Cartwright Vela sets two poles in the ground. u = [5, 2] v = [5, 3] Work out the combination 3u + 2v. Type the answer as a pair, for example (3, -2).
Answer: (25, 12)
- 3u = [15, 6].
- 2v = [10, 6].
- 1st entry: 15 + 10 = 25.
- 2nd entry: 6 + 6 = 12.
- 3u + 2v = [25, 12].
Problem 2
Difficulty 3 of 5u = [4, 2] v = [1, 3] b = [7, -9] Find the weights c1 and c2 for which c1u + c2v = b. Type the two weights as a pair, for example (3, -2), in the order the vectors are listed.
Answer: (3, -5)
- Writing c1u + c2v = b out entry by entry gives 4c1 + c2 = 7; 2c1 + 3c2 = -9.
- Solving that pair of equations gives c1 = 3 and c2 = -5.
- Check: 3 * [4, 2] + (-5) * [1, 3] = [7, -9].
Problem 3
Difficulty 4 of 5u = [6, -1, -5] v = [-3, -2, -6] b = [-3, -7, -23] How many choices of weights make c1u + c2v = b?
- Exactly one choice of weights works.
- Infinitely many choices of weights work.
- No choice of weights works at all.
- Exactly two choices of weights work.
Answer: A. Exactly one choice of weights works.
- The augmented matrix is [[6, -3 | -3], [-1, -2 | -7], [-5, -6 | -23]].
- Reducing it leaves 2 pivots, all of them in the 2 weight columns.
- There is exactly one choice here: the reduced matrix has a pivot in every weight column and none in the last one.
Common mistakes
- Adding the vectors and never using the weights, so 3u - 2v comes out as u + v.
- Letting a weight reach only the first entry of its vector, or losing the minus sign in front of a vector so only its top entry changes sign.
- Attaching the weights to the wrong vectors: c1 always belongs to the first vector listed, and swapping the pair answers a different question.
- Reporting the entries of the target as though they were the weights; the target is what the weights produce, not the weights themselves.
- Solving one equation of the system and stopping, so the answer fits the first slot and no other. Every slot has to hold at the same time, from the same weights.
- Reading a matrix across its rows when Ax is asked for, instead of down its columns.
- Believing that a system might have exactly two answers; finding two different sets of weights that work always means there are infinitely many.
What you should be able to do
- Evaluate a linear combination of two or three vectors.
- Find the weights that write one vector as a combination of others, by solving the system they give.
- Decide whether a vector can be written as a combination of a given set, and say why not when it cannot.
- Read a matrix-vector product as a linear combination of the columns of the matrix.
Where this fits in the curriculum
Common Core
- HSN-VM.B.4
High school — Add and subtract vectors.
HSN-VM.B.4 is a (+) standard — beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II.
- HSN-VM.B.5
High school — Multiply a vector by a scalar.
HSN-VM.B.5 is a (+) standard — beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II.
- HSN-VM.C.11
High school — Multiply a vector (regarded as a matrix with one column) by a matrix of suitable dimensions to produce another vector; work with matrices as transformations of vectors.
HSN-VM.C.11 is a (+) standard — beyond the college- and career-ready threshold, i.e. precalculus rather than Algebra II. Reading Ax as a combination of the columns of A is this same product, seen from the other side.