The Geometry of Linear Equations
One system $Ax = b$, three ways to see it: the row picture, the column picture, and the matrix form.
0. Every word, from zero
Read this first. Every word used in this lecture is explained from the very beginning, with a tiny example and an everyday picture. Each section below repeats the words it uses, so you never have to scroll back.
| Word | Plain meaning | Tiny example | Everyday picture |
|---|---|---|---|
| Unknown | a number we don't know yet and want to find; we give it a letter | $x$ in $x + 1 = 3$ (it is $2$) | the price tag hidden under your thumb |
| Equation | a sentence "left side = right side" that must be true | $x + 1 = 3$ | a balance scale that must stay level |
| Coefficient | the number that multiplies an unknown | in $2x$, the coefficient is $2$ | "2 packets of" something |
| Linear equation | each unknown is only multiplied by a number, then the pieces are added | $2x - y = 0$ (linear); $x^2 + y = 1$ (not) | a straight-line rule, no curves |
| System of equations | several equations that must all be true at the same time | $2x - y = 0$ and $-x + 2y = 3$ | several rules a recipe must obey at once |
| Solution | values of the unknowns that make every equation true | $x = 1, y = 2$ for the pair above | the one recipe that passes every rule |
| Substitution | find one unknown in terms of another, then put that into a different equation | $y = 2x$, so $-x + 2y$ becomes $-x + 4x$ | swapping a word for its meaning |
| Vector | an ordered list of numbers, written as a column | $\begin{bmatrix} 2 \\ 1 \end{bmatrix}$ | an arrow: "2 steps right, 1 step up" |
| Component | one number inside a vector | $(2, 1)$ has components $2$ and $1$ | one item on a shopping list |
| Real numbers $\mathbb{R}$ | every number on the number line | $0,\ -3,\ 2.5,\ \pi$ | every mark on a ruler, including between the lines |
| $\mathbb{R}^2$, $\mathbb{R}^3$, $\mathbb{R}^n$ | all vectors with 2, 3, or $n$ components | $(2, 1)$ is in $\mathbb{R}^2$ | a flat sheet (2), a room (3), too many directions to draw ($n$) |
| Origin | the zero point, where every arrow starts | $(0, 0)$ | "home" on a map |
| Scalar | a single ordinary number (not a list) | $2$, $-1$ | a zoom factor |
| Scalar multiplication | multiply every component of a vector by one number | $2(2, 1) = (4, 2)$ | walking the same way, twice as far |
| Vector addition | add component by component | $(2, 1) + (-1, 2) = (1, 3)$ | walk one arrow, then the next from where you stopped |
| Linear combination | scale some vectors, then add them | $1(2, -1) + 2(-1, 2) = (0, 3)$ | a recipe: 1 cup of this + 2 cups of that |
| Weights | the numbers used in a linear combination | the $1$ and $2$ above | how many cups of each ingredient |
| Matrix | a rectangular table of numbers | $\begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix}$ | a spreadsheet |
| Row / column | one line read left→right / one line read top→bottom | row 1 $= (2, -1)$; column 2 $= (-1, 2)$ | row = one scenario; column = one product |
| $m \times n$ | a matrix with $m$ rows and $n$ columns | $\begin{bmatrix} 1 & 2 & 3 \end{bmatrix}$ is $1 \times 3$ | "rows by columns", like 3 shelves by 4 boxes |
| Coefficient matrix $A$ | the table of all coefficients: row $i$ = equation $i$, column $j$ = unknown $j$ | for $2x - y = 0,\ -x + 2y = 3$: $A = \begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix}$ | the menu card: what each ingredient adds |
| Right-hand side $b$ | the vector of numbers the equations must equal | $b = (0, 3)$ | the target, the order the client placed |
| $Ax = b$ | the whole system in one line: matrix times unknowns equals target | $\begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 0 \\ 3 \end{bmatrix}$ | "which recipe makes this dish?" |
| Row picture | draw each equation as a line (or plane); the solution is where they all meet | two lines crossing at $(1, 2)$ | two roads crossing at one junction |
| Column picture | see $Ax = b$ as "which mix of the column arrows lands on $b$?" | $1\,(\text{col }1) + 2\,(\text{col }2) = b$ | walking along given arrows to reach a treasure |
| Plane | a flat surface that goes on forever; a linear equation in 3 unknowns draws one | $2x - y = 0$ in 3D | an endless sheet of glass |
| Hyperplane | the "flat" shape one linear equation makes in 4 or more dimensions | $x_1 + x_2 + x_3 + x_4 = 1$ | a plane you can't draw |
| Dimension | how many separate directions a space has | a line: 1; a sheet: 2; a room: 3 | how many numbers you need to say "where" |
| Span | every point you can reach with all combinations of some vectors | span of $(1, 0)$ and $(0, 1)$ = whole plane | every spot you can walk to using only those arrows |
| Column space | the span of the columns of a matrix | for $A$ above: all of $\mathbb{R}^2$ | every payoff your products can build |
| Parallel | lines (or planes) with the same direction that never meet | $x + y = 1$ and $x + y = 3$ | two railway tracks |
| Singular | a square matrix whose columns fill less than the whole space; some $b$ can't be reached | $\begin{bmatrix} 1 & 1 \\ 2 & 2 \end{bmatrix}$ | two arrows pointing the same way: you're stuck on one road |
| Non-singular / invertible | a square matrix whose columns fill the whole space: exactly one solution for every $b$ | $\begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix}$ | arrows pointing different ways: you can go anywhere |
| Dot product | multiply matching entries of two lists, then add | $(2, 5) \cdot (1, 2) = 2 + 10 = 12$ | price list · quantity list = bill |
| Payoff | the money a product pays at expiry, in each possible scenario | 20,000 CE pays $\max(S - 20{,}000, 0)$ | what the ticket is worth when the match ends |
| CE / PE | call option (pays if Nifty ends above the strike) / put option (pays if it ends below) | 19,800 CE at 20,000 pays $200$ points | a bet on "up" / a bet on "down" |
| Strike | the fixed level written into an option | the "20,000" in 20,000 CE | the line the bet is measured from |
| Lot | one unit of a traded product (here we just count lots) | "1 lot of A" | one packet |
| Bond | pays the same fixed amount whatever happens | pays $1$ if up, $1$ if down | money in a locker |
| Replication | building a wanted payoff out of products you can trade | 2 bonds + 1 stock pays $(5, 3)$ | cooking a restaurant dish at home from basic ingredients |
| Complete market | every payoff can be replicated (the payoff columns fill the whole space) | bond + stock in a two-state market | a kitchen where any dish can be made |
1. The problem: solving $Ax = b$
Equation = a sentence "left side = right side" that must be true. Unknown = a number we want to find, written as a letter ($x$, $y$). Coefficient = the number multiplying an unknown. $A$ = the table (matrix) of coefficients. $x$ = the list (vector) of unknowns. $b$ = the list of right-hand numbers. $Ax = b$ = "find the unknowns that make every equation true". Row = one equation. Column = everything that multiplies one unknown.
An equation is linear if each unknown is just multiplied by a number, and the terms are added together.
An equation is non-linear if an unknown is squared (or raised to another power), multiplied by another unknown, or put inside a function like $\sqrt{x}$ or $\sin x$.
| Linear ✓ | Not linear ✗ |
|---|---|
| $2x - y = 0$ | $x^2 + y = 1$ (has a square) |
| $-x + 2y = 3$ | $xy = 3$ (unknowns multiplied together) |
| View | You look at… | The question becomes… |
|---|---|---|
| Row picture | one equation (row) at a time | Where do all the lines or planes meet? |
| Column picture ★ | one column at a time | What combination of the columns makes $b$? |
| Matrix form | the whole system at once | Find $x$ with $Ax = b$. This is the compact algebra behind both pictures. |
2. Vectors: the building blocks
Vector = an ordered list of numbers, drawn as an arrow from the origin. Component = one number in that list. Origin = the zero point $(0, 0)$ where arrows start. $\mathbb{R}^2$ = all lists of 2 real numbers (a flat sheet); $\mathbb{R}^3$ = all lists of 3 (a room). Scalar = one plain number. Scalar multiplication = multiply every component by that number. Vector addition = add matching components. Linear combination = scale some vectors, then add them.
A vector is an ordered list of numbers, written as a column:
$$ v = \begin{bmatrix} 2 \\ 1 \end{bmatrix} $$Each number in the list is a component. This $v$ has 2 components: $2$ and $1$.
What are $\mathbb{R}$, $\mathbb{R}^2$, $\mathbb{R}^3$ and $\mathbb{R}^n$?
$\mathbb{R}$ stands for the real numbers: every number on the number line, such as $0$, $-3$, $2.5$, $\sqrt{2}$ and $\pi$. The small raised number says how many components each vector has.
| Symbol | What it contains | Picture | Example |
|---|---|---|---|
| $\mathbb{R}$ | single real numbers | a line (1D) | $5$ |
| $\mathbb{R}^2$ | all vectors with 2 components $(x, y)$ | the flat plane (2D), like a sheet of paper | $(2, 1)$ |
| $\mathbb{R}^3$ | all vectors with 3 components $(x, y, z)$ | ordinary 3D space, like a room | $(1, -2, 4)$ |
| $\mathbb{R}^n$ | all vectors with $n$ components | $n$-dimensional space (cannot be drawn when $n > 3$) | $(v_1, v_2, \dots, v_n)$ |
Read $\mathbb{R}^2$ as "R-two". So "$v$ is in $\mathbb{R}^2$" simply means "$v$ is a list of 2 real numbers".
A vector as an arrow
Every vector can be drawn as an arrow that starts at the origin $(0, 0)$. Its components say how far to move along each axis:
- first component $2$: move 2 to the right (along the $x$-axis);
- second component $1$: move 1 up (along the $y$-axis).
The arrow ends at the point $(2, 1)$. So the same two numbers can be seen as a point or as an arrow to that point. In linear algebra we usually think of the arrow.
In $\mathbb{R}^3$ it works the same way with a third direction: $(1, -2, 4)$ means 1 along $x$, 2 backwards along $y$, and 4 up along $z$.
We only ever need two operations on vectors:
-
What we do Scalar multiplication: multiply $v = (2, 1)$ by the number $2$.
Why Multiplying by a number stretches, shrinks or flips the arrow. We want to see "twice as far, same direction".
How Multiply each component on its own. Top: $2 \times 2 = 4$. Bottom: $2 \times 1 = 2$.
$$ 2\begin{bmatrix} 2 \\ 1 \end{bmatrix} = \begin{bmatrix} 2 \times 2 \\ 2 \times 1 \end{bmatrix} = \begin{bmatrix} 4 \\ 2 \end{bmatrix} $$What we have now $2v = (4, 2)$: same direction as $v$, twice as long.
-
What we do Multiply $v = (2, 1)$ by $-1$.
Why A minus number flips the arrow to point the opposite way.
How Top: $-1 \times 2 = -2$. Bottom: $-1 \times 1 = -1$.
$$ -1\begin{bmatrix} 2 \\ 1 \end{bmatrix} = \begin{bmatrix} -2 \\ -1 \end{bmatrix} $$What we have now $-v = (-2, -1)$: same length, pointing backwards (2 left, 1 down).
-
What we do Vector addition: add $v = (2, 1)$ and $w = (-1, 2)$.
Why Adding means "walk along $v$, then walk along $w$ starting where $v$ ended" (head-to-tail). The sum is where you finish.
How Add the top numbers: $2 + (-1) = 2 - 1 = 1$. Add the bottom numbers: $1 + 2 = 3$.
$$ \begin{bmatrix} 2 \\ 1 \end{bmatrix} + \begin{bmatrix} -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 2 + (-1) \\ 1 + 2 \end{bmatrix} = \begin{bmatrix} 1 \\ 3 \end{bmatrix} $$What we have now $v + w = (1, 3)$: 1 right and 3 up from the origin.
Put the two operations together: multiply vectors by numbers, then add. The result is a linear combination:
$$ c\,v + d\,w \qquad (c, d \text{ any numbers}) $$Strang calls this the most fundamental operation in the whole course. Almost every question in linear algebra is a question about linear combinations.
3. From equations to matrix form
Equation = "left = right", must be true. Unknowns = the letters $x, y$ we want to find. Coefficient = the number in front of an unknown (in $-x$ it is $-1$). Matrix = a rectangular table of numbers. $m \times n$ = $m$ rows, $n$ columns. Coefficient matrix $A$ = the table of coefficients. Vector of unknowns $x$ = the list $(x, y)$. Right-hand side $b$ = the list of numbers after the "=" signs. Row = one equation. Column = one unknown's coefficients. Symmetric = the matrix looks the same when flipped across its diagonal.
Our first example has two equations and two unknowns:
$$ \begin{aligned} 2x - y &= 0 \\ -x + 2y &= 3 \end{aligned} $$Collect the numbers into three objects: the coefficient matrix $A$, the vector of unknowns $x$, and the right-hand side $b$.
$$ \underbrace{\begin{bmatrix} 2 & -1 \\ -1 & 2 \end{bmatrix}}_{A} \underbrace{\begin{bmatrix} x \\ y \end{bmatrix}}_{x} = \underbrace{\begin{bmatrix} 0 \\ 3 \end{bmatrix}}_{b} $$A matrix is a rectangular array of numbers. A matrix with $m$ rows and $n$ columns is called $m \times n$. Here $A$ is $2 \times 2$.
How to read the matrix:
| Part of $A$ | Corresponds to | In our example |
|---|---|---|
| Row $i$ | equation $i$ | Row 1 $= (2, -1)$ holds the coefficients of $2x - y = 0$ |
| Column $j$ | unknown $j$ | Column 1 $= (2, -1)$ holds every coefficient of $x$; column 2 $= (-1, 2)$ holds every coefficient of $y$ |
In this example row 1 and column 1 happen to both be $(2, -1)$, because $A$ is symmetric. That is a coincidence. In general rows and columns are different, so always keep track of which one you mean.
4. The row picture
Row picture = draw each equation (row) as a line and look where the lines meet. Line = all the points $(x, y)$ that make one equation true. Point $(x, y)$ = a spot: $x$ across, $y$ up. Origin = the point $(0, 0)$. Solution = a point that makes every equation true, so it sits on every line. Right-hand side = the number after the "=".
Idea: take one equation at a time and draw all the points $(x, y)$ that satisfy it. Each equation gives a line. A solution of the system must satisfy every equation, so it must lie on every line: it is where the lines meet.
How to draw each line
A line is fixed by any two of its points. An easy method is to set one unknown to $0$ and solve for the other, then pick one more convenient value.
| Equation 1: $2x - y = 0$ | Equation 2: $-x + 2y = 3$ | |
|---|---|---|
| Through origin? | Yes: $(0,0)$ gives $0 = 0$ ✓ | No: $(0,0)$ gives $0 \ne 3$ |
| Point A | $(0, 0)$ | $y = 0 \Rightarrow x = -3$: $(-3, 0)$ |
| Point B | $x = 1 \Rightarrow y = 2$: $(1, 2)$ | $x = -1 \Rightarrow y = 1$: $(-1, 1)$ |
The same table, one tiny move at a time:
-
What we do Test whether line 1, $2x - y = 0$, goes through the origin.
Why If $(0, 0)$ works, we get a first point for free.
How Put $x = 0$, $y = 0$: $2 \times 0 - 0 = 0 - 0 = 0$. The right side is $0$. Equal ✓.
What we have now Point A of line 1 is $(0, 0)$.
-
What we do Find a second point on line 1 by choosing $x = 1$.
Why Two points fix a line. $x = 1$ is an easy number.
How $2 \times 1 - y = 0$, so $2 - y = 0$. "2 minus what is 0?" Add $y$ to both sides: $2 = y$.
What we have now Point B of line 1 is $(1, 2)$.
-
What we do Test line 2, $-x + 2y = 3$, at the origin.
How $-0 + 2 \times 0 = 0$, but the right side is $3$, and $0 \ne 3$.
What we have now Line 2 misses the origin. We need two other points.
-
What we do On line 2, choose $y = 0$.
How $-x + 2 \times 0 = 3$, so $-x + 0 = 3$, so $-x = 3$. Flip both signs: $x = -3$.
What we have now Point A of line 2 is $(-3, 0)$.
-
What we do On line 2, choose $x = -1$.
How $-(-1) + 2y = 3$. Minus a minus is a plus, so $1 + 2y = 3$. Take 1 from both sides: $2y = 3 - 1 = 2$. Halve both sides: $y = 2 \div 2 = 1$.
What we have now Point B of line 2 is $(-1, 1)$. Both lines can now be drawn.
A line goes through the origin exactly when its right-hand side is $0$. Checking this first tells you a lot about the picture before you draw anything.
Check the solution in both original equations:
-
What we do Put $x = 1$, $y = 2$ into equation 1, $2x - y = 0$.
Why The crossing point must make every equation true. Reading it off a picture is not proof; the numbers are.
How $2 \times 1 = 2$. Then $2 - 2 = 0$. The right side is $0$ ✓.
-
What we do Put $x = 1$, $y = 2$ into equation 2, $-x + 2y = 3$.
How $-x = -1$. $2y = 2 \times 2 = 4$. Then $-1 + 4 = 3$. The right side is $3$ ✓.
What we have now Both equations hold, so $x = 1,\ y = 2$.
This is the picture you have seen in school. It works well for 2 × 2, but as we will see in section 8 it becomes very hard to use once there are more unknowns.
5. The column picture ★
Column = everything that multiplies one unknown, stacked top to bottom; here each column is a vector (an arrow). Column picture = ask "how much of each column arrow, added together, lands on $b$?". $b$ = the target vector $(0, 3)$. Linear combination = scale arrows by numbers, then add. Weights = those numbers ($x$ and $y$). Substitution = replace a letter by what it equals. "Both sides" = the left and the right of the "=": doing the same thing to both keeps the equation true.
Now read the same two equations a column at a time. Nothing about the system changes. We only regroup it, pulling out everything that multiplies $x$ and everything that multiplies $y$:
$$ \begin{bmatrix} 2x - y \\ -x + 2y \end{bmatrix} = \begin{bmatrix} 0 \\ 3 \end{bmatrix} \quad\Longleftrightarrow\quad x \underbrace{\begin{bmatrix} 2 \\ -1 \end{bmatrix}}_{\text{column 1}} + \; y \underbrace{\begin{bmatrix} -1 \\ 2 \end{bmatrix}}_{\text{column 2}} = \underbrace{\begin{bmatrix} 0 \\ 3 \end{bmatrix}}_{b} $$This is one vector equation instead of two separate equations, and the question changes completely:
How much of column 1 ($x$) and how much of column 2 ($y$) must we combine to produce the vector $b$?
Why $x = 1$ and $y = 2$?
These numbers are not picked. The equations force them.
Step 1: Solve the equations.
$$ \begin{aligned} 2x - y &= 0 &&\text{(1)} \\ -x + 2y &= 3 &&\text{(2)} \end{aligned} $$The plan: use one equation to write $y$ in terms of $x$, put that into the other equation to find $x$, then go back and find $y$.
-
What we do 1a. Use equation (1), $2x - y = 0$, to say what $y$ is in terms of $x$.
Why Equation (1) has a $0$ on the right and only a plain $-y$, so $y$ is easy to get alone.
How Add $y$ to both sides. Left: $2x - y + y = 2x$. Right: $0 + y = y$. So $2x = y$, which we read backwards as $y = 2x$.
$$ \begin{aligned} 2x - y &= 0 \\ 2x &= y &&\text{add } y \text{ to both sides} \\ y &= 2x \end{aligned} $$What we have now In any solution, $y$ must be exactly twice $x$.
-
What we do 1b. Put $y = 2x$ into equation (2), $-x + 2y = 3$.
Why Then equation (2) contains only one unknown, $x$, and one unknown can be solved straight away.
How, move 1 Replace $y$ by $2x$: $-x + 2(2x) = 3$.
How, move 2 $2(2x)$ means "2 lots of $2x$" $= 4x$. So $-x + 4x = 3$.
How, move 3 Minus one $x$ plus four $x$'s leaves three $x$'s: $-1 + 4 = 3$, so $3x = 3$.
How, move 4 "3 times what is 3?" Divide both sides by 3: $x = 3 \div 3 = 1$.
$$ \begin{aligned} -x + 2y &= 3 \\ -x + 2(2x) &= 3 &&\text{put } y = 2x \\ -x + 4x &= 3 &&2(2x) = 4x \\ 3x &= 3 &&-x + 4x = 3x \\ x &= 1 &&\text{divide both sides by } 3 \end{aligned} $$What we have now $x = 1$.
-
What we do 1c. Find $y$ by putting $x = 1$ back into $y = 2x$.
Why $y = 2x$ is already "$y$ alone", so this is the quickest way.
How $y = 2 \times 1 = 2$.
$$ \begin{aligned} y &= 2x \\ y &= 2(1) &&\text{put } x = 1 \\ y &= 2 \end{aligned} $$Another way Use equation (2) directly: $-1 + 2y = 3$. Add 1 to both sides: $2y = 3 + 1 = 4$. Halve both sides: $y = 4 \div 2 = 2$. Same answer.
$$ \begin{aligned} -x + 2y &= 3 \\ -1 + 2y &= 3 &&\text{put } x = 1 \\ 2y &= 4 &&\text{add } 1 \text{ to both sides} \\ y &= 2 &&\text{divide both sides by } 2 \end{aligned} $$What we have now $x = 1$, $y = 2$.
-
What we do 1d. Check both original equations with $x = 1$, $y = 2$.
Why A small slip in any move would show up here.
Check (1) $2x - y$: $2 \times 1 = 2$, then $2 - 2 = 0$. Should be $0$ ✓.
Check (2) $-x + 2y$: $-1$, and $2 \times 2 = 4$, then $-1 + 4 = 3$. Should be $3$ ✓.
$$ \begin{aligned} \text{(1)}:&\quad 2(1) - 2 = 2 - 2 = 0 \;✓ \\ \text{(2)}:&\quad -1 + 2(2) = -1 + 4 = 3 \;✓ \end{aligned} $$What we have now $x = 1$, $y = 2$ is the only pair that satisfies both equations.
Step 2: Put those numbers into the column picture. The column picture says $x\,(\text{column 1}) + y\,(\text{column 2}) = b$:
$$ x \begin{bmatrix} 2 \\ -1 \end{bmatrix} + y \begin{bmatrix} -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 0 \\ 3 \end{bmatrix} $$-
What we do Scale column 1 by $x = 1$.
How Top: $1 \times 2 = 2$. Bottom: $1 \times (-1) = -1$.
What we have now $(2, -1)$: one step along column 1.
-
What we do Scale column 2 by $y = 2$.
How Top: $2 \times (-1) = -2$. Bottom: $2 \times 2 = 4$.
What we have now $(-2, 4)$: two steps along column 2.
-
What we do Add the two scaled columns, box by box.
Why In the column picture the answer is "this much of column 1 plus this much of column 2".
How Top: $2 + (-2) = 0$. Bottom: $-1 + 4 = 3$.
$$ 1 \begin{bmatrix} 2 \\ -1 \end{bmatrix} + 2 \begin{bmatrix} -1 \\ 2 \end{bmatrix} = \begin{bmatrix} 2 \\ -1 \end{bmatrix} + \begin{bmatrix} -2 \\ 4 \end{bmatrix} = \begin{bmatrix} 2 + (-2) \\ -1 + 4 \end{bmatrix} = \begin{bmatrix} 0 \\ 3 \end{bmatrix} = b \;✓ $$What we have now $(0, 3)$, which is exactly $b$ ✓.
It lands exactly on $b = (0, 3)$. The same two numbers that satisfy the equations are the amounts that make the columns add up to $b$.
Step 3: What $x$ and $y$ mean in each picture. They are the same two numbers, but they play a different role:
| What $x$ and $y$ are | The question being asked | |
|---|---|---|
| Row picture | coordinates of a point | Which point lies on both lines? |
| Column picture | amounts that scale each column vector | How much of each column do I need to reach $b$? |
In the column picture the columns are fixed arrows. You are not looking for a location. You are looking for how far to travel along each arrow. As a walk from the origin:
| Move | Now at |
|---|---|
| start | $(0, 0)$ |
| go $1 \times (2, -1)$ | $(2, -1)$ |
| go $2 \times (-1, 2)$ | $(0, 3) = b$ ✓ |
That is why $x$ and $y$ are called weights rather than coordinates: $x = 1$ means "one unit of column 1", and $y = 2$ means "two units of column 2".
6. Row vs column: side by side
Row picture = one line per equation; the answer is where the lines meet. Column picture = one arrow per unknown (column); the answer is how much of each arrow reaches $b$. Point = a location $(x, y)$. Weights = the amounts that multiply the arrows. Hyperplane = the flat shape one equation makes when there are more than 3 unknowns. $n$ dimensions = lists of $n$ numbers.
Both pictures solve the same system and give the same answer $(x, y) = (1, 2)$. They just draw it differently.
| Row picture | Column picture | |
|---|---|---|
| What is drawn | One line per equation | One arrow per unknown (column), plus $b$ |
| What $(x, y)$ means | A point in the plane | Weights in a combination |
| Where the answer is | The point where lines meet | The weights that make the arrows reach $b$ |
| If $b$ changes | The lines move | The arrows stay, only $b$ moves |
| In $n$ dimensions | $n$ hyperplanes meeting: impossible to picture | $n$ vectors combining to $b$: still a clear idea |
7. All combinations: which $b$ can we reach?
Linear combination = $x\,(\text{col 1}) + y\,(\text{col 2})$: scale the column arrows, then add. Target $b = (b_1, b_2)$ = any point we want to land on; $b_1$ is its top number, $b_2$ its bottom number. Reach = find weights $x, y$ that land exactly on $b$. Span = the set of all points reachable this way. Column space = the span of a matrix's columns. $\mathbb{R}^2$ = the whole flat plane.
The question
So far the right-hand side was fixed at $b = (0, 3)$, and we found the one combination that reaches it. Now change the question:
If $b$ can be any vector, can we always find $x$ and $y$ with $x\,(\text{col 1}) + y\,(\text{col 2}) = b$?
In other words: if we try every possible $x$ and $y$, which points can the combination land on?
Try some combinations
Column 1 $= (2, -1)$ and column 2 $= (-1, 2)$. Pick a few values of $x$ and $y$ and see where we land:
| $x$ | $y$ | $x(2, -1) + y(-1, 2)$ | Lands on |
|---|---|---|---|
| $1$ | $0$ | $(2, -1) + (0, 0)$ | $(2, -1)$ |
| $0$ | $1$ | $(0, 0) + (-1, 2)$ | $(-1, 2)$ |
| $1$ | $1$ | $(2, -1) + (-1, 2)$ | $(1, 1)$ |
| $1$ | $2$ | $(2, -1) + (-2, 4)$ | $(0, 3)$ ← our $b$ |
| $2$ | $1$ | $(4, -2) + (-1, 2)$ | $(3, 0)$ |
| $-1$ | $-1$ | $(-2, 1) + (1, -2)$ | $(-1, -1)$ |
One row of the table, slowly ($x = 2$, $y = 1$):
-
What we do Scale column 1 by $x = 2$.
How Top: $2 \times 2 = 4$. Bottom: $2 \times (-1) = -2$. Result $(4, -2)$.
-
What we do Scale column 2 by $y = 1$.
How Top: $1 \times (-1) = -1$. Bottom: $1 \times 2 = 2$. Result $(-1, 2)$.
-
What we do Add them box by box.
How Top: $4 + (-1) = 3$. Bottom: $-2 + 2 = 0$.
What we have now We land on $(3, 0)$, as the table says. Every other row is done the same way.
The results go up, down, left and right. Drawing every whole-number combination gives a slanted grid that keeps going in all directions:
Proof that every $b$ can be reached
Take any target $b = (b_1, b_2)$, where $b_1$ and $b_2$ are any numbers. We need $x$ and $y$ with
$$ x \begin{bmatrix} 2 \\ -1 \end{bmatrix} + y \begin{bmatrix} -1 \\ 2 \end{bmatrix} = \begin{bmatrix} b_1 \\ b_2 \end{bmatrix} $$Comparing the top and bottom components gives two equations:
$$ \begin{aligned} 2x - y &= b_1 &&\text{(top)} \\ -x + 2y &= b_2 &&\text{(bottom)} \end{aligned} $$Solve exactly as in section 5, only with $b_1, b_2$ instead of $0, 3$.
-
What we do Get $y$ alone from the top equation, $2x - y = b_1$.
Why Same plan as section 5: one unknown in terms of the other, then substitute.
How, move 1 Add $y$ to both sides: $2x = b_1 + y$.
How, move 2 Take $b_1$ away from both sides: $2x - b_1 = y$, i.e. $y = 2x - b_1$.
$$ \begin{aligned} 2x - y &= b_1 \\ 2x &= b_1 + y &&\text{add } y \text{ to both sides} \\ y &= 2x - b_1 &&\text{subtract } b_1 \text{ from both sides} \end{aligned} $$What we have now $y = 2x - b_1$. (Check with $b_1 = 0$: $y = 2x$, as in section 5.)
-
What we do Put $y = 2x - b_1$ into the bottom equation, $-x + 2y = b_2$.
Why Then only $x$ is unknown.
How, move 1 Replace $y$: $-x + 2(2x - b_1) = b_2$.
How, move 2 Open the bracket: $2 \times 2x = 4x$ and $2 \times (-b_1) = -2b_1$. So $-x + 4x - 2b_1 = b_2$.
How, move 3 Collect the $x$'s: $-1 + 4 = 3$, so $3x - 2b_1 = b_2$.
How, move 4 Add $2b_1$ to both sides: $3x = 2b_1 + b_2$.
How, move 5 Divide both sides by 3: $x = \frac{2b_1 + b_2}{3}$.
$$ \begin{aligned} -x + 2y &= b_2 \\ -x + 2(2x - b_1) &= b_2 &&\text{put } y = 2x - b_1 \\ -x + 4x - 2b_1 &= b_2 &&\text{multiply out the bracket} \\ 3x - 2b_1 &= b_2 &&-x + 4x = 3x \\ 3x &= 2b_1 + b_2 &&\text{add } 2b_1 \text{ to both sides} \\ x &= \frac{2b_1 + b_2}{3} &&\text{divide by } 3 \end{aligned} $$What we have now A formula for $x$ that works for any target.
-
What we do Put that $x$ back into $y = 2x - b_1$.
How, move 1 $2 \times \frac{2b_1 + b_2}{3} = \frac{4b_1 + 2b_2}{3}$ (double the top of the fraction).
How, move 2 To take away $b_1$ from a fraction with bottom 3, write $b_1$ as $\frac{3b_1}{3}$ (three thirds of $b_1$ is $b_1$).
How, move 3 Subtract the tops: $4b_1 + 2b_2 - 3b_1 = b_1 + 2b_2$. So $y = \frac{b_1 + 2b_2}{3}$.
$$ \begin{aligned} y &= 2\cdot\frac{2b_1 + b_2}{3} - b_1 \\ y &= \frac{4b_1 + 2b_2}{3} - \frac{3b_1}{3} &&\text{write } b_1 \text{ as } \tfrac{3b_1}{3} \\ y &= \frac{b_1 + 2b_2}{3} &&4b_1 - 3b_1 = b_1 \end{aligned} $$What we have now Formulas for both weights, for any $b$.
For any $b = (b_1, b_2)$, the weights
$$ x = \frac{2b_1 + b_2}{3}, \qquad y = \frac{b_1 + 2b_2}{3} $$reach it. The only step that could fail is dividing by $3$, and $3$ is never zero. So there is always an answer, and no $b$ is out of reach.
Test the formula on three targets:
| Target $b$ | $x = \frac{2b_1 + b_2}{3}$ | $y = \frac{b_1 + 2b_2}{3}$ | Check $x(2,-1) + y(-1,2)$ |
|---|---|---|---|
| $(0, 3)$ | $\frac{0 + 3}{3} = 1$ | $\frac{0 + 6}{3} = 2$ | $(2 - 2,\ -1 + 4) = (0, 3)$ ✓ |
| $(3, 0)$ | $\frac{6 + 0}{3} = 2$ | $\frac{3 + 0}{3} = 1$ | $(4 - 1,\ -2 + 2) = (3, 0)$ ✓ |
| $(5, 7)$ | $\frac{10 + 7}{3} = \frac{17}{3}$ | $\frac{5 + 14}{3} = \frac{19}{3}$ | $(\frac{34 - 19}{3},\ \frac{-17 + 38}{3}) = (5, 7)$ ✓ |
The hardest row, $b = (5, 7)$, slowly:
-
What we do Work out $x = \frac{2b_1 + b_2}{3}$ with $b_1 = 5$, $b_2 = 7$.
How $2 \times 5 = 10$. Then $10 + 7 = 17$. So $x = \frac{17}{3}$.
-
What we do Work out $y = \frac{b_1 + 2b_2}{3}$.
How $2 \times 7 = 14$. Then $5 + 14 = 19$. So $y = \frac{19}{3}$.
-
What we do Check the top component of $x(2, -1) + y(-1, 2)$.
How $2 \times \frac{17}{3} = \frac{34}{3}$. $-1 \times \frac{19}{3} = -\frac{19}{3}$. Add: $\frac{34 - 19}{3} = \frac{15}{3} = 5$. Should be $b_1 = 5$ ✓.
-
What we do Check the bottom component.
How $-1 \times \frac{17}{3} = -\frac{17}{3}$. $2 \times \frac{19}{3} = \frac{38}{3}$. Add: $\frac{-17 + 38}{3} = \frac{21}{3} = 7$. Should be $b_2 = 7$ ✓.
What we have now Even a messy target is reached exactly.
Why it works: the columns point in different directions
Column 1 and column 2 are not on the same line. Two arrows in different directions work like "east" and "north" on a map: by walking some amount along each, you can reach any spot.
Suppose column 2 were $(-2, 1)$ instead. That is just $-1 \times$ column 1, so both arrows lie on the same line. Every combination is
$$ x(2, -1) + y(-2, 1) = (x - y)(2, -1), $$-
What we do Rewrite $(-2, 1)$ using column 1.
How $-1 \times (2, -1) = (-2, 1)$. So $y(-2, 1) = -y(2, -1)$.
-
What we do Add the two pieces.
How $x$ copies of $(2, -1)$ plus $-y$ copies of $(2, -1)$ is $x - y$ copies: $(x - y)(2, -1)$.
What we have now Whatever $x$ and $y$ are, the result is some number times $(2, -1)$.
which is always a multiple of $(2, -1)$ and stays on that one line. A target like $(0, 3)$ is off the line and can never be reached. Section 9 looks at this case in detail.
Name for it: span
The span of some vectors is the set of all their linear combinations: every point you can land on.
- Span of $(2, -1)$ and $(-1, 2)$ = the whole plane $\mathbb{R}^2$.
- Span of $(2, -1)$ and $(-2, 1)$ = just one line.
For the columns of a matrix $A$, the span is called the column space, which comes later in the course.
From now on, every system comes with two questions:
| Question | In symbols |
|---|---|
| 1. Which combination gives this particular $b$? | Solve $Ax = b$. |
| 2. Which $b$ can be reached at all? | What is the span of the columns? |
8. Three equations, three unknowns
Unknowns $x, y, z$ = three numbers to find. $3 \times 3$ = 3 rows (equations) and 3 columns (unknowns). Substitution = replace a letter by what it equals. Plane = the endless flat sheet of all $(x, y, z)$ that make one equation true. Row picture = three planes; the answer is the one point on all three. Column picture = three arrows (the columns); the answer is how much of each lands on $b$. Right-hand side $b$ = the numbers after the "=" signs.
Now $A$ is $3 \times 3$: three equations (rows) and three unknowns (columns).
8.1 Solve it step by step
The plan: equation (1) has only $x$ and $y$, so it gives $y$ in terms of $x$. Then (2) gives $z$ in terms of $x$. Then (3) has only one unknown left, $x$.
-
What we do Step a. Get $y$ alone from equation (1), $2x - y = 0$.
Why Equation (1) has only two unknowns and a $0$ on the right: the easiest one to start with.
How Add $y$ to both sides: $2x - y + y = 0 + y$, so $2x = y$.
$$ \begin{aligned} 2x - y &= 0 \\ 2x &= y &&\text{add } y \text{ to both sides} \\ y &= 2x \end{aligned} $$What we have now $y = 2x$.
-
What we do Step b. Put $y = 2x$ into equation (2), $-x + 2y - z = -1$, and get $z$ alone.
Why After replacing $y$, equation (2) only has $x$ and $z$, so it tells us $z$ in terms of $x$.
How, move 1 Replace $y$: $-x + 2(2x) - z = -1$.
How, move 2 $2(2x) = 4x$: $-x + 4x - z = -1$.
How, move 3 $-1 + 4 = 3$ lots of $x$: $3x - z = -1$.
How, move 4 Add $z$ to both sides: $3x = -1 + z$.
How, move 5 Add $1$ to both sides: $3x + 1 = z$.
$$ \begin{aligned} -x + 2y - z &= -1 \\ -x + 2(2x) - z &= -1 &&\text{put } y = 2x \\ -x + 4x - z &= -1 &&2(2x) = 4x \\ 3x - z &= -1 &&-x + 4x = 3x \\ 3x + 1 &= z &&\text{add } z \text{ and } 1 \text{ to both sides} \\ z &= 3x + 1 \end{aligned} $$What we have now $y = 2x$ and $z = 3x + 1$. Everything depends only on $x$.
-
What we do Step c. Put both into equation (3), $-3y + 4z = 4$.
Why Then equation (3) has just one unknown, $x$.
How, move 1 Replace: $-3(2x) + 4(3x + 1) = 4$.
How, move 2 Open the brackets: $-3 \times 2x = -6x$; $4 \times 3x = 12x$; $4 \times 1 = 4$. So $-6x + 12x + 4 = 4$.
How, move 3 $-6 + 12 = 6$: $6x + 4 = 4$.
How, move 4 Take 4 from both sides: $6x = 4 - 4 = 0$.
How, move 5 "6 times what is 0?" Only $0$: $x = 0 \div 6 = 0$.
$$ \begin{aligned} -3y + 4z &= 4 \\ -3(2x) + 4(3x + 1) &= 4 &&\text{put } y = 2x,\ z = 3x + 1 \\ -6x + 12x + 4 &= 4 &&\text{multiply out the brackets} \\ 6x + 4 &= 4 &&-6x + 12x = 6x \\ 6x &= 0 &&\text{subtract } 4 \text{ from both sides} \\ x &= 0 &&\text{divide by } 6 \end{aligned} $$What we have now $x = 0$.
-
What we do Step d. Put $x = 0$ back into $y = 2x$ and $z = 3x + 1$.
How $y = 2 \times 0 = 0$. $z = 3 \times 0 + 1 = 0 + 1 = 1$.
$$ \begin{aligned} y &= 2x = 2(0) = 0 \\ z &= 3x + 1 = 3(0) + 1 = 1 \end{aligned} $$What we have now $(x, y, z) = (0, 0, 1)$.
-
What we do Step e. Check all three original equations with $(0, 0, 1)$.
Check (1) $2x - y = 2 \times 0 - 0 = 0 - 0 = 0$. Should be $0$ ✓.
Check (2) $-x + 2y - z = -0 + 2 \times 0 - 1 = 0 + 0 - 1 = -1$. Should be $-1$ ✓.
Check (3) $-3y + 4z = -3 \times 0 + 4 \times 1 = 0 + 4 = 4$. Should be $4$ ✓.
$$ \begin{aligned} \text{(1)}:&\quad 2(0) - 0 = 0 \;✓ \\ \text{(2)}:&\quad -0 + 2(0) - 1 = -1 \;✓ \\ \text{(3)}:&\quad -3(0) + 4(1) = 4 \;✓ \end{aligned} $$
$$ (x, y, z) = (0, 0, 1) $$
8.2 Row picture: three planes
With three unknowns, each equation is a flat plane in 3D space.
| Plane | Equation | Through the origin? | Shape |
|---|---|---|---|
| 1 | $2x - y = 0$ | Yes (right side is $0$) | No $z$ in it, so $z$ can be anything. The plane is "vertical" and contains the whole $z$-axis. |
| 2 | $-x + 2y - z = -1$ | No ($0 \ne -1$) | A tilted plane. Three of its points are $(1,0,0)$, $(0,0,1)$ and $(0,-\tfrac12,0)$. |
| 3 | $-3y + 4z = 4$ | No ($0 \ne 4$) | No $x$ in it, so $x$ can be anything. The plane runs parallel to the $x$-axis. |
The steps in 8.1 have a picture:
- Steps a and b = planes 1 and 2 meet in a line. Points on both planes satisfy $y = 2x$ and $z = 3x + 1$. So their common line is all points $(x,\ 2x,\ 3x + 1)$, for example $(0, 0, 1)$ and $(1, 2, 4)$.
- Step c = plane 3 cuts that line in one point. Only $x = 0$ puts the line on plane 3.
- That point is the solution $(0, 0, 1)$: the only point on all three planes.
Two lines crossing is easy to see. Three planes meeting is already hard to see even with a 3D picture, and with four or more unknowns it cannot be drawn at all. This is why Strang drops the row picture here.
8.3 Column picture: three vectors in 3D
Group the same system by columns:
$$ x \underbrace{\begin{bmatrix} 2 \\ -1 \\ 0 \end{bmatrix}}_{\text{col 1}} + y \underbrace{\begin{bmatrix} -1 \\ 2 \\ -3 \end{bmatrix}}_{\text{col 2}} + z \underbrace{\begin{bmatrix} 0 \\ -1 \\ 4 \end{bmatrix}}_{\text{col 3}} = \underbrace{\begin{bmatrix} 0 \\ -1 \\ 4 \end{bmatrix}}_{b} $$The question: how much of each column do we need to build $b$?
Compare $b$ with the columns: $b = (0, -1, 4)$ is exactly column 3. So we need none of column 1, none of column 2 and one of column 3:
-
What we do Compare $b$ with each column, number by number.
Why If $b$ equals one column, the recipe is "1 of that column, 0 of the rest", with no solving needed.
How Column 3 is $(0, -1, 4)$ and $b$ is $(0, -1, 4)$: top $0 = 0$, middle $-1 = -1$, bottom $4 = 4$.
What we have now Guess: $x = 0$, $y = 0$, $z = 1$.
-
What we do Build $0(\text{col 1}) + 0(\text{col 2}) + 1(\text{col 3})$, row by row.
How Top: $0 \times 2 + 0 \times (-1) + 1 \times 0 = 0 + 0 + 0 = 0$. Middle: $0 \times (-1) + 0 \times 2 + 1 \times (-1) = 0 + 0 - 1 = -1$. Bottom: $0 \times 0 + 0 \times (-3) + 1 \times 4 = 0 + 0 + 4 = 4$.
$$ 0 \begin{bmatrix} 2 \\ -1 \\ 0 \end{bmatrix} + 0 \begin{bmatrix} -1 \\ 2 \\ -3 \end{bmatrix} + 1 \begin{bmatrix} 0 \\ -1 \\ 4 \end{bmatrix} = \begin{bmatrix} 0 + 0 + 0 \\ 0 + 0 - 1 \\ 0 + 0 + 4 \end{bmatrix} = \begin{bmatrix} 0 \\ -1 \\ 4 \end{bmatrix} = b \;✓ $$What we have now $(0, -1, 4) = b$ ✓.
So $(x, y, z) = (0, 0, 1)$: the same answer as 8.1, found in one look.
8.4 Change only the right-hand side
Keep the same $A$, but choose a new $b$ equal to column 1 + column 2:
-
What we do Build the new $b$ = column 1 + column 2.
Why If we build $b$ ourselves from the columns, we already know the recipe.
How Top: $2 + (-1) = 2 - 1 = 1$. Middle: $-1 + 2 = 1$. Bottom: $0 + (-3) = 0 - 3 = -3$.
$$ b = \begin{bmatrix} 2 \\ -1 \\ 0 \end{bmatrix} + \begin{bmatrix} -1 \\ 2 \\ -3 \end{bmatrix} = \begin{bmatrix} 2 - 1 \\ -1 + 2 \\ 0 - 3 \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \\ -3 \end{bmatrix} $$What we have now $b = (1, 1, -3)$, made of one column 1 and one column 2, so the weights are $x = 1$, $y = 1$, $z = 0$.
-
What we do Check in the three original equations (now with right-hand sides $1, 1, -3$).
Check (1) $2x - y = 2 \times 1 - 1 = 2 - 1 = 1$. Should be $1$ ✓.
Check (2) $-x + 2y - z = -1 + 2 \times 1 - 0 = -1 + 2 - 0 = 1$. Should be $1$ ✓.
Check (3) $-3y + 4z = -3 \times 1 + 4 \times 0 = -3 + 0 = -3$. Should be $-3$ ✓.
$$ \begin{aligned} \text{(1)}:&\quad 2(1) - 1 = 1 \;✓ \\ \text{(2)}:&\quad -1 + 2(1) - 0 = 1 \;✓ \\ \text{(3)}:&\quad -3(1) + 4(0) = -3 \;✓ \end{aligned} $$
| What changes when $b$ changes | |
|---|---|
| Row picture | All three planes move (their right-hand sides changed) and now meet at a new point $(1, 1, 0)$. |
| Column picture | The three columns do not move at all. Only the mix changes, from $(0, 0, 1)$ to $(1, 1, 0)$. |
Here $b$ was chosen so the answer could be spotted. In general it cannot be, and substitution gets messy with many unknowns. The systematic method is elimination, covered in Lecture 03.
9. When it goes wrong: singular matrices
Linear combination = scale the columns and add them. "Fill the whole space" = every possible $b$ can be reached. Non-singular (invertible) = a square matrix whose columns reach every $b$, each in exactly one way. Singular = a square matrix whose columns reach only part of the space, because one column is a combination of the others. Plane = a flat sheet. Parallel lines = same direction, never meeting.
Algebra: Can I solve $Ax = b$ for every right-hand side $b$?
Geometry: Do the linear combinations of the columns fill the whole space?
These are the same question: "$Ax = b$ has a solution" means exactly "$b$ is a combination of the columns".
For the 3 × 3 matrix above, the answer is yes. Strang calls it a good matrix: non-singular, or invertible.
What could go wrong?
Suppose the three columns all lie in the same plane. Stretching and adding vectors that lie in a plane can never leave that plane. So every combination stays in it, and any $b$ outside the plane is unreachable.
For example, if column 3 = column 1 + column 2, then column 3 gives nothing new. It points in a direction we could already reach, so three columns do the job of only two.
A square matrix is non-singular (invertible) if its columns fill the whole space, so $Ax = b$ has exactly one solution for every $b$.
It is singular (not invertible) if its columns fill less than the whole space. Then $Ax = b$ has no solution for most $b$.
The three possible outcomes (2 × 2)
- "Singular" does not mean "no solution". A singular system has no solution for most $b$, but infinitely many for the special $b$ that lie in the plane of the columns.
- A linear system can never have exactly two solutions. The only possible counts are 0, 1 or infinitely many.
10. Thinking in $n$ dimensions
Dimension = how many separate directions there are (how many numbers describe a spot). $\mathbb{R}^9$ = all lists of 9 real numbers. Component = one number in a list. Column question = "which mix of the columns gives $b$?". Non-singular = the columns fill the whole space. Flat piece = a line, plane, or its higher-dimensional cousin, through the origin. Unreachable = no combination of the columns lands there.
Now imagine 9 equations in 9 unknowns. There are nine columns, and each is a vector with 9 components, so it lives in 9-dimensional space $\mathbb{R}^9$. Nobody can picture that, but the column question is exactly the same: which combination of the nine columns gives $b$, and do their combinations fill all of $\mathbb{R}^9$?
- A random 9 × 9 matrix is almost certainly non-singular. Its nine columns point in "genuinely different" directions and fill the whole space.
- If the 9th column equals the 8th, it adds nothing new. The combinations then fill only an 8-dimensional flat piece (a "plane") inside 9-dimensional space, and every $b$ outside it is unreachable.
The same pattern holds in every dimension: $n$ columns fill $\mathbb{R}^n$ unless one of them is a combination of the others. You cannot see nine dimensions, but after a while the idea of "$n$ vectors and all their combinations" feels natural. Building that feeling is the central skill of linear algebra.
11. Matrix × vector, two ways
Matrix $A$ = a table of numbers. Vector $x$ = a list of numbers (one per column of $A$). $Ax$ = "matrix times vector", a new list. Column = a top-to-bottom line of $A$. Row = a left-to-right line of $A$. Weights = the entries of $x$, telling how much of each column to take. Dot product = multiply matching entries of two lists, then add. Entry = one number in a matrix or vector. $m \times n$ = $m$ rows, $n$ columns.
The matrix form $Ax = b$ contains a multiplication: a matrix times a vector. Take
$$ A = \begin{bmatrix} 2 & 5 \\ 1 & 3 \end{bmatrix}, \qquad x = \begin{bmatrix} 1 \\ 2 \end{bmatrix}. $$Way 1: by columns (Strang's favourite)
$Ax$ is a combination of the columns of $A$, with the entries of $x$ as the weights:
-
What we do Take $x_1 = 1$ copy of column 1, $(2, 1)$.
Why The first entry of $x$ says how much of the first column to use.
How Top: $1 \times 2 = 2$. Bottom: $1 \times 1 = 1$.
What we have now $(2, 1)$.
-
What we do Take $x_2 = 2$ copies of column 2, $(5, 3)$.
How Top: $2 \times 5 = 10$. Bottom: $2 \times 3 = 6$.
What we have now $(10, 6)$.
-
What we do Add the two pieces, box by box.
How Top: $2 + 10 = 12$. Bottom: $1 + 6 = 7$.
$$ Ax = 1 \begin{bmatrix} 2 \\ 1 \end{bmatrix} + 2 \begin{bmatrix} 5 \\ 3 \end{bmatrix} = \begin{bmatrix} 2 + 10 \\ 1 + 6 \end{bmatrix} = \begin{bmatrix} 12 \\ 7 \end{bmatrix} $$What we have now $Ax = (12, 7)$.
Way 2: by rows (dot products)
Each entry of $Ax$ is one row of $A$ "dotted" with $x$: multiply matching entries and add.
-
What we do Top entry = row 1 $(2, 5)$ dotted with $x = (1, 2)$.
Why Row 1 is equation 1: it tells what the first answer number is made of.
How First with first: $2 \times 1 = 2$. Second with second: $5 \times 2 = 10$. Add: $2 + 10 = 12$.
What we have now Top entry $= 12$.
-
What we do Bottom entry = row 2 $(1, 3)$ dotted with $x = (1, 2)$.
How $1 \times 1 = 1$. $3 \times 2 = 6$. Add: $1 + 6 = 7$.
$$ Ax = \begin{bmatrix} \text{row}_1 \cdot x \\ \text{row}_2 \cdot x \end{bmatrix} = \begin{bmatrix} 2(1) + 5(2) \\ 1(1) + 3(2) \end{bmatrix} = \begin{bmatrix} 12 \\ 7 \end{bmatrix} $$What we have now $Ax = (12, 7)$, the same as Way 1 ✓.
Look at the middle steps: both ways do exactly the same four multiplications ($2 \cdot 1$, $5 \cdot 2$, $1 \cdot 1$, $3 \cdot 2$). They only group them differently, so they must give the same answer.
| By columns | By rows | |
|---|---|---|
| Thinks of $Ax$ as | a combination of columns | a list of dot products |
| Matches | the column picture | the row picture |
| Best for | understanding: what can $Ax$ be? | computing one entry quickly |
$Ax$ is always a combination of the columns of $A$. Solving $Ax = b$ means finding the weights $x_1, \dots, x_n$ that make that combination equal to $b$.
An $m \times n$ matrix times a vector with $n$ entries gives a vector with $m$ entries. The number of columns of $A$ must match the length of $x$, because there must be one weight per column.
The column picture is exactly how a quant thinks about replication:
- Each column of $A$ is the payoff of one asset across the possible future states of the world.
- $x$ is how many units of each asset you hold (the weights).
- $b$ is the payoff you want to build, such as an option.
"Can I solve $Ax = b$ for every $b$?" becomes "Can I replicate every payoff?" If yes, the market is complete. If two assets have proportional payoffs (dependent columns), the extra asset adds nothing new and some payoffs cannot be hedged. That is the singular case. Example 9 in the Examples tab works this out with numbers.
12. Vocabulary and summary
Every word below is a short reminder; section 0 has each one with a tiny example. Linear = unknowns only multiplied by numbers and added. Vector = a list of numbers / an arrow. Linear combination = scale and add. Span = everything reachable by combinations. Singular = columns miss part of the space. Non-singular = columns fill it.
- Linear equation
- Unknowns only multiplied by constants and added. Its graph is a line (2D), plane (3D) or hyperplane.
- Coefficient matrix $A$
- The numbers multiplying the unknowns. Row $i$ is equation $i$, and column $j$ belongs to unknown $j$.
- Vector
- An ordered list of numbers, drawn as an arrow from the origin.
- Linear combination
- $c_1v_1 + \dots + c_nv_n$: scale vectors and add them. The most important operation in the course.
- Span
- The set of all linear combinations of some vectors.
- Row picture
- Each equation is a line or plane, and the solution is where they all meet.
- Column picture
- The solution is the set of weights that combine the columns into $b$.
- Non-singular (invertible)
- The columns fill the whole space, so there is exactly one solution for every $b$.
- Singular
- The columns fill less than the whole space, so there is no solution for most $b$ and infinitely many for the rest.
Key takeaways
- The fundamental problem is to solve $Ax = b$.
- Row picture: each equation is a line or plane, and the solution is the point where all of them meet. It is easy in 2D, hard in 3D and impossible beyond.
- Column picture ★: $Ax = b$ asks which linear combination of the columns equals $b$. It works in every dimension.
- $Ax$ can be computed by columns (a combination of columns) or by rows (dot products). The two ways do the same multiplications, just grouped differently.
- $Ax = b$ is solvable for every $b$ exactly when the columns fill the whole space. Then $A$ is non-singular.
- If one column is a combination of the others, the columns fill only a flat piece of the space, and $A$ is singular.
- A linear system has 0, 1 or infinitely many solutions, never exactly two.
- Coming up: elimination (Lecture 03), the systematic way to find $x$.
Worked examples
Each example is solved step by step. Try it yourself first, then read the solution.
Example 1 (interactive): Options Replication Lab
| Word | In simple words | Example (Nifty) |
|---|---|---|
| Spot | Where Nifty is right now. | Nifty is at 20,000 today. |
| Expiry | The last day of the option. | This Thursday. |
| Strike | The Nifty level written on the option. | 20,000. |
| CE (call) | Pays if Nifty ends above the strike. Pays nothing below. | 20,000 CE: Nifty ends 20,300 → you get 300. Ends 19,800 → you get 0. |
| PE (put) | Pays if Nifty ends below the strike. Pays nothing above. | 20,000 PE: Nifty ends 19,800 → you get 200. Ends 20,300 → you get 0. |
| Future | Pays Nifty's move from the agreed price, up or down (can be a loss). | Bought at 20,000. Ends 20,300 → +300. Ends 19,800 → −200. |
| Bond | Pays the same fixed amount whatever Nifty does. | Pays 100 at every Nifty level. |
| Premium | The price you pay today to buy an option. | The 20,000 CE costs 150 today. |
| IV | How much the market thinks Nifty will jump around. More jumpy = options cost more. | IV 20% gives bigger premiums than IV 12%. |
| Black–Scholes | A formula that gives a fair premium from spot, strike, days left, IV and interest rate. The lab uses it to fill in prices. | Spot 20,000, strike 20,000, 7 days, IV 12% → the lab fills in the premium for you. |
| Payoff | What a product pays at expiry, at each Nifty level. | 20,000 CE at 19,900 / 20,000 / 20,100 pays 0 / 0 / 100. |
| Replicate | Build the client's payoff by mixing products. | 1 CE + 1 PE = a straddle. |
| Elimination | Solve the equations by cancelling one unknown at a time (Lecture 03). | Take row 1 away from row 2 to remove $x$. |
| Pivot | The number used to clear the numbers under it. | The first non-zero number in a row. |
| Multiplier | How many copies of the pivot row to take away. | Remove 6 under pivot 2: $6 \div 2 = 3$ copies. |
| Arbitrage | Free money: two things pay the same tomorrow but cost different today. | Buy the cheap one, sell the dear one, keep the gap. |
1. The agenda: what question are we solving?
A client says: "I want a position that pays me these amounts depending on where Nifty expires." You can only trade what is on the screen: a few CEs, PEs, a future, a bond.
How many lots of each product give exactly the client's payoff at every Nifty level?
This lecture's angle: see the answer. The same question can be drawn two ways (the row picture and the column picture), and the pictures show whether there is one answer, many, or none.
2. The core maths we use (this lecture)
| Maths piece | What it is | In the lab |
|---|---|---|
| Linear equation | numbers × unknowns added up = a target, e.g. $2x + z = 3$ | one equation per Nifty level |
| Row picture | draw each equation on its own: a line (2 unknowns) or a flat sheet (3 unknowns). The answer is where they all meet. | left graph; axes = lots |
| Linear combination | multiply vectors by numbers and add: $x \cdot A + y \cdot B + z \cdot C$ | mixing lots of products |
| Column picture | each column is an arrow; find how much of each arrow walks you to the target | right graph; axes = payoffs |
| Matrix form $Ax = b$ | the same equations packed into one line; $Ax$ = combination of the columns of $A$ | section 3 of the lab output |
| Singular / non-singular | non-singular: exactly one answer; singular: none or infinitely many | the diagnosis in section 4 |
3. How your inputs become maths
| You type | It becomes | Meaning |
|---|---|---|
| 2 or 3 Nifty levels | the rows (equations) | one equation per possible expiry level; 2 levels = 2D pictures, 3 levels = 3D pictures |
| the products (buy/sell CE, PE, future, bond, strike) | the columns (arrows) | column = what 1 lot pays at each level, from $\max(S - K, 0)$ etc., in points ÷ 100 |
| "Client wants" | the right side $b$ (the red target) | the payoff to copy |
| (the answer) | $x, y, z$ | lots of A, B, C (negative = sell) |
| Premiums (typed, or Black–Scholes) | a price for each column | used to price the recipe and check for arbitrage |
| Days-left slider | changes the numbers in $A$ | 0 = payoffs at expiry; more days = value before expiry (payoff + time value) |
4. Walkthrough: the market the lab starts with
A = buy 20,100 PE, B = buy 19,900 CE, C = buy 20,000 PE. The client wants 3 / 2 / 2 (300 / 200 / 200 points) at 19,900 / 20,000 / 20,100.
-
What we do Work out what 1 lot of each product pays at each level.
How A (20,100 PE) at 19,900: $\max(20{,}100 - 19{,}900, 0) = 200$ points → 2. At 20,000: 100 → 1. At 20,100: 0. So A = (2, 1, 0). Same way B (19,900 CE) = (0, 1, 2) and C (20,000 PE) = (1, 0, 0).
-
Rows: one level at a time At 19,900: $2x + 0y + 1z = 3$. At 20,000: $1x + 1y + 0z = 2$. At 20,100: $0x + 2y + 0z = 2$.
In the picture Each equation is one flat sheet in the left graph. Every point on the 19,900 sheet pays exactly 3 at 19,900, but may pay anything at the other levels.
-
Solve The 20,100 row has only $y$: $2y = 2$, so $y = 1$. Put it in the 20,000 row: $x + 1 = 2$, so $x = 1$. Put $x$ in the 19,900 row: $2 + z = 3$, so $z = 1$. (Lecture 03 shows the general method, elimination.)
Row picture check The point $(1, 1, 1)$ sits on all three sheets: $2 + 1 = 3$ ✓, $1 + 1 = 2$ ✓, $2 = 2$ ✓. That's where the sheets meet.
-
Columns: one product at a time $1 \times A + 1 \times B + 1 \times C = (2, 1, 0) + (0, 1, 2) + (1, 0, 0) = (2+0+1,\ 1+1+0,\ 0+2+0) = (3, 2, 2)$ ✓.
In the picture In the right graph: walk along arrow A, then B from its tip, then C, and you land exactly on the red target $(3, 2, 2)$.
-
Matrix form Both views are the same equation:
$$ \underbrace{\begin{bmatrix} 2 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 2 & 0 \end{bmatrix}}_{\text{columns} = A,\,B,\,C} \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} = \begin{bmatrix} 3 \\ 2 \\ 2 \end{bmatrix} $$In trading words Buy 1 lot each of the 20,100 PE, the 19,900 CE and the 20,000 PE.
5. What each output section shows, and what to look for
| Lab section | What it shows | What to identify |
|---|---|---|
| 1. The question | your market and the client's wish, in words | Is this the question you meant? |
| 2. Payoff numbers | every $\max(S-K,0)$ worked out | each product's arrow (its column) |
| 3. The equations | one equation per level, then $Ax = b$ | which number means what: rows = levels, columns = products |
| 4–5. Solving | elimination and back substitution (details in Lecture 03) | the lots, and the diagnosis: one / many / no answer |
| 6. Check | the recipe's payoff at every level | every row ticks ✓ |
| 7. Row and column pictures | sheets meeting; arrows walking to the target | this lecture's main point: see why the answer is what it is |
| 8. Price and arbitrage | cost of the recipe from the premiums | the fair price; any free-money trade |
6. The three pictures you can get
| Row picture | Column picture | Maths | Options meaning | Preset to try |
|---|---|---|---|---|
| sheets meet at one point | arrows point in truly different directions and reach the target | non-singular: one answer | exactly one recipe | Lecture example, butterfly |
| sheets meet along a whole line | arrows lie flat on one sheet, and the target is on that sheet | singular: infinitely many | a product is a copy of others (CE − PE = future). Many recipes, which must cost the same. | Put–call parity |
| sheets never all meet | arrows lie flat, and the target is off their sheet | singular: no answer | the payoff can't be built from these products. The lab shows the closest hedge. | Incomplete market |
7. How this is used with real options
- Every product is an arrow. Its payoff list (one number per Nifty level) is a vector. Seeing products as arrows is the column picture, and it's how quants think about hedging.
- Buildable payoffs = everything the arrows can reach. If your arrows point in as many different directions as there are Nifty levels, any payoff can be built (a complete market). If they lie flat, only payoffs on their sheet can be built.
- Every level must match. The row picture is a risk check: a hedge that works at 19,900 but misses at 20,100 still leaves you exposed. Only the meeting point is a full hedge.
- Price and arbitrage: the recipe's cost is lots × premiums. If two different recipes land on the same target but cost different amounts, there's arbitrage.
- Two levels (2D): start there. Lines instead of sheets, and flat arrows in a plane, make the ideas easy to see before going to 3D.
8. Try it
- Two levels preset: see two lines crossing and two arrows adding up to the target.
- Butterfly preset: three sheets meeting at one point.
- Put–call parity preset: the sheets share a line; the arrows lie flat.
- Incomplete market preset: the target sits off the arrows' sheet.
- Change the "Client wants" numbers and watch the red target and the meeting point move.
Example 2 (2D): Build a payoff from a PE and a PE/CE strategy (row and column pictures)
Nifty will expire at one of two levels: 19,900 or 20,000. Payoffs are in Nifty points ÷ 100.
You can trade two products:
| Product | What it is | Pays at 19,900 | Pays at 20,000 |
|---|---|---|---|
| A | buy 1 × 20,100 PE | $2$ | $1$ |
| B | buy 2 × 20,000 PE, sell 1 × 19,800 CE | $1$ | $-2$ |
A client wants a position that pays 3 if Nifty expires at 19,900 and −1 (a loss of 1) if it expires at 20,000.
How many lots $x$ of A and $y$ of B should you trade? Show the answer as a row picture and a column picture.
(On the board this is: solve $2x + y = 3$, $\ x - 2y = -1$, and find its row picture and column picture.)
PE (put) = pays $\max(K - S, 0)$: money if Nifty $S$ ends below the strike $K$. CE (call) = pays $\max(S - K, 0)$: money if Nifty ends above $K$. Strike = the level written in the option. $\max(a, 0)$ = "$a$ if it is positive, otherwise 0". Lot = one unit traded. Payoff = what a product pays in each scenario. Row = one Nifty level (scenario). Column = one product. $x, y$ = lots of A and B. $b$ = the client's wanted payoff. Row picture = lines of lot choices; column picture = product arrows adding up to the target.
Step 0: where the payoff numbers come from
| Leg | Formula | At 19,900 | At 20,000 |
|---|---|---|---|
| 20,100 PE | $\max(20{,}100 - S, 0)$ | $200 \to 2$ | $100 \to 1$ |
| 20,000 PE | $\max(20{,}000 - S, 0)$ | $100 \to 1$ | $0 \to 0$ |
| 19,800 CE | $\max(S - 19{,}800, 0)$ | $100 \to 1$ | $200 \to 2$ |
A = one 20,100 PE = $(2, 1)$. B = 2 × 20,000 PE − 1 × 19,800 CE = $(2 - 1,\ 0 - 2) = (1, -2)$.
-
What we do Work out A's payoff: one 20,100 PE.
How At 19,900: $20{,}100 - 19{,}900 = 200$, positive, so it pays $200$ points $\to 200 \div 100 = 2$. At 20,000: $20{,}100 - 20{,}000 = 100 \to 1$.
What we have now A $= (2, 1)$.
-
What we do Work out the two legs of B.
How 20,000 PE at 19,900: $20{,}000 - 19{,}900 = 100 \to 1$; at 20,000: $20{,}000 - 20{,}000 = 0 \to 0$. 19,800 CE at 19,900: $19{,}900 - 19{,}800 = 100 \to 1$; at 20,000: $20{,}000 - 19{,}800 = 200 \to 2$.
What we have now 20,000 PE $= (1, 0)$; 19,800 CE $= (1, 2)$.
-
What we do Combine: buy 2 × PE, sell 1 × CE.
Why "Buy" adds the payoff; "sell" means you pay it out, so it is subtracted.
How At 19,900: $2 \times 1 - 1 \times 1 = 2 - 1 = 1$. At 20,000: $2 \times 0 - 1 \times 2 = 0 - 2 = -2$.
What we have now B $= (1, -2)$.
Step 1: turn the question into equations
$x$ lots of A and $y$ lots of B pay $x \times$ (A's payoff) $+ y \times$ (B's payoff). Write one line per expiry level:
$$ \begin{aligned} 2x + y &= 3 &&\text{(Nifty at 19,900)} \\ x - 2y &= -1 &&\text{(Nifty at 20,000)} \end{aligned} $$Which part of the equations means what
$$ \underbrace{\begin{bmatrix} 2 & 1 \\ 1 & -2 \end{bmatrix}}_{A} \underbrace{\begin{bmatrix} x \\ y \end{bmatrix}}_{\text{lots}} = \underbrace{\begin{bmatrix} 3 \\ -1 \end{bmatrix}}_{b\ \text{(target)}} $$| Part | Numbers | Market meaning |
|---|---|---|
| Row 1 of the matrix | $(2, 1)$ | what A and B pay if Nifty expires at 19,900 |
| Row 2 | $(1, -2)$ | what A and B pay if Nifty expires at 20,000 |
| Column 1 (multiplies $x$) | $(2, 1)$ | product A (20,100 PE): its payoff in both scenarios |
| Column 2 (multiplies $y$) | $(1, -2)$ | product B (2 PE − 1 CE): its payoff in both scenarios |
| $x$, $y$ | unknown | number of lots of A and of B to trade |
| right side $b$ | $(3, -1)$ | the payoff the client wants |
- Row picture = read the table one scenario (row) at a time: "at 19,900 my total must be 3", "at 20,000 my total must be −1". Each row is a line of possible $(x, y)$; the answer is where the lines cross.
- Column picture = read the table one product (column) at a time: "how much of A and how much of B, mixed together, gives the target?". This is exactly the replication question a trader asks.
Step 2: solve
-
What we do Get $x$ alone from the 20,000 equation, $x - 2y = -1$.
Why $x$ has no number in front of it there, so it is the easiest letter to free.
How Add $2y$ to both sides: $x - 2y + 2y = -1 + 2y$, so $x = 2y - 1$.
What we have now $x = 2y - 1$.
-
What we do Put $x = 2y - 1$ into the 19,900 equation, $2x + y = 3$.
How, move 1 Replace $x$: $2(2y - 1) + y = 3$.
How, move 2 Open the bracket: $2 \times 2y = 4y$, $2 \times (-1) = -2$. So $4y - 2 + y = 3$.
How, move 3 Collect $y$'s: $4y + y = 5y$. So $5y - 2 = 3$.
How, move 4 Add 2 to both sides: $5y = 3 + 2 = 5$.
How, move 5 Divide by 5: $y = 5 \div 5 = 1$.
$$ \begin{aligned} 2(2y - 1) + y &= 3 &&\text{put } x = 2y - 1 \\ 4y - 2 + y &= 3 &&\text{multiply out} \\ 5y &= 5 &&\text{add 2 to both sides} \\ y &= 1 &&\text{divide by 5} \end{aligned} $$What we have now $y = 1$: 1 lot of B.
-
What we do Put $y = 1$ back into $x = 2y - 1$.
How $2 \times 1 = 2$, then $2 - 1 = 1$.
What we have now $x = 1$: 1 lot of A.
-
What we do Check in the original equations, one Nifty level at a time.
Check 19,900 $2x + y = 2 \times 1 + 1 = 2 + 1 = 3$. Wanted $3$ ✓.
Check 20,000 $x - 2y = 1 - 2 \times 1 = 1 - 2 = -1$. Wanted $-1$ ✓.
In market words 1 lot of A + 1 lot of B:
Nifty expires at 1 × A 1 × B Total Wanted 19,900 $2$ $1$ $3$ $3$ ✓ 20,000 $1$ $-2$ $-1$ $-1$ ✓
Trade 1 lot of A (20,100 PE) and 1 lot of B (2 × 20,000 PE − 1 × 19,800 CE): $x = 1$, $y = 1$.
Step 3: the row picture
Each scenario gives one line of $(x, y)$ choices that hit that scenario's target:
| Line | Two easy points | Meaning |
|---|---|---|
| 19,900: $2x + y = 3$ | $(0, 3)$ and $(1.5, 0)$ | every mix of lots that pays exactly 3 at 19,900 |
| 20,000: $x - 2y = -1$ | $(-1, 0)$ and $(1, 1)$ | every mix of lots that pays exactly −1 at 20,000 |
-
What we do Find two points on the 19,900 line, $2x + y = 3$.
How Put $x = 0$: $0 + y = 3$, so $y = 3$: point $(0, 3)$. Put $y = 0$: $2x = 3$, so $x = 3 \div 2 = 1.5$: point $(1.5, 0)$.
-
What we do Find two points on the 20,000 line, $x - 2y = -1$.
How Put $y = 0$: $x - 0 = -1$, so $x = -1$: point $(-1, 0)$. Put $x = 1$: $1 - 2y = -1$; take 1 from both sides: $-2y = -2$; divide by $-2$: $y = 1$: point $(1, 1)$.
What we have now Two points per line, enough to draw both.
The only mix on both lines is where they cross: $(1, 1)$.
Step 4: the column picture
Now think of each product as an arrow of payoffs (19,900 across, 20,000 up):
$$ x \begin{bmatrix} 2 \\ 1 \end{bmatrix} + y \begin{bmatrix} 1 \\ -2 \end{bmatrix} = \begin{bmatrix} 3 \\ -1 \end{bmatrix} $$Take 1 lot of A (arrow to $(2, 1)$), then add 1 lot of B (arrow of $(1, -2)$) on its tip. You land exactly on the client's target $(3, -1)$.
-
What we do Walk $x = 1$ times along arrow A.
How $1 \times (2, 1) = (1 \times 2,\ 1 \times 1) = (2, 1)$.
What we have now We stand at $(2, 1)$.
-
What we do From there, walk $y = 1$ times along arrow B.
How Across: $2 + 1 = 3$. Up: $1 + (-2) = 1 - 2 = -1$.
What we have now We stand at $(3, -1)$, the client's target ✓.
What each picture is telling you
Both pictures come from the same table:
| Product A | Product B | Client wants | |
|---|---|---|---|
| Nifty at 19,900 | $2$ | $1$ | $3$ |
| Nifty at 20,000 | $1$ | $-2$ | $-1$ |
- Row 19,900: $2x + y = 3$ means "if Nifty ends at 19,900, my lots must add up to 3". Many choices work, e.g. $(0, 3)$, $(1, 1)$, $(1.5, 0)$. They all lie on the blue line.
- Row 20,000: $x - 2y = -1$ means "if Nifty ends at 20,000, my total must be −1". Choices like $(-1, 0)$, $(1, 1)$, $(3, 2)$ lie on the green line.
- You don't know which scenario will happen, so your lots must satisfy both: the point on both lines, where they cross, $(1, 1)$.
Graph axes = number of lots ($x$ across, $y$ up). Each line = "all lot choices that are fine in that scenario".
It tells you: each scenario is a condition; the answer is the lot choice that meets every condition at once.
- Column A = product A as an arrow $(2, 1)$: pays 2 at 19,900 and 1 at 20,000.
- Column B = product B as an arrow $(1, -2)$.
- Target = the client's payoff $(3, -1)$.
- Question: how many of arrow A plus how many of arrow B lands exactly on the target? Walk 1 × A to $(2, 1)$, then 1 × B moves you by $(1, -2)$ to $(3, -1)$ ✓.
Graph axes = payoffs (at 19,900 across, at 20,000 up). Each product = one arrow.
It tells you: the client's payoff is built from the products; $x = 1$, $y = 1$ is the recipe. This is the trader's replication question.
| Row picture | Column picture | |
|---|---|---|
| Reads the table by | scenario (row): 19,900, then 20,000 | product (column): A, then B |
| Graph axes | lots of A, lots of B | payoff at 19,900, payoff at 20,000 |
| Each line / arrow is | one scenario's condition | one product's payoff |
| Answer looks like | where the lines cross: $(1, 1)$ | the lots that make the arrows reach the target: 1 A + 1 B |
| Trader's question | "which lot sizes satisfy each scenario?" | "which mix of products replicates the client's payoff?" |
Same answer both ways: $x = 1$, $y = 1$. The column picture is the one that matters most later: if the product arrows can't reach a target, that payoff can't be replicated (the column space idea, Lecture 07).
Example 3 (3D): the same idea with three expiry levels
Now Nifty can expire at three levels: 19,900, 20,000 or 20,100 (payoffs in points ÷ 100). Three products:
| Product | What it is | 19,900 | 20,000 | 20,100 |
|---|---|---|---|---|
| A | buy 1 × 20,100 PE | $2$ | $1$ | $0$ |
| B | buy 1 × 19,900 CE | $0$ | $1$ | $2$ |
| C | buy 1 × 20,000 PE | $1$ | $0$ | $0$ |
A client wants 3 at 19,900, 2 at 20,000 and 2 at 20,100. How many lots $x, y, z$ of A, B, C? Draw the row picture and the column picture (now in 3D).
PE (put) with strike $K$ = pays $\max(K - S, 0)$, money when Nifty $S$ ends below $K$. CE (call) = pays $\max(S - K, 0)$, money when Nifty ends above $K$. Lot = one unit. $x, y, z$ = lots of A, B, C. Row = one expiry level. Column = one product's payoff at all three levels. Plane = all lot choices $(x, y, z)$ that meet one level's target. Row picture = three planes meeting at one point. Column picture = three payoff arrows chained to reach the target.
Step 0: where the numbers come from
| Option | Formula | 19,900 | 20,000 | 20,100 |
|---|---|---|---|---|
| 20,100 PE | $\max(20{,}100 - S, 0)$ | $200 \to 2$ | $100 \to 1$ | $0$ |
| 19,900 CE | $\max(S - 19{,}900, 0)$ | $0$ | $100 \to 1$ | $200 \to 2$ |
| 20,000 PE | $\max(20{,}000 - S, 0)$ | $100 \to 1$ | $0$ | $0$ |
Step 1: equations, and which part means what
$$ \begin{aligned} 2x + 0y + 1z &= 3 &&\text{(Nifty at 19,900)} \\ 1x + 1y + 0z &= 2 &&\text{(Nifty at 20,000)} \\ 0x + 2y + 0z &= 2 &&\text{(Nifty at 20,100)} \end{aligned} \qquad \underbrace{\begin{bmatrix} 2 & 0 & 1 \\ 1 & 1 & 0 \\ 0 & 2 & 0 \end{bmatrix}}_{\text{col 1 = A, col 2 = B, col 3 = C}} \begin{bmatrix} x \\ y \\ z \end{bmatrix} = \begin{bmatrix} 3 \\ 2 \\ 2 \end{bmatrix} $$| Part | Market meaning |
|---|---|
| each row | one expiry level: what A, B, C pay there |
| each column | one product: its payoff at all three levels |
| $x, y, z$ | lots of A, B, C |
| right side | the client's wanted payoff $(3, 2, 2)$ |
Step 2: solve (easiest row first)
| Row | Equation | Work | Result |
|---|---|---|---|
| 20,100 | $2y = 2$ | divide by 2 | $y = 1$ |
| 20,000 | $x + y = 2$ | $x + 1 = 2$ | $x = 1$ |
| 19,900 | $2x + z = 3$ | $2 + z = 3$ | $z = 1$ |
-
What we do Start with the 20,100 row: $0x + 2y + 0z = 2$, i.e. $2y = 2$.
Why It has only one unknown ($y$), so it can be answered at once.
How "2 times what is 2?" Divide both sides by 2: $y = 2 \div 2 = 1$.
What we have now $y = 1$: 1 lot of B (19,900 CE).
-
What we do Use the 20,000 row: $x + y = 2$.
Why Now that $y$ is known, only $x$ is left in it.
How Put $y = 1$: $x + 1 = 2$. Take 1 from both sides: $x = 2 - 1 = 1$.
What we have now $x = 1$: 1 lot of A (20,100 PE).
-
What we do Use the 19,900 row: $2x + z = 3$.
How Put $x = 1$: $2 \times 1 = 2$, so $2 + z = 3$. Take 2 from both sides: $z = 3 - 2 = 1$.
What we have now $z = 1$: 1 lot of C (20,000 PE).
-
What we do Check every original equation (every Nifty level).
Check 19,900 $2x + 0y + 1z = 2 \times 1 + 0 + 1 \times 1 = 2 + 0 + 1 = 3$. Wanted $3$ ✓.
Check 20,000 $1x + 1y + 0z = 1 + 1 + 0 = 2$. Wanted $2$ ✓.
Check 20,100 $0x + 2y + 0z = 0 + 2 \times 1 + 0 = 2$. Wanted $2$ ✓.
Nifty at 1 A 1 B 1 C Total Wanted 19,900 $2$ $0$ $1$ $3$ $3$ ✓ 20,000 $1$ $1$ $0$ $2$ $2$ ✓ 20,100 $0$ $2$ $0$ $2$ $2$ ✓
Buy 1 lot each of the 20,100 PE, the 19,900 CE and the 20,000 PE: $(x, y, z) = (1, 1, 1)$.
Step 3: row picture in 3D, three planes
With three unknowns, each scenario's equation is a flat plane of $(x, y, z)$ lot choices. The answer is the one point on all three planes.
Step 4: column picture in 3D, three arrows
Each product is an arrow of payoffs (19,900, 20,000, 20,100). Walk 1 × A, then 1 × B, then 1 × C, and you land on the target $(3, 2, 2)$.
-
What we do Walk 1 × A from the origin.
How $(0 + 2,\ 0 + 1,\ 0 + 0) = (2, 1, 0)$.
-
What we do Add 1 × B $= (0, 1, 2)$.
How $(2 + 0,\ 1 + 1,\ 0 + 2) = (2, 2, 2)$.
-
What we do Add 1 × C $= (1, 0, 0)$.
How $(2 + 1,\ 2 + 0,\ 2 + 0) = (3, 2, 2)$.
What we have now The target $(3, 2, 2)$ ✓.
| Example 2 (2D) | Example 3 (3D) | |
|---|---|---|
| Scenarios (rows) | 2 expiry levels | 3 expiry levels |
| Products (columns) | 2 | 3 |
| Row picture | 2 lines crossing at a point | 3 planes meeting at a point |
| Column picture | 2 arrows added to reach the target | 3 arrows added to reach the target |
| Answer | 1 lot of A, 1 lot of B | 1 lot each of A, B, C |
Example 4: Both pictures for one system
Solve and describe the row and column pictures:
$$ x + y = 3, \qquad x - y = 1 $$Matrix form = the system written as $Ax = b$: coefficient table $A$ times unknowns $(x, y)$ equals right-hand side $b$. Row picture = each equation as a line; the answer is where they cross. Column picture = the columns as arrows; the answer is how much of each reaches $b$. Adding two equations = add left sides together and right sides together; the result is still true.
Matrix form. $\begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}\begin{bmatrix} x \\ y \end{bmatrix} = \begin{bmatrix} 3 \\ 1 \end{bmatrix}$
Solve. Adding the two equations gives $2x = 4$, so $x = 2$. Then $y = 3 - 2 = 1$.
-
What we do Add the two equations: $(x + y) + (x - y) = 3 + 1$.
Why One has $+y$, the other $-y$. Added together they cancel, leaving only $x$.
How Left: $x + x = 2x$ and $y - y = 0$, so $2x$. Right: $3 + 1 = 4$. So $2x = 4$.
What we have now $2x = 4$.
-
What we do Solve $2x = 4$.
How Divide both sides by 2: $x = 4 \div 2 = 2$.
What we have now $x = 2$.
-
What we do Put $x = 2$ into $x + y = 3$.
How $2 + y = 3$. Take 2 from both sides: $y = 3 - 2 = 1$.
What we have now $(x, y) = (2, 1)$.
-
What we do Check both original equations.
Check 1 $x + y = 2 + 1 = 3$ ✓.
Check 2 $x - y = 2 - 1 = 1$ ✓.
Row picture. Line $x + y = 3$ passes through $(3,0)$ and $(0,3)$. Line $x - y = 1$ passes through $(1,0)$ and $(0,-1)$. They cross at $(2, 1)$.
Column picture. $$ 2\begin{bmatrix} 1 \\ 1 \end{bmatrix} + 1\begin{bmatrix} 1 \\ -1 \end{bmatrix} = \begin{bmatrix} 3 \\ 1 \end{bmatrix} ✓ $$
-
What we do Build $2(\text{col 1}) + 1(\text{col 2})$, box by box.
How Top: $2 \times 1 + 1 \times 1 = 2 + 1 = 3$. Bottom: $2 \times 1 + 1 \times (-1) = 2 - 1 = 1$.
What we have now $(3, 1) = b$ ✓.
Answer: $(x, y) = (2, 1)$
Example 5: No solution (singular)
Slope = how steep a line is. Intercept = where a line crosses an axis. Parallel = same slope, never meeting. Singular = the columns point along one line, so they can't reach every $b$. Multiple of a vector = that vector times some number. Contradiction = two equations that can't both be true.
-
What we do Divide the second equation, $2x + 2y = 6$, by 2 on both sides.
Why To compare it with the first equation, which has $1x + 1y$.
How $2x \div 2 = x$, $2y \div 2 = y$, $6 \div 2 = 3$. So $x + y = 3$.
What we have now Equation 1 says $x + y = 1$; equation 2 says $x + y = 3$.
-
What we do Ask whether both can be true.
How The same sum $x + y$ can't be $1$ and $3$ at once: $1 \ne 3$.
What we have now No $(x, y)$ works. Check with any try, e.g. $(1, 0)$: equation 1 gives $1 + 0 = 1$ ✓, but equation 2 gives $2 \times 1 + 2 \times 0 = 2 \ne 6$ ✗.
Row picture. Divide the second equation by 2: $x + y = 3$. So the two lines have the same slope but different intercepts. They are parallel and never meet.
Column picture. Column 1 = $(1, 2)$ and column 2 = $(1, 2)$ are the same vector. Every combination $x(1,2) + y(1,2) = (x+y)(1,2)$ lies on one line through the origin. $b = (1, 6)$ is not a multiple of $(1, 2)$, so it cannot be reached.
-
What we do Try to write $b = (1, 6)$ as $c \times (1, 2)$.
Why Every combination of the columns is some number $c = x + y$ times $(1, 2)$.
How Top: $c \times 1 = 1$ forces $c = 1$. Bottom: $c \times 2 = 1 \times 2 = 2$, but $b$ needs $6$. $2 \ne 6$ ✗.
What we have now No $c$ works, so $b$ is off the line of the columns.
Answer: no solution. The matrix is singular.
Example 6: Infinitely many solutions (singular)
Same line = two equations that are copies (one is a number times the other), so they draw one line. Infinitely many solutions = every point on that line works. Singular = the columns point along one line. Column picture = how much of each column arrow reaches $b$.
Row picture. The second equation is just 2 × the first. Both describe the same line, so every point on it is a solution.
-
What we do Multiply the first equation, $x + y = 1$, by 2 on both sides.
How $2 \times x = 2x$, $2 \times y = 2y$, $2 \times 1 = 2$. So $2x + 2y = 2$.
What we have now Exactly equation 2. It adds no new rule.
-
What we do Check three points in both original equations.
Check (1, 0) $1 + 0 = 1$ ✓; $2 \times 1 + 2 \times 0 = 2 + 0 = 2$ ✓.
Check (0, 1) $0 + 1 = 1$ ✓; $2 \times 0 + 2 \times 1 = 0 + 2 = 2$ ✓.
Check (2, −1) $2 + (-1) = 1$ ✓; $2 \times 2 + 2 \times (-1) = 4 - 2 = 2$ ✓.
What we have now Any $(x, y)$ with $x + y = 1$ works: infinitely many.
Column picture. Again both columns are $(1, 2)$. This time $b = (1, 2)$ does lie on that line, so it can be reached, and in many ways:
$$ (x, y) = (1, 0),\; (0, 1),\; (2, -1),\; \dots \quad\text{any } x + y = 1 $$Answer: infinitely many solutions.
Same singular matrix, different $b$. If $b$ lies in the space the columns can reach, there are infinitely many solutions. If it does not, there are none. A singular matrix never gives exactly one solution.
Example 7: Matrix × vector, both ways
By columns = $Ax$ is $x_1$ copies of column 1 plus $x_2$ copies of column 2 plus $x_3$ copies of column 3. By rows = each answer number is one row of $A$ dotted with $x$. Dot product = multiply matching entries, then add. Entry = one number in the matrix or vector.
By columns. $$ 1\begin{bmatrix} 1 \\ 0 \\ 2 \end{bmatrix} - 1\begin{bmatrix} 2 \\ 1 \\ 0 \end{bmatrix} + 2\begin{bmatrix} 0 \\ 3 \\ 1 \end{bmatrix} = \begin{bmatrix} 1 - 2 + 0 \\ 0 - 1 + 6 \\ 2 - 0 + 2 \end{bmatrix} = \begin{bmatrix} -1 \\ 5 \\ 4 \end{bmatrix} $$
-
What we do Take $1$ copy of column 1, $(1, 0, 2)$.
How $(1 \times 1,\ 1 \times 0,\ 1 \times 2) = (1, 0, 2)$.
-
What we do Take $-1$ copy of column 2, $(2, 1, 0)$.
Why The second entry of $x$ is $-1$: use column 2 backwards.
How $(-1 \times 2,\ -1 \times 1,\ -1 \times 0) = (-2, -1, 0)$.
-
What we do Take $2$ copies of column 3, $(0, 3, 1)$.
How $(2 \times 0,\ 2 \times 3,\ 2 \times 1) = (0, 6, 2)$.
-
What we do Add the three pieces, row by row.
How Top: $1 + (-2) + 0 = -1$. Middle: $0 + (-1) + 6 = 5$. Bottom: $2 + 0 + 2 = 4$.
What we have now $Ax = (-1, 5, 4)$.
By rows. $(1,2,0)\cdot(1,-1,2) = -1$, $(0,1,3)\cdot(1,-1,2) = 5$, $(2,0,1)\cdot(1,-1,2) = 4$ ✓
-
What we do Row 1 $(1, 2, 0)$ dotted with $x = (1, -1, 2)$.
How $1 \times 1 = 1$; $2 \times (-1) = -2$; $0 \times 2 = 0$. Add: $1 - 2 + 0 = -1$.
-
What we do Row 2 $(0, 1, 3)$ dotted with $x$.
How $0 \times 1 = 0$; $1 \times (-1) = -1$; $3 \times 2 = 6$. Add: $0 - 1 + 6 = 5$.
-
What we do Row 3 $(2, 0, 1)$ dotted with $x$.
How $2 \times 1 = 2$; $0 \times (-1) = 0$; $1 \times 2 = 2$. Add: $2 + 0 + 2 = 4$.
What we have now $(-1, 5, 4)$, the same as by columns ✓.
Answer: $(-1, 5, 4)$
Example 8: Is $b$ a combination of the columns?
Let $u = (1, 0, 1)$ and $v = (0, 1, 1)$. Is $b$ a combination of $u$ and $v$ when (a) $b = (2, 3, 5)$ and (b) $b = (1, 1, 1)$?
Combination of $u$ and $v$ = $x\,u + y\,v$ for some numbers $x, y$. Component = one number of a vector (top, middle, bottom). Condition = an extra equation that may or may not hold. Span = every combination of $u$ and $v$; here a plane. Plane $z = x + y$ = all points whose third number is the first plus the second.
What the question means. "$b$ is a combination of $u$ and $v$" means we can find two numbers $x$ and $y$ with
$$ x\,u + y\,v = b. $$So we look for $x$ and $y$. If they exist, the answer is yes. If no pair works, the answer is no.
Step 1. Work out $x\,u + y\,v$ in general.
-
What we do Scale $u = (1, 0, 1)$ by $x$.
How $(x \times 1,\ x \times 0,\ x \times 1) = (x, 0, x)$.
-
What we do Scale $v = (0, 1, 1)$ by $y$.
How $(y \times 0,\ y \times 1,\ y \times 1) = (0, y, y)$.
-
What we do Add, component by component.
How Top: $x + 0 = x$. Middle: $0 + y = y$. Bottom: $x + y$.
$$ x \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} + y \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix} = \begin{bmatrix} x \\ 0 \\ x \end{bmatrix} + \begin{bmatrix} 0 \\ y \\ y \end{bmatrix} = \begin{bmatrix} x + 0 \\ 0 + y \\ x + y \end{bmatrix} = \begin{bmatrix} x \\ y \\ x + y \end{bmatrix} $$What we have now Every combination looks like $(x,\ y,\ x + y)$.
Every combination of $u$ and $v$ has this shape: the third component is always the first plus the second.
Step 2. Set it equal to $b = (b_1, b_2, b_3)$. Matching components gives three equations:
$$ \begin{aligned} x &= b_1 &&\text{(top)} \\ y &= b_2 &&\text{(middle)} \\ x + y &= b_3 &&\text{(bottom)} \end{aligned} $$There are 3 equations but only 2 unknowns. The top and middle equations already fix $x$ and $y$. The bottom equation is then an extra condition that may or may not hold.
(a) $b = (2, 3, 5)$
-
What we do Read $x$ from the top equation and $y$ from the middle one.
Why The top says $x = b_1$ and the middle says $y = b_2$: they hand us the answers directly.
How $b_1 = 2$, so $x = 2$. $b_2 = 3$, so $y = 3$.
What we have now $x = 2$, $y = 3$, with no choice left.
-
What we do Test the bottom equation, $x + y = b_3$.
How $2 + 3 = 5$, and $b_3 = 5$. Equal ✓.
$$ \begin{aligned} x &= 2 &&\text{top: } b_1 = 2 \\ y &= 3 &&\text{middle: } b_2 = 3 \\ x + y &= 2 + 3 = 5 &&\text{bottom needs } b_3 = 5 \;✓ \end{aligned} $$What we have now All three equations hold.
-
What we do Check by building $2u + 3v$.
How $2u = (2, 0, 2)$. $3v = (0, 3, 3)$. Add: top $2 + 0 = 2$, middle $0 + 3 = 3$, bottom $2 + 3 = 5$.
$$ 2 \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} + 3 \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix} = \begin{bmatrix} 2 \\ 0 \\ 2 \end{bmatrix} + \begin{bmatrix} 0 \\ 3 \\ 3 \end{bmatrix} = \begin{bmatrix} 2 \\ 3 \\ 5 \end{bmatrix} = b \;✓ $$
(a) Yes: $b = 2u + 3v$.
(b) $b = (1, 1, 1)$
-
What we do Read $x$ and $y$ from the top and middle equations.
How $b_1 = 1$, so $x = 1$. $b_2 = 1$, so $y = 1$.
What we have now $x = 1$, $y = 1$, forced: no freedom left.
-
What we do Test the bottom equation, $x + y = b_3$.
How $1 + 1 = 2$, but $b_3 = 1$, and $2 \ne 1$ ✗.
$$ \begin{aligned} x &= 1 &&\text{top: } b_1 = 1 \\ y &= 1 &&\text{middle: } b_2 = 1 \\ x + y &= 1 + 1 = 2 &&\text{bottom needs } b_3 = 1, \text{ but } 2 \ne 1 \;✗ \end{aligned} $$What we have now The only possible $x, y$ fail the third equation.
-
What we do Build the forced combination $1u + 1v$ to see what it really gives.
How Top: $1 + 0 = 1$. Middle: $0 + 1 = 1$. Bottom: $1 + 1 = 2$.
$$ 1 \begin{bmatrix} 1 \\ 0 \\ 1 \end{bmatrix} + 1 \begin{bmatrix} 0 \\ 1 \\ 1 \end{bmatrix} = \begin{bmatrix} 1 \\ 1 \\ 2 \end{bmatrix} \ne \begin{bmatrix} 1 \\ 1 \\ 1 \end{bmatrix} $$What we have now $(1, 1, 2)$, which misses $b = (1, 1, 1)$ in the bottom number.
It misses $b$ by $1$ in the third component, and no other choice of $x, y$ can fix that.
(b) No: $(1, 1, 1)$ is not a combination of $u$ and $v$.
All combinations have the form $(x,\ y,\ x + y)$, so they all lie on the flat plane $z = x + y$. That plane is the span of $u$ and $v$.
- $(2, 3, 5)$: $2 + 3 = 5$, so it is on the plane and can be reached.
- $(1, 1, 1)$: $1 + 1 = 2 \ne 1$, so it is below the plane (by $1$) and can never be reached.
Two vectors can never fill all of 3D space. Most points in 3D are off their plane.
This is the system $Ax = b$ with the $3 \times 2$ matrix $A = \begin{bmatrix} 1 & 0 \\ 0 & 1 \\ 1 & 1 \end{bmatrix}$ (columns $u$ and $v$). With more equations than unknowns, $Ax = b$ is solvable only for the $b$ that lie in the plane of the columns.
Example 9: Building a payoff from two assets (finance)
You buy assets today. Tomorrow the market goes either up or down, and each asset pays you money depending on which happens.
| Asset | Price today (you pay) | Pays tomorrow if up | Pays tomorrow if down |
|---|---|---|---|
| Bond | $1$ | $1$ | $1$ |
| Stock | $2$ | $3$ | $1$ |
You want to receive $5$ if up and $3$ if down. How many bonds and how many stocks should you buy, and what does it cost today?
Asset = something you can buy (here a bond or a stock). Bond = pays the same amount whatever happens. Stock = pays more if the market goes up, less if down. State = one possible tomorrow (up or down). Price today = what you pay now. Payoff tomorrow = what you receive later, depending on the state. $x$ = number of bonds, $y$ = number of stocks. Column = one asset's payoffs (up on top, down below). Replicate = build the wanted payoff from assets.
A shop sells two kinds of ticket. You buy them today. Tomorrow the weather is either ☀️ sunny or 🌧️ rainy, and each ticket pays you depending on the weather.
| Ticket | You pay today | Pays tomorrow if ☀️ sunny | Pays tomorrow if 🌧️ rainy |
|---|---|---|---|
| Ticket A (safe) | $1$ | $1$ | $1$ |
| Ticket B (risky) | $2$ | $3$ | $1$ |
- Ticket A is boring: pay $1$ today, get $1$ back tomorrow, whatever the weather.
- Ticket B costs $2$ today. It pays a lot ($3$) if sunny but only $1$ if rainy.
Goal: tomorrow you want $5$ if sunny and $3$ if rainy. The answer is to buy 2 of Ticket A and 1 of Ticket B:
| 📅 Today, you pay | Cost |
|---|---|
| 2 × Ticket A | $2 \times 1 = 2$ |
| 1 × Ticket B | $1 \times 2 = 2$ |
| Total paid today | $4$ |
| 📅 Tomorrow, you receive | If ☀️ sunny | If 🌧️ rainy |
|---|---|---|
| 2 × Ticket A | $2 \times 1 = 2$ | $2 \times 1 = 2$ |
| 1 × Ticket B | $1 \times 3 = 3$ | $1 \times 1 = 1$ |
| Total received | $5$ ✓ | $3$ ✓ |
Now replace the words: sunny/rainy = market up/down, Ticket A = bond, Ticket B = stock. That is exactly the problem above. The steps below show how "2 and 1" is found.
Step 1. Write it as columns. Let $x$ = number of bonds and $y$ = number of stocks. Use only what each asset pays tomorrow (up on top, down below). Prices are not needed yet.
$$ x \underbrace{\begin{bmatrix} 1 \\ 1 \end{bmatrix}}_{\text{bond}} + y \underbrace{\begin{bmatrix} 3 \\ 1 \end{bmatrix}}_{\text{stock}} = \underbrace{\begin{bmatrix} 5 \\ 3 \end{bmatrix}}_{\text{what you want}} \begin{matrix} \leftarrow \text{up} \\ \leftarrow \text{down} \end{matrix} $$Step 2. One equation per state.
$$ \begin{aligned} x + 3y &= 5 &&\text{(up)} \\ x + y &= 3 &&\text{(down)} \end{aligned} $$Step 3. Solve. Subtract (down) from (up), and $x$ disappears:
-
What we do Take the (down) equation away from the (up) equation.
Why Both have exactly one $x$. Subtracting makes $x$ vanish, leaving only $y$.
How Left: $(x + 3y) - (x + y) = x - x + 3y - y = 0 + 2y = 2y$. Right: $5 - 3 = 2$.
What we have now $2y = 2$.
-
What we do Solve $2y = 2$.
How Divide both sides by 2: $y = 2 \div 2 = 1$.
$$ \begin{aligned} (x + 3y) - (x + y) &= 5 - 3 \\ 2y &= 2 \\ y &= 1 \end{aligned} $$What we have now $y = 1$: one stock.
-
What we do Put $y = 1$ into (down), $x + y = 3$.
How $x + 1 = 3$. Take 1 from both sides: $x = 3 - 1 = 2$.
$$ \begin{aligned} x + 1 &= 3 \\ x &= 2 \end{aligned} $$What we have now $x = 2$: two bonds.
Step 4. Check what you receive tomorrow (the original equations, state by state).
-
Check up $x + 3y = 2 + 3 \times 1 = 2 + 3 = 5$. Wanted $5$ ✓.
Check down $x + y = 2 + 1 = 3$. Wanted $3$ ✓.
State 2 bonds 1 stock Total Wanted Up $2 \times 1 = 2$ $1 \times 3 = 3$ $5$ $5$ ✓ Down $2 \times 1 = 2$ $1 \times 1 = 1$ $3$ $3$ ✓
Answer: buy 2 bonds and 1 stock.
Step 5. What it costs today. Now use the prices:
-
What we do Price each part with today's prices (bond $1$, stock $2$).
Why What you pay today is price × how many, added up. Tomorrow's payoffs don't enter here.
How 2 bonds: $2 \times 1 = 2$. 1 stock: $1 \times 2 = 2$. Total: $2 + 2 = 4$.
$$ \underbrace{2 \times 1}_{\text{2 bonds}} + \underbrace{1 \times 2}_{\text{1 stock}} = 2 + 2 = 4 $$What we have now The recipe costs $4$ today.
You pay $4$ today, and tomorrow you receive $5$ (if up) or $3$ (if down).
This is the basic idea behind pricing options (Example 10): build the payoff from assets you know, then add up their prices.
| Price today | Payoff tomorrow | |
|---|---|---|
| What it is | What you pay to buy it | What you receive (depends on up/down) |
| Used for | Step 5: the cost | Steps 1–4: how many to buy |
This is the column picture. The assets' payoffs are the columns, the wanted payoff is $b$, and "how many to buy" are the weights $x$ and $y$. Because the bond and the stock point in different directions, any payoff you want can be built this way.
Example 10: Pricing a call option (finance)
Same market as Example 9. Tomorrow is either up or down, and today a bond costs $1$ and a stock costs $2$:
| Asset | Price today | Pays if up | Pays if down |
|---|---|---|---|
| Bond | $1$ | $1$ | $1$ |
| Stock | $2$ | $3$ | $1$ |
A call option with strike $1$ gives you the right (not the obligation) to buy the stock tomorrow for $1$. What is the option worth today?
Call option (like a CE) = the right, but not the duty, to buy something later at a fixed price. Strike = that fixed price (here $1$). Payoff = what the option gives you tomorrow: $\max(\text{stock} - \text{strike}, 0)$. Replicate = build the same payoff from bond and stock. Borrow = a negative number of bonds: get money now, repay it tomorrow. Price today = what the recipe costs now. Arbitrage = risk-free profit if two things that pay the same have different prices.
Step 1. Work out what the option pays tomorrow. You only use the option if the stock is worth more than $1$. Then you gain "stock price $- 1$".
| State | Stock price | Use the option? | Option pays |
|---|---|---|---|
| Up | $3$ | Yes: buy for $1$ something worth $3$ | $3 - 1 = 2$ |
| Down | $1$ | No gain: buy for $1$ something worth $1$ | $0$ |
-
What we do Work out the payoff if the market goes up.
How Stock $= 3$, strike $= 1$. $3 - 1 = 2$, which is more than $0$, so you use the option and gain $\max(2, 0) = 2$.
-
What we do Work out the payoff if the market goes down.
How Stock $= 1$, strike $= 1$. $1 - 1 = 0$, so $\max(0, 0) = 0$: nothing gained.
What we have now The option's payoff vector is $(2, 0)$.
So the option pays $(2, 0)$: $2$ if up, $0$ if down.
Step 2. Build the same payoff from bond and stock (column picture). Find $x$ bonds and $y$ stocks with
$$ x \underbrace{\begin{bmatrix} 1 \\ 1 \end{bmatrix}}_{\text{bond}} + y \underbrace{\begin{bmatrix} 3 \\ 1 \end{bmatrix}}_{\text{stock}} = \underbrace{\begin{bmatrix} 2 \\ 0 \end{bmatrix}}_{\text{option}} \begin{matrix} \leftarrow \text{up} \\ \leftarrow \text{down} \end{matrix} $$Step 3. One equation per state.
$$ \begin{aligned} x + 3y &= 2 &&\text{(up)} \\ x + y &= 0 &&\text{(down)} \end{aligned} $$Step 4. Solve. Subtract (down) from (up):
-
What we do Take (down) away from (up).
Why Each has one $x$, so subtracting removes $x$.
How Left: $(x + 3y) - (x + y) = x - x + 3y - y = 2y$. Right: $2 - 0 = 2$.
What we have now $2y = 2$.
-
What we do Solve $2y = 2$.
How Divide both sides by 2: $y = 1$.
$$ \begin{aligned} (x + 3y) - (x + y) &= 2 - 0 \\ 2y &= 2 \\ y &= 1 \end{aligned} $$What we have now $y = 1$: one stock.
-
What we do Put $y = 1$ into (down), $x + y = 0$.
How $x + 1 = 0$. Take 1 from both sides: $x = 0 - 1 = -1$.
$$ \begin{aligned} x + 1 &= 0 \\ x &= -1 \end{aligned} $$What we have now $x = -1$: minus one bond.
Step 5. Check in the original equations, state by state.
-
Check up $x + 3y = -1 + 3 \times 1 = -1 + 3 = 2$. Option pays $2$ ✓.
Check down $x + y = -1 + 1 = 0$. Option pays $0$ ✓.
State $-1$ bond $1$ stock Total Option pays Up $-1 \times 1 = -1$ $1 \times 3 = 3$ $2$ $2$ ✓ Down $-1 \times 1 = -1$ $1 \times 1 = 1$ $0$ $0$ ✓
Step 6. What $x = -1$ means. A negative number of bonds means you borrow instead of buy: you get $1$ today and must pay back $1$ tomorrow, whatever happens. So the recipe is
Buy 1 stock and borrow 1. This pays exactly the same as the option.
Step 7. Price the option. The recipe costs
-
What we do Add up today's cost of the recipe.
Why Same payoff tomorrow means same price today; otherwise you could buy the cheap one, sell the dear one, and pocket the gap with no risk.
How Borrowing 1 bond: $-1 \times 1 = -1$ (you receive 1). Buying 1 stock: $1 \times 2 = 2$ (you pay 2). Net: $-1 + 2 = 1$.
$$ \underbrace{-1 \times 1}_{\text{borrow 1}} + \underbrace{1 \times 2}_{\text{buy 1 stock}} = -1 + 2 = 1. $$What we have now The recipe costs $1$, so the option is worth $1$.
The option and the recipe pay the same tomorrow in every state, so they must cost the same today.
The option is worth $1$ today.
To price an option: write its payoff as a combination of assets whose prices you know (solve $Ax = b$), then add up the cost of that combination. If the option sold for any other price, you could make risk-free money by buying the cheaper one and selling the dearer one.
Practice problems
Answers are hidden. Click a problem to check your work.
1. In the lecture's 2 × 2 example, which line goes through the origin, and why?
$2x - y = 0$, because its right-hand side is $0$, so $(0,0)$ satisfies it. The line $-x + 2y = 3$ does not, since $(0,0)$ gives $0 \ne 3$.
2. For the lecture's 3 × 3 matrix $A$, solve $Ax = (2, -1, 0)$ without any computation.
$(2, -1, 0)$ is column 1, so $x = (1, 0, 0)$.
3. Columns $(1,0,1)$, $(0,1,1)$, $(1,1,2)$: can their combinations reach every $b$ in 3D?
No. Column 3 = column 1 + column 2, so all three columns lie in one plane. The matrix is singular, and only $b$ in that plane can be reached.
4. Compute $\begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}\begin{bmatrix} 2 \\ -1 \end{bmatrix}$ by columns.
$2(1, 3) - 1(2, 4) = (2 - 2,\; 6 - 4) = (0, 2)$.
-
What we do Take 2 copies of column 1, $(1, 3)$.
How $(2 \times 1,\ 2 \times 3) = (2, 6)$.
-
What we do Take $-1$ copy of column 2, $(2, 4)$.
How $(-1 \times 2,\ -1 \times 4) = (-2, -4)$.
-
What we do Add box by box.
How Top: $2 + (-2) = 0$. Bottom: $6 + (-4) = 2$.
Check by rows Row 1: $1 \times 2 + 2 \times (-1) = 2 - 2 = 0$ ✓. Row 2: $3 \times 2 + 4 \times (-1) = 6 - 4 = 2$ ✓.
5. For which $c$ is $\begin{bmatrix} 1 & 2 \\ 3 & c \end{bmatrix}$ singular?
It is singular when column 2 is a multiple of column 1: $(2, c) = 2(1, 3)$, so $c = 6$.
6. Write $3x - y = 5,\; x + 4y = 6$ in column form and solve it.
$x(3, 1) + y(-1, 4) = (5, 6)$. From the second equation $x = 6 - 4y$. Substituting gives $18 - 13y = 5$, so $y = 1$ and $x = 2$. Check: $2(3,1) + 1(-1,4) = (5, 6)$ ✓.
-
What we do Get $x$ alone from $x + 4y = 6$.
How Take $4y$ from both sides: $x = 6 - 4y$.
-
What we do Put it into $3x - y = 5$.
How, move 1 $3(6 - 4y) - y = 5$.
How, move 2 Open the bracket: $3 \times 6 = 18$, $3 \times (-4y) = -12y$. So $18 - 12y - y = 5$.
How, move 3 $-12y - y = -13y$: $18 - 13y = 5$.
How, move 4 Take 18 from both sides: $-13y = 5 - 18 = -13$.
How, move 5 Divide by $-13$: $y = 1$.
-
What we do Put $y = 1$ into $x = 6 - 4y$.
How $4 \times 1 = 4$, then $6 - 4 = 2$. So $x = 2$.
-
Check $3x - y = 6 - 1 = 5$ ✓. $x + 4y = 2 + 4 = 6$ ✓.