Matrices as Operators

What you will be able to do

Given a matrix and a vector, the learner can compute A x and decide whether a product is defined before forming it.

What you will be able to do

Given A x , the learner can express it as a linear combination of the columns of A weighted by the entries of x , and use that reading to decide questions about which vectors A x can reach.

Orientation

A x can be read two ways: row by row as a list of dot products, or as a recipe for mixing the columns of A using the entries of x as amounts. The arithmetic is identical and the second reading is the one everything later depends on. A basis is a set of columns, and a reduced cost prices one.

The arithmetic is mechanical. The reading carries the content: almost every later argument in this subject is a question about columns.

Intuition

A matrix is something that acts

The canonical text sets out both readings and says the column one carries the subject. Here is where it is actually spent.

Feasibility. “Does A x = b have a solution?” is “is b in the span of the columns?” A linear program with no feasible point is one where the constraint columns cannot reach the right-hand side, and that is visible without solving anything.

Bases. A basis is a choice of m columns that are independent, so they reach every point of R m exactly one way. That uniqueness is what lets a basis name a single point, and it is why a dependent choice leaves the basic solution undefined rather than merely awkward.

Pricing. A reduced cost asks what happens to the objective if a nonbasic column is mixed in a little. The question only makes sense under the column reading: the row reading computes the answer but says nothing about which column to try next.

The row reading remains how the arithmetic is done. The column reading is how the decisions are made, and every later structural argument in this subject is stated in it.

Figure

Matrix-vector multiplication as a combination of columns

x says how much of each column to take

A = ( 2 1 1 3 ) and x = ( 2 , 1 ) , drawn as the column reading does it.

The columns A 1 = ( 2 , 1 ) and A 2 = ( 1 , 3 ) are the two directions the matrix offers. The vector x says how much of each to take: two of the first, one of the second. Follow the pale arrows: 2 A 1 reaches ( 4 , 2 ) , then one A 2 carries you to ( 5 , 5 ) , which is A x :

A x = x 1 A 1 + x 2 A 2 = 2 ( 2 1 ) + 1 ( 1 3 ) = ( 5 5 ) .

What this reading answers that the row reading does not. The row computation gives the same ( 5 , 5 ) one entry at a time, and stops there. The column picture turns A x = b into a question about reach: which b can be written this way at all? Here the two columns point in different directions, so scaling and adding them reaches every point of the plane, and every b has exactly one recipe.

That is the question the rest of the course spends: feasibility asks whether b is in the span of the columns, a basis is a choice of columns that reach each target exactly once, and a dependent choice leaves the recipe undefined rather than merely awkward.

Definition

The action, the product, and the inverse

The canonical statement fixes A x as a combination of columns. Two consequences are worth drawing out, because the later material uses them constantly and neither is stated above.

The column reading answers reachability; the entry reading answers arithmetic. ( A x ) i = ∑ j a i j x j tells you how to compute a single component. A x = ∑ j x j A j tells you which vectors are reachable at all: precisely the span of the columns. Asking whether A x = b has a solution is asking whether b lies in that span, and no amount of entrywise computation makes that question easier to see.

The product is composition, which is why it is not commutative. ( A B ) x = A ( B x ) says A B is “do B , then do A ”. Two actions applied in the other order are a different action, so A B ≠ B A in general, and the shapes need not even permit both. The transpose reverses for the same reason: ( A B ) T = B T A T undoes the composition from the outside in.

Invertibility is a statement about the columns. A − 1 exists exactly when the columns are independent and span the whole of R m — when every target is reachable, and by exactly one combination. That is the same condition the simplex method checks when it asks whether a chosen set of columns forms a basis, which is why a singular A B makes a basic solution undefined rather than merely hard to compute.

Example

The same product, both readings

Take

A = ( 2 1 0 1 3 4 ) , x = ( 3 , 2 , 1 ) .

By rows. First entry: ( 2 ) ( 3 ) + ( 1 ) ( 2 ) + ( 0 ) ( 1 ) = 8 . Second entry: ( 1 ) ( 3 ) + ( 3 ) ( 2 ) + ( 4 ) ( 1 ) = 13 . So A x = ( 8 , 13 ) .

By columns. The columns are A 1 = ( 2 , 1 ) , A 2 = ( 1 , 3 ) , A 3 = ( 0 , 4 ) , and

A x = 3 ( 2 1 ) + 2 ( 1 3 ) + 1 ( 0 4 ) = ( 6 3 ) + ( 2 6 ) + ( 0 4 ) = ( 8 13 ) .

Same answer, as it must be.

What each shows. The row computation produces the number. The column computation shows that ( 8 , 13 ) is reachable by mixing A 's columns with weights 3 , 2 , 1 , and therefore that this particular b has at least one solution to A x = b . That is a fact about existence, and the row reading does not surface it.

Note the shapes. A is 2 × 3 and x is in R 3 , so A x lands in R 2 . The action moved between spaces.

Worked example

Order changes the answer

Problem. Let

A = ( 1 1 0 1 ) , B = ( 1 0 1 1 ) .

Compute A B and B A , and explain the difference in terms of what each matrix does.

Goal. Show that order matters, and say why rather than only that.

Relevant principle. A B means do B , then A . Composing two actions in the other order is a different action.

Step 1: compute A B . Apply A to each column of B . First column of B is ( 1 , 1 ) , and A ( 1 , 1 ) = ( 1 + 1 , 1 ) = ( 2 , 1 ) . Second column is ( 0 , 1 ) , and A ( 0 , 1 ) = ( 0 + 1 , 1 ) = ( 1 , 1 ) .

A B = ( 2 1 1 1 ) .

Reason: each column of the product is A applied to the corresponding column of B .

Step 2: compute B A . First column of A is ( 1 , 0 ) , and B ( 1 , 0 ) = ( 1 , 1 ) . Second column is ( 1 , 1 ) , and B ( 1 , 1 ) = ( 1 , 2 ) .

B A = ( 1 1 1 2 ) .

Step 3: read the difference. A adds the second coordinate onto the first; B adds the first onto the second. Doing those in different orders gives different results because the second operation acts on what the first produced.

Reason: composition is not symmetric. Putting on socks then shoes is not putting on shoes then socks.

Result. A B ≠ B A , and both are defined here only because both matrices are square and the same size.

Check. Apply each to ( 1 , 0 ) . A B gives ( 2 , 1 ) ; B A gives ( 1 , 1 ) . Different, as the matrices predict.

Interpretation. With non-square matrices the asymmetry is starker still: A of size 2 × 3 and B of size 3 × 4 make A B defined and B A meaningless. Checking the inner dimensions is not a formality. It is asking whether the composition exists at all.

Non-example

Undefined products and rules that do not hold

Multiplying mismatched shapes. A 2 × 3 matrix times a 2 × 2 matrix is undefined: the inner dimensions, 3 and 2 , disagree. The product is not zero and not approximate. There is nothing to compute.

Assuming A B = B A . It generally fails, and for non-square matrices one side may not even exist.

Transposing without reversing. ( A B ) T = B T A T , not A T B T . The order flips, and derivations that forget it go quietly wrong.

Expecting every square matrix to be invertible. ( 1 2 2 4 ) has no inverse: its second column is twice the first, so its columns cannot reach everything. Whether an inverse exists is settled by the independence of the columns.

Cancelling matrices. From A B = A C it does not follow that B = C , unless A is invertible. Matrices are not numbers, and division is not an available move.

Reading A x as a scaling of x . It is a combination of A 's columns, and it generally lives in a different space from x altogether.

Contrast

Two readings of one product

Row readingColumn reading
ComputesOne output entry at a timeThe whole output at once
A x isA list of dot productsA combination of A 's columns
Natural questionWhat is the answer?What answers are reachable?
Makes visibleThe arithmeticExistence, span, basis
Used byHand computationEvery structural argument later

Both are correct. They are the same sum, grouped differently. Neither is an approximation of the other.

Why the column reading earns its place. Solvability, bases, pivots and degeneracy are all questions about which vectors the columns can reach. Phrased in rows, each becomes a statement about a system of equations having a solution, true, but it hides the object doing the work.

A concrete case. If A 's columns are ( 1 , 2 ) and ( 2 , 4 ) , the column reading shows immediately that everything reachable lies along a single line, so A x = b is solvable only for b on that line. The row reading arrives at the same conclusion after elimination, having said nothing about why.

When to reach for rows. When you need the number. The two readings cost the same arithmetic; only one of them tells you something while you do it.

Exercise

1: fully structured. Let A = ( 1 2 0 3 ) and x = ( 4 , 1 ) .

(a) Compute A x by rows. (b) Write A x as a combination of A 's columns. (c) What space does A x live in?

Check: (a) ( 1 ) ( 4 ) + ( 2 ) ( 1 ) = 6 and ( 0 ) ( 4 ) + ( 3 ) ( 1 ) = 3 , so A x = ( 6 , 3 ) ; (b) 4 ( 1 , 0 ) + 1 ( 2 , 3 ) = ( 4 , 0 ) + ( 2 , 3 ) = ( 6 , 3 ) ; (c) R 2 , since A is 2 × 2 .

2: partly structured. A is 3 × 4 and B is 4 × 2 .

(a) Is A B defined, and what is its shape? (b) Is B A defined? (c) What does ( A B ) T equal, and what shape is it?

Check: (a) yes, inner dimensions are both 4 , and A B is 3 × 2 ; (b) no: B is 4 × 2 and A is 3 × 4 , so the inner dimensions 2 and 3 disagree; (c) ( A B ) T = B T A T , of shape 2 × 3 .

3: unstructured. An analyst is simplifying a derivation and writes: "Since M = A B and N = B A use the same two matrices, M and N have the same entries, so I can substitute one for the other and cancel B from both sides of A B = C B to conclude A = C ."

Identify every error and say what would have to be true for the final step to hold.

Check: three errors. First, A B and B A are generally different matrices even when both are defined, composition is order-dependent, and for non-square shapes one may not exist at all. Second, "the same entries" confuses the inputs with the result: the same two matrices combined in different orders give different products. Third, cancelling B from A B = C B is division, which matrices do not support; the step is valid only if B is square and invertible, in which case right-multiplying both sides by B − 1 gives A = C legitimately. Without invertibility the conclusion does not follow, for instance with B a matrix of zeros, A B = C B holds for every A and C .

What to carry forward

A matrix acts. A x = ∑ j x j A j . A linear combination of the columns, weighted by the entries of x .

Two readings, one answer. Rows give the arithmetic; columns give the structure. Solvability, span and bases are all column questions.

Shapes must meet. A B needs A to be m × n and B to be n × p . Mismatched inner dimensions make the product undefined, not zero.

Multiplication composes. ( A B ) x = A ( B x ) , do B , then A . That is why order matters.

A B ≠ B A in general, and for non-square matrices one side may not exist.

Transpose reverses. ( A B ) T = B T A T .

Inverses are conditional. Only square matrices can have one, and only when their columns are independent.

No cancelling. A B = A C gives B = C only when A is invertible.

The recurring error. Treating matrix multiplication as commutative.

Next step

Practice Matrices as Operators

Practice this

Results update as you type. Use the up and down arrow keys to move between results, Enter to open one, and Escape to close.

Type to search.

Settings

Appearance

Interface density

Your record

Your progress is stored in this browser and nowhere else: an identifier, the answers you have given, the mastery states and review schedule derived from them, and the lesson you last opened. Clearing it makes you a new learner on this device. It cannot be undone, and it will not affect your appearance or density settings.

Focus timer

Focus--minutes remaining

Phase

Kept in this browser only, and used to label the session in your own history.

Today

Nothing recorded yet. Finish a focus session and it will appear here.

Settings

Focus sessions between long breaks.

Sessions you are aiming for in a day.

Notifications

Your history

Sessions are stored in this browser and nowhere else. They are not evidence and never reach your mastery record.