Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Matrix Multiplication by Columns

How to use
  1. The tab strip above the figure chooses what is on screen. Matrix ×\times vector builds AvA\mathbf{v} from the columns of AA; the matrix-by-matrix tab repeats the same argument with a second matrix in place of the vector. What the second tab does
  2. Run plays the whole argument from wherever you are and turns into Pause. The twelve steps are one product each at the start, then one regrouping move at a time. More about the controls
  3. Step advances a single step and Back returns one. Use these rather than Run when a step is doing something you want to hold still, which is mostly the regrouping steps.
  4. The Steps pips and the step counter show where you are in the twelve steps. A pip is not clickable; it is a position marker. What the twelve steps are
  5. Reset returns to step 0, the empty bracket, with the same numbers on screen.
  6. Generate random numbers rolls a fresh AA and v\mathbf{v}. Weights are never zero and no column is the zero vector, so every arrow in the plane keeps a direction to draw. What the generator enforces
  7. The right panel is the plane picture. Dashed from the origin is a column of AA on its own; the solid arrow is that same column scaled by its weight, laid tail to head on the previous one. How to read the plane
  8. The note under the figure changes with the step and says what the picture is claiming at that moment. It is the part to read if a step looks like motion rather than arithmetic. Where the argument lands

From the definition to the columns

Nothing here is a new rule. Fill the A\textcolor{#1450c8}{A}v\textcolor{#b45309}{v} bracket one term at a time by the plain definition, then read its terms downwards instead of across. Each vertical pair shares one entry of v\textcolor{#b45309}{v}, and the two numbers it multiplies are a column of A\textcolor{#1450c8}{A} — which is the whole reason a column scales as one piece.
A\textcolor{#1450c8}{A}, and anything built from itv\textcolor{#b45309}{v}, and the scalars taken from it
A
2-13120
2×3
v
213
3×1
=
Av
(Av)1(Av)2
2×1
In the plane
510-2246
Nothing computed yet. The plane is empty because not one number of the answer exists.
The bracket on the right is empty. By the definition, entry ii of A\textcolor{#1450c8}{A}v\textcolor{#b45309}{v} is row ii of A\textcolor{#1450c8}{A} paired term by term with v\textcolor{#b45309}{v}. Six products in all, one per step — press Run. Nothing is computed yet, and the plane is empty to match. Learn more about the empty bracket
StepsStep0 / 11






What the tool shows

The figure on this page never leaves the definition of the product. It computes AvA\mathbf{v} exactly as the definition says — entry ii is row ii of AA paired term by term with v\mathbf{v} — and then regroups the same products a second way.

Two things are on screen at once. On the left is the algebra: the six products of a 2×32 \times 3 matrix against a three-entry vector, landing one at a time in a bracket. On the right is the plane, where the answer is drawn as an arrow and every partial result is drawn with it.

The colours carry one meaning each and never two. Blue is AA and anything built from AA — its columns, the scaled columns, the pieces of the answer. Amber is v\mathbf{v} and the single numbers taken from it. Nothing in the figure is coloured because of where it sits; the colour says what role the quantity plays.

If the row by column rule is not yet second nature, the matrix multiplication calculator runs it entry by entry. This page begins where that one stops.

The claim the whole page argues is short. A matrix times a vector is a weighted sum of the columns of the matrix, and the vector supplies nothing but the weights.

Stepping through A times v

The run has twelve steps and they fall into four stretches.

Step 0 is the empty bracket. Nothing has been computed, and the plane is empty to match — there is no arrow because not one number of the answer exists yet.

Steps 1 to 6 are the definition, one product per step. Each step multiplies one entry of a row of AA by one entry of v\mathbf{v} and sends the result to its slot. Entry 11 of the answer finishes at step 33, entry 22 at step 66.

Steps 7 to 9 do the regrouping. Nothing new is multiplied here. The two terms that share a weight are lifted out of the bracket together, the weight is written in front of them, and what is left behind is a column of AA — one column per step.

Steps 10 and 11 state the result in general and then in numbers. Step 1010 is the sentence Av=v1c1+v2c2+v3c3A\mathbf{v} = v_1c_1 + v_2c_2 + v_3c_3; step 1111 carries out the arithmetic and lands on the same pair of numbers the row-by-row route reached.

Use Step and Back on steps 77 to 99. They are the argument, and Run passes through them quickly.

The empty bracket

Step 00 is worth a moment rather than a click past.

The bracket for AvA\mathbf{v} already has its shape — two slots, one per row of AA — before a single number is known. The shape of a product is settled by the shapes of its factors, not by their contents, and that is why a vector of the wrong length is rejected before any arithmetic is attempted.
510-22468
Step 0, frozen

Axes and nothing else. The bracket for Av already has two slots — one per row of A — but neither holds a number, so there is nothing at all to draw.

The plane is empty for a stricter reason. An arrow needs both coordinates before it can exist, and at step 00 neither does. This is the honest picture of the computation: not a small answer or an approximate one, but no answer.

Reset returns here at any time with the same numbers on screen; Generate random numbers returns here with a fresh pair.

Press Step once and the first product lands — and the plane still cannot show you a vector, which is the subject of one product at a time.

One product at a time

Steps 11 to 66 are the definition and nothing else. Each step multiplies one entry of a row of AA by one entry of v\mathbf{v} and drops the result into its slot.

Six products, because a 2×32 \times 3 matrix against a three-entry vector has two rows of three terms each. Entry 11 finishes at step 33, entry 22 at step 66.
510-22468510-22468
Entry 1 complete, then entry 2, frozen

Above: the first entry is finished, so x is known and the answer lies somewhere on that dashed line. Below: the second entry lands, the two lines cross, and only now is there an arrow. Every step in between was a number, never a vector.

What the plane does during these six steps is the honest part. A dashed vertical line means the first coordinate is known; every point on that line is still a candidate. A dashed horizontal line means the second is known. One line on its own rules nothing in — it only rules things out. Only when both are drawn do they cross at a single point, and only then is there a vector to draw at all.

So the row-by-row route passes through no intermediate quantity that is itself a vector. It computes numbers, and the answer appears all at once when the last number lands. That is not a flaw in the rule; it is the difference between a procedure and a picture, and it is exactly what lifting out a column repairs.

Reading the plane treats the dashed-line stage and the arrow stage side by side.

Reading the plane

The right-hand panel is not decoration; it is the same computation drawn.

During steps 11 to 66 the panel shows dashed lines, not arrows. A dashed vertical line means the first coordinate is known; a dashed horizontal line means the second is. One line on its own fixes nothing — every point along it is still possible. Only when both lines are drawn do they cross at a single point, and only then is there a vector to draw. That is the honest picture of the row-by-row route: no intermediate step of it is a real quantity.

From step 77 the panel changes character. Each regrouped column appears twice: dashed from the origin, which is the column of AA by itself, and solid, which is that same column stretched by its weight and laid tail to head on the previous arrow. The direction of the dashed arrow never changes. A negative weight sends the solid arrow backwards along the same line rather than into a new direction.

At the end three arrows run end to end from the origin to the answer. Every corner along that path is a genuine vector — a partial sum of columns — which is what the first route could not offer.

Lifting out a column

Steps 77 to 99 are the argument. Nothing new is multiplied here — every product already exists, and all that changes is how they are grouped.

Two terms in the bracket share the factor vjv_j, because the definition pairs every row of AA with the same entry of v\mathbf{v}. Lift that factor out in front and what remains is the pair (a1j,a2j)(a_{1j}, a_{2j}) — column jj of AA, whole.
510-22468c1v1c1
First regrouping step, frozen

Dashed from the origin is column 1 of A on its own. Solid is that same column stretched by v1. The direction is fixed by A; the weight only decides how far along it you travel.

The plane makes the claim visible. Dashed from the origin is the column on its own, a direction that belongs to AA and to nothing else. Solid is that same column stretched by its weight and moved so its tail sits on the head of the previous arrow.

The dashed direction never changes as you step. A negative weight does not open a new direction — it sends the solid arrow backwards along the same line. That is the whole meaning of "the vector supplies only the weights".

Do these three steps with Step and Back rather than Run. They are one step per column, and they carry the entire argument of the page; the controls are there for exactly this.

The statement and the arithmetic

The last two steps say the same thing twice, once in general and once in numbers.

Step 1010 is the sentence

Av=v1c1+v2c2+v3c3A\mathbf{v} = v_1c_1 + v_2c_2 + v_3c_3


with cjc_j the jj-th column of AA. Step 1111 carries out the arithmetic and lands on the same pair of numbers the row-by-row route produced.
510-22468v1c1v2c2v3c3Av
Steps 10 and 11, frozen

Three scaled columns laid tail to head, ending on Av = (12, 4). Contrast this with the dashed-line route above: here every corner is a genuine vector, a partial sum of columns.

Both steps share one figure, because the plane is already complete at step 1010: three scaled columns laid tail to head, ending on the answer. The last step changes the algebra above the picture, not the picture.

Read the final figure against the dashed-line stage and the gain is obvious. Same endpoint, same eight-odd multiplications, but here every corner along the path is a real vector — a partial sum of columns. That is what makes the column reading say something about what the matrix *does*, rather than only about what it computes.

Where that leads is column space and solvability.

Running the tool

Run plays forward from wherever you are and becomes Pause while it is playing. It advances a little under twice a second, which is fast enough to show the shape of the argument and too fast to check a step.

Step and Back move exactly one step. These are the ones that matter on steps 77 to 99: a regrouping is a claim, and a claim is easier to check held still.

Reset returns to step 00the empty bracket — without touching the numbers. It restarts the route, not the example.

Generating new numbers

Generate random numbers replaces AA and v\mathbf{v} with a fresh pair and returns to step 00. The numbers are not drawn freely: the generator re-rolls until the example is drawable.

Three constraints are enforced. No weight is zero, because a zero weight would collapse its arrow to a point with no direction to show and no segment to label. No column of AA is the zero vector, for the same reason. No partial sum lands on the origin, and the final answer is capped so the plot stays readable at a sensible scale.

None of this is a fact about matrix multiplication. A zero weight is perfectly legal and it is worth knowing what it does: the corresponding column contributes nothing, and the product is a combination of the remaining columns only. The constraint exists because the figure has to draw an arrow, not because the algebra objects.

The plot itself is measured from the container in real pixels, so the axes, the tick spacing and the plotted range all follow the numbers on screen. A wide answer widens the range rather than shrinking the drawing into a corner.

Building AB by columns

The second tab replaces the vector with a matrix and changes nothing else about the argument.

Write BB as a list of its columns. Then ABAB is the list of AA applied to each of them in turn: column jj of ABAB is AA times column jj of BB, which by the first tab is a weighted sum of the columns of AA with the entries of that column of BB as the weights.

AB=[Ab1Ab2]AB = \begin{bmatrix} A\mathbf{b}_1 & A\mathbf{b}_2 \end{bmatrix}


So the whole product is built one column at a time, and each column is assembled exactly the way the first tab assembled AvA\mathbf{v}. The pieces are always the columns of the left factor; the weights always come from the right factor.

The colours keep their meanings across the tabs. Blue is still the pieces being combined — here the columns of AA — and amber is still the weights, here a column of BB. The result belongs to neither factor, so it carries no ownership colour at all and is drawn in navy behind a doubled bracket.

Every entry the definition would compute is computed. The reading only changes the order they are grouped in.

Why the weight comes out in front

The regrouping steps are the only place an argument is made, so they are worth doing slowly on paper as well as on screen.

By the definition, entry 11 of AvA\mathbf{v} is a11v1+a12v2+a13v3a_{11}v_1 + a_{12}v_2 + a_{13}v_3 and entry 22 is a21v1+a22v2+a23v3a_{21}v_1 + a_{22}v_2 + a_{23}v_3. Line them up vertically and read a column of that arrangement instead of a row. The two terms in the first column are a11v1a_{11}v_1 and a21v1a_{21}v_1. They share the factor v1v_1, and what it multiplies is the pair (a11,a21)(a_{11}, a_{21}) — which is column 11 of AA.

Av=v1[a11a21]+v2[a12a22]+v3[a13a23]A\mathbf{v} = v_1\begin{bmatrix} a_{11} \\ a_{21} \end{bmatrix} + v_2\begin{bmatrix} a_{12} \\ a_{22} \end{bmatrix} + v_3\begin{bmatrix} a_{13} \\ a_{23} \end{bmatrix}


Every row of AA meets the same entry of v\mathbf{v}, which is why the factor is shared down the whole column and why the column comes out whole rather than entry by entry.

Nothing was added to the definition. The same six products appear on both sides; only the grouping differs. That is the difference between a rule you apply and a statement you can see.

Column space and solvability

Reading the product by columns answers a question the row-by-row rule cannot phrase.

Every possible AvA\mathbf{v} is a weighted sum of the columns of AA, with the weights free to be anything. The set of all such sums is the span of the columns, called the column space of AA. It is not a set of numbers you compute once; it is the entire reach of the matrix.

That settles when Ax=bA\mathbf{x} = \mathbf{b} has a solution. A solution is a choice of weights that lands on b\mathbf{b}, so the system is solvable exactly when b\mathbf{b} lies in the column space, and unsolvable otherwise no matter how the arithmetic is arranged. With the 2×32 \times 3 matrix on this page the three columns are plane vectors, so unless they all lie along one line, their combinations already cover the whole plane and every b\mathbf{b} is reachable.

The number of genuinely independent directions among the columns is the rank. Three columns spanning a plane means one of them is redundant — there is more than one way to reach the same point, which is where extra solutions come from.

Span, column space, rank and solvability are all one picture seen from different sides.

Why A is two by three

The shape on this page is chosen so the figure can be drawn, and the choice is worth explaining because it is easy to think it is arbitrary.

Columns of AA have as many entries as AA has rows. Two rows means each column is a pair of numbers, which is a point in the plane and can be drawn. A matrix with three rows would have columns living in three dimensions, and the plane picture would be gone.

The three columns are deliberate too. A square matrix would let the eye slip into reading the picture as a grid of cells; a non-square one keeps the dimension argument visible. The vector must have one entry per column of AA, because it supplies one weight per column — which is the real content of the rule that the inner dimensions must match. Hand the tool a vector of the wrong length and there is no weight for one of the columns, so the sum cannot be formed at all.

The answer has two entries, one per row of AA. Weights count columns; the answer counts rows. That single sentence is the dimension rule stated without reference to any procedure.

Where this leads

The column reading is the first step into the geometric side of linear algebra rather than the arithmetic side.

The immediate destinations are column space, span, rank and the solvability of Ax=bA\mathbf{x} = \mathbf{b}, all of which were stated above in terms of weights on fixed directions.

Next is the fact that turns the reading into a tool. Take v\mathbf{v} to be a standard basis vector — one entry equal to 11 and the rest 00. The weighted sum then keeps exactly one column and discards the others, so AejA\mathbf{e}_j is column jj of AA. Read backwards, that says the columns of a matrix are where the basis vectors land. Building a rotation, a reflection or a projection stops being a formula to memorise and becomes a decision about where to send e1\mathbf{e}_1 and e2\mathbf{e}_2, written down as columns.

The mirror of this argument puts the vector on the left, where the matrix hands over its rows instead. That direction leads to elementary matrices, row equivalence and elimination rather than to spans and column spaces, and both readings meet once neither side is a vector.