Lecture 1: Vectors, Matrices, and Systems of Linear Equations
These notes are interactive: click any dotted term to unfold its exact definition or statement in place, click ▸ Proof to expand a proof, and try the exercises — answers are checked instantly.
1.1 Vectors and their operations
Linear algebra is built out of one kind of object: lists of numbers. A point in the plane, a force in space, a week of daily temperatures, a signal sampled at instants โ each is naturally a list, and each is naturally drawn as an arrow when it has two or three entries. We begin with the arithmetic of such lists; by the end of this lecture they will carry entire systems of equations.
denotes the set of all column vectors with real entries. For and a scalar , define vector addition and scalar multiplication entrywise: We write for the zero vector (all entries ) and .
A row vector with real entries is a list written horizontally, and it is added and scaled entrywise, exactly as for columns. The transpose operation turns one shape into the other: for a column vector and a row vector as above, So the transpose of a column vector is a row vector, and the transpose of a row vector is a column vector; the entries are unchanged, only the shape is. Applying the operation twice returns the original vector: Transposing also respects the two vector operations: and , since both sides are formed from the same entries.
Two vectors are equal when they have the same shape, the same number of entries, and every pair of corresponding entries is equal. That is, for column vectors , and likewise for two row vectors. In particular vectors of different lengths are never equal: and are different vectors, one in and one in . And a row vector is never equal to a column vector, no matter what its entries are: because the two sides have different shapes. They are related by the transpose, not by equality: the left-hand side is the transpose of the right-hand side.
This is a small definition with a large consequence for proofs. Every identity between vectors in this course โ and there will be many โ is proved the same way: show that the two sides have the same shape and size, then compare the -th entries. That single move reduces a statement about vectors to a statement about real numbers, where ordinary arithmetic finishes the job.
Shape matters: a column vector and a row vector with the same entries are never equal, and in this course โvectorโ with no qualifier always means a column vector โ that is what consists of, and columns are what matrices will act on. Rows will reappear shortly as the rows of a matrix.
Since tall columns are awkward inside a line of text, we use the transpose to write them sideways: denotes the column vector with entries . So is a column of height three, written on one line to save space. Displayed formulas keep the honest column shape.
The picture explains the definition. Adding entrywise is exactly the parallelogram rule: and span a parallelogram (the dashed sides are parallel copies of the two arrows), and is the diagonal from the origin โ two displacements performed in succession. Multiplying by stretches an arrow by the factor , flipping it when . Every algebraic rule below is obvious in this picture; the point of the proof is that the entrywise formulas really do behave like the picture, in every dimension.
For all and all scalars :
- ;
- ;
- ;
- ;
- ;
- ;
- ;
- .
Each identity is checked one entry at a time, where it reduces to a familiar rule of arithmetic in . We prove (1) and (5); the others are entirely similar and are left as exercises. (1) The -th entry of is and the -th entry of is ; these are equal because addition of real numbers is commutative, so the two vectors have equal entries and are therefore equal. (5) The -th entry of is , while the -th entry of is ; these agree by the distributive law for real numbers.
□Any collection of objects with an addition and a scalar multiplication obeying these eight rules is called a vector space. Later in the course we will meet vector spaces whose โvectorsโ are matrices, polynomials, or signals; every result we prove using only these eight rules will transfer to them for free. For now, is our home.
Let and , and set . What is the second entry of ?
Entrywise: .
Which of the following identities is not always true?
Compare with rule (5) of the properties theorem: the scalar must multiply both summands. Test with , .
Let . Which statement is correct?
Transposing swaps the shape and leaves the entries alone; see the definition of the transpose.
Let and . Which statement is correct?
Equal entries are not enough: equal vectors must also have the same shape. See the definition of equality.
1.2 Matrices and the product
Multiplying two vectors is less obvious than adding them. The product that linear algebra runs on pairs a row with a column of the same length and produces a single number โ think of a row of unit prices times a column of quantities: the total bill. Stacking several rows into a matrix then gives a product of a matrix with a column vector, and that product will turn out to have a second reading that powers the whole subject.
Let be a row vector of length . The rowโcolumn product of with a column vector of the same length is the scalar
Price-times-quantity: if the row holds unit prices and the column holds quantities, the product is the total cost. Note the output is a single number, not a vector.
An matrix is a rectangular array of numbers with rows and columns. Its rows are row vectors of length ; its columns are vectors in . For , the matrixโvector product is the column vector in whose -th entry is the rowโcolumn product of the -th row with :
A linear combination of the vectors with weights is the vector
Let be an matrix with columns . For every , the product is the linear combination of the columns of with weights .
Compare -th entries. By the definition, the -th entry of is . The -th entry of is โ the same sum, reordered using the algebraic properties of vector operations. Since all entries agree, the two vectors are equal.
□Let and . Row view: each entry is a rowโcolumn product, Column view: the same answer as a blend of the columns, Rows for computing, columns for understanding โ we will use both readings constantly.
For every matrix , all , and every scalar :
Compare -th entries. The -th entry of is , which by the distributive law equals โ the -th entry of . Similarly the -th entry of is , the -th entry of .
□Compute the rowโcolumn product .
.
For and , what is the third entry of ?
Rowโcolumn product of the third row with : .
1.3 Systems of linear equations and their solutions
Almost every quantitative problem in engineering ends, after modeling, in the same place: several unknown quantities constrained by several conditions that must hold simultaneously โ currents in a circuit obeying Kirchhoff's laws, forces balancing in a truss, concentrations in mixing tanks. When each condition is a linear relation among the unknowns, we get a system of linear equations. The rest of this lecture introduces those systems โ and shows that the vector language of the first two sections was built precisely for them.
A linear equation in the variables is an equation of the form where the coefficients and the right-hand side are real numbers. A system of linear equations (or linear system) is a finite collection of linear equations in the same variables. (Note the left-hand side is exactly a rowโcolumn product: the row of coefficients times the column of unknowns.)
A solution of a linear system in is a list of numbers that makes every equation of the system true when we substitute . The solution set is the set of all solutions. A system is consistent if it has at least one solution, and inconsistent if it has none.
Each equation in two variables describes a line in the plane, and a solution of a system is a point lying on all of its lines. Consider the three systems In (i) the two lines cross at exactly one point: adding the equations gives , so and then ; the unique solution is . In (ii) the lines are parallel and distinct โ no point lies on both, since cannot equal and at once โ so the system is inconsistent. In (iii) the second equation is twice the first: both describe the same line, and every point with is a solution โ infinitely many.
The three pictures above are not just examples โ they are a preview of a general fact we will prove next week: every linear system, in any number of variables, has either exactly one solution, no solution, or infinitely many. A linear system can never have exactly two solutions, or exactly five. Keep the pictures in mind as the geometric reason.
1.4 Equivalent systems and elementary operations
Two linear systems in the same variables are equivalent if they have the same solution set.
How do we show two systems are equivalent? Comparing solution sets directly is hopeless when we cannot yet compute them. The practical route is to transform one system into the other by simple steps that are guaranteed not to change the solution set.
The elementary operations on a linear system are:
- (Swap) interchange the positions of two equations;
- (Scale) multiply one equation by a nonzero constant ;
- (Replace) add a multiple of one equation to another equation.
If a linear system is obtained from another by one elementary operation, then the two systems are equivalent. Consequently, any chain of elementary operations produces an equivalent system.
First we check that every solution of the old system is a solution of the new one. A swap does not change the equations at all, only their order. For a scale, if satisfies an equation , then it satisfies , because multiplying both sides of a true numerical equality by keeps it true. For a replace, if the numbers satisfy equations and , then they satisfy , since we are adding equal numbers to equal numbers; the other equations are untouched.
Now the key point: each elementary operation is undone by an elementary operation of the same type โ a swap by the same swap, a scale by by a scale by (this is where is essential), and adding times equation by adding times equation . So the argument of the first paragraph also runs backwards: every solution of the new system is a solution of the old. The two solution sets contain each other, hence are equal. The statement about chains follows by applying this result once per step.
□The proof shows exactly why multiplying an equation by is forbidden: that step is not reversible. It erases an equation โ turning it into โ and can enlarge the solution set.
Consider the system , . Find the value of in its unique solution.
Add twice the second equation to the first to eliminate , or solve the second equation for and substitute.
Which of the following operations can change the solution set of a linear system?
The scale operation in the theorem on elementary operations allows multiplying only by a nonzero constant. Multiplying by the variable can create new solutions: in the system of the previous exercise, multiplying the first equation by turns it into , and now and satisfy both equations โ a new solution that the original system does not have.
1.5 The matrix equation
Here is the payoff of Sections 1.1 and 1.2. A system of equations carries three ingredients โ coefficients, unknowns, right-hand sides โ and we now have containers for all three: a matrix and two column vectors. Packed that way, the whole system, no matter how large, collapses into one line: .
Consider the linear system Collect its coefficients, its unknowns, and its right-hand sides into is the coefficient matrix of the system; and are the column vectors of unknowns and of right-hand sides. Since the left-hand side of the -th equation is exactly the -th entry of the matrixโvector product , the system asks precisely for those with called the matrix equation of the system. Finally, the augmented matrix is with the column attached as an extra last column.
A vector is a solution of the linear system if and only if . In particular, the system and the matrix equation have the same solution set.
Two column vectors are equal exactly when their entries agree. The -th entry of equals precisely when satisfies the -th equation, by the definition of . So holds if and only if all equations hold.
□The column view adds a second reading, worth saying out loud: is solvable exactly when can be written as a linear combination of the columns of โ the unknowns are the weights. One equation, two questions: โwhich inputs work?โ (row reading) and โis reachable from the columns?โ (column reading).
The elementary row operations on a matrix are the mirror images of the elementary operations on equations: swap two rows, scale a row by a nonzero constant, and add a multiple of one row to another row. Two matrices are row equivalent if one can be turned into the other by a chain of row operations. By the theorem on elementary operations, row-equivalent augmented matrices represent equivalent systems.
The system , , has augmented matrix:
Each column belongs to one variable, in order ; a variable missing from an equation contributes the coefficient in its column. The right-hand sides go in the last column, after the bar.
Let be the coefficient matrix of the system in the previous exercise. What is the entry (row , column )?
Row is the second equation; column belongs to .
We now have the language: vectors and their arithmetic, the product with its row and column readings, systems and their solution sets, three safe operations justified by a theorem, and the compact form . Next lecture we put it to work: Gaussian elimination, the algorithm that reduces any augmented matrix to a simple staircase shape from which the entire solution set can be read off.
Index of statements
- Definition 1.1 (Vectors in ; addition and scalar multiplication)
- Definition 1.2 (Row vectors and the transpose)
- Definition 1.3 (Equality of vectors)
- Remark 1.4
- Remark 1.5 (Notation: columns written sideways)
- Theorem 1.6 (Algebraic properties of vector operations)
- Remark 1.7
- Definition 1.8 (Rowโcolumn product)
- Example 1.9
- Definition 1.10 (Matrix; the matrixโvector product )
- Definition 1.11 (Linear combination)
- Theorem 1.12 (Column view of )
- Example 1.13 (One product, two computations)
- Theorem 1.14 (Linearity of in )
- Definition 1.15 (Linear equation, linear system)
- Definition 1.16 (Solution, solution set)
- Example 1.17 (Three systems in two variables)
- Definition 1.18 (Equivalent systems)
- Definition 1.19 (Elementary operations)
- Theorem 1.20 (Elementary operations preserve the solution set)
- Remark 1.21
- Definition 1.22 (Coefficient matrix, augmented matrix, matrix equation)
- Proposition 1.23
- Remark 1.24
- Definition 1.25 (Row operations)
- Remark 1.26 (Looking ahead)