Math for economyMM1005

How to find your way

  1. 1Search for the word that confuses you — the box at the top searches the whole course.
  2. 2Look it up in Concepts. Every concept links to the section that explains it. Concepts →
  3. 3Read the Watch out and Common error boxes: they show the mistakes that are actually made.
  4. 4Still stuck? Bring the question to the exercise session or send an email.

Lecturer: Eric Ahlqvist, eric.ahlqvist@math.su.se · Put “MM1005” in the subject line.

← 14
Lecture 15 One array, four questions
15 Matrices

One array, four questions

Does a linear system have exactly one solution? What are its solutions? How many are there? What is the inverse of its matrix? These look like four topics. This last lecture shows that they are one procedure, asked four ways.

Three lectures built one object. A system of $m$ equations in $n$ unknowns became $\mathbf{A}\mathbf{x}=\mathbf{b}$ (Lecture 12); the pair $(\mathbf{A}\mid\mathbf{b})$ became an array on which three reversible operations act (Lecture 13); and a single number computed from $\mathbf{A}$ turned out to decide what those operations would find (Lecture 14).

This lecture puts the three together, and the arrangement is worth stating plainly because it is easy to leave the block believing it contains four unrelated techniques. It contains one technique. What changes is what stands to the right of the rule.

right of the rulequestion answeredwhere
$\mathbf{b}$solve $\mathbf{A}\mathbf{x}=\mathbf{b}$Method 13.16
$\mathbf{b}$, then read the staircasehow many solutionsFact 13.20
$\mathbf{I}$find $\mathbf{A}^{-1}$Method 15.3 below
— (compute $|\mathbf{A}|$ first)which of the three to expectFact 14.26

Only the third line is new, and it is new only in the sense that nobody has yet written $\mathbf{I}$ in that position. The operations are Definition 13.13, unchanged.

The last section, The course on one page, is a map of all fifteen lectures, with a link to every one.

⏱ 55 min read§ 6 sections

After this lecture you can

  • reduce an augmented array with the three row operations, naming each one, and say why a column may never be moved
  • read a finished staircase: the verdict none, one or infinitely many, and all the solutions, with one free parameter for each column of an unknown that has no leading entry
  • find the inverse of a $3\times3$ matrix by reducing $(\mathbf{A}\mid\mathbf{I}),$ check it with one product, and recognise a singular matrix by a zero row in the left block
  • solve several systems with the same coefficient matrix in one reduction, and say what the inverse is for
  • choose the tool for each of the four questions: the determinant predicts, elimination decides, and the inverse comes from the order-2 formula or from Method 15.3
  • find the lecture, the box and the section behind each step of an exam problem with the course map
1

The method, and where the marks go

Swapping two rows of $(\mathbf{A}\mid\mathbf{b})$ is allowed. Swapping two columns can be undone just as easily. Is it allowed too?

Nothing is restated here that Method 13.16 does not already say. Two remarks only, both about places where a correct method still loses marks.

The three operations of Lecture 13, each reversible — which is why the solution set survives them. Multiplying a row by $0$ is the one move that cannot be undone, and so it is not allowed.
Recap The three operations, from Lecture 13

This box restates Lecture 13; nothing in it is new. The elementary row operations on an array (Definition 13.13) are:

  1. interchange two rows;
  2. multiply a row by a number $\alpha\ne0;$
  3. add a multiple of one row to a different row.

Each can be undone by another operation of the same kind, so none of them changes the solution set (Fact 13.14). Gaussian elimination (Method 13.16) uses them to bring the augmented array to a staircase, and then, if you like, clears the entries above each leading entry.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

Which of these is not an elementary row operation on $(\mathbf{A} \mid \mathbf{b})$?

Try it yourself

Elimination, one row operation at a time

The three settings are Example 13.17, Example 13.18 and Watch out 13.19 of Lecture 13: one system with exactly one solution, and two systems with the same left-hand side that differ in one number of $\mathbf{b}.$

  1. Press Run it for the first setting. Every operation named above the array is one of the three, and nothing else ever happens.
  2. Press the setting button until it says infinitely many, then Next operation step by step. The last row becomes $(0\;0\;0\mid0).$
  3. Switch to no solution. The operations are the same, one by one; only the last entry differs, and the last row now reads $0=3.$ Whether solutions exist depended on $\mathbf{b}.$
Example

Same $\mathbf{A},$ two right-hand sides

This example is the app's (the lecture's first board problem). Solve $$ \begin{aligned} x_1 + 2x_2 - x_3 &= 1\\ 2x_1 + 3x_2 + x_3 &= 4\\ 3x_1 + 5x_2 \phantom{{}+ x_3} &= c \end{aligned} $$ for $c=5.$ Then change one number, $c=6,$ and solve it again.

Try it yourself first. Then open one step at a time.

2

Reading the finished array

Five unknowns, three leading entries, no contradiction. How many solutions — and is a blank column a zero?

This lead is the app's; it restates Fact 13.20 of Lecture 13. When elimination stops, the array is a staircase, and it is read in two passes. First the verdict: a row $(0\;\cdots\;0\mid c)$ with $c\ne0$ means no solution; otherwise a leading entry in every unknown's column means exactly one; otherwise infinitely many. Then, if there are solutions, every unknown whose column carries no leading entry is free, and the others are written in terms of the free ones. The column to the right of the rule is not an unknown and is never counted.

The same left-hand side, two right-hand sides. Left, the last row reads $0=0{:}$ infinitely many solutions, with $x_3$ free. Right, it reads $0=3{:}$ none. Whether solutions exist depends on $\mathbf{b}.$

Guess first. Before you read the Watch out below, decide what the array in the next question says about $x_3$ and $x_5.$

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

A system in five unknowns eliminates to $$\left(\begin{array}{ccccc|c} 1 & 0 & -2 & 0 & 3 & 4\\ 0 & 1 & 5 & 0 & -1 & 2\\ 0 & 0 & 0 & 1 & 2 & 7 \end{array}\right)$$

How many solutions?

Example

A free unknown in the middle

This example is the app's. Elimination on a system in the four unknowns $x_1,$ $x_2,$ $x_3,$ $x_4$ ends with $$ \left(\begin{array}{cccc|c} 1 & 0 & 2 & 0 & 3\\ 0 & 1 & -1 & 0 & 1\\ 0 & 0 & 0 & 1 & 2 \end{array}\right). $$ Find all solutions.

Try it yourself first. Then open one step at a time.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

Elimination on a system of three equations in four unknowns ends with no row $(0\;\cdots\;0\mid c)$ with $c\ne0.$ How many solutions does the system have?

3

Finding the inverse by row operations

Lecture 14 inverted a $2\times2$ matrix with a formula. How do you invert a $3\times3$ one — without any new formula?

Lecture 14 produced $\mathbf{A}^{-1}$ for order $2$ and for no other order. The gap closes with no new machinery at all.

Suppose $\mathbf{A}$ is $n\times n$ with $|\mathbf{A}|\ne0$, and we want the matrix $\mathbf{X}$ with $\mathbf{A}\mathbf{X}=\mathbf{I}$. Writing $\mathbf{x}_{j}$ for the $j$th column of $\mathbf{X}$ and $\mathbf{e}_{j}$ for the $j$th column of $\mathbf{I}$, the single matrix equation $\mathbf{A}\mathbf{X}=\mathbf{I}$ is the $n$ separate systems $$ \begin{aligned} &\mathbf{A}\mathbf{x}_{1}=\mathbf{e}_{1},\qquad \mathbf{A}\mathbf{x}_{2}=\mathbf{e}_{2},\\ &\dots,\qquad \mathbf{A}\mathbf{x}_{n}=\mathbf{e}_{n}\,, \end{aligned} $$ all with the same coefficient matrix. Solving them one at a time would repeat the same row operations $n$ times, since the operations depend on $\mathbf{A}$ alone and not on the right-hand side. So do them at once: carry all $n$ right-hand sides along in the same array.

Note what the method does not require: the determinant is never computed, and nothing is ever divided by $|\mathbf{A}|$. Singularity is not tested for in advance — it announces itself, as a row of zeros, at the moment it becomes relevant.

Example 15.4

Inverting a $3\times3$ matrix

Find the inverse of $\mathbf{A}=\begin{pmatrix} 1 & 3 & 3\\ 1 & 3 & 4\\ 1 & 4 & 3\end{pmatrix}$.

Try it yourself first. Then open one step at a time.

Example 15.4 in three arrays: the identity starts on the right and ends on the left, and what it leaves behind on the right is $\mathbf{A}^{-1}.$ (The entries are small on a phone; they are the arrays of the example above.)

Guess first. The method has a fourth step. Before you read the next example, decide what a row of zeros in the left block tells you.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

$\mathbf{A}$ is $3 \times 3$. You reduce $(\mathbf{A} \mid \mathbf{I})$ and a row of the left block becomes all zeros.

What follows?

Example 15.5

The method failing

Take $\mathbf{A}=\begin{pmatrix} 1 & 2 & -1\\ 2 & 3 & 1\\ 3 & 5 & 0\end{pmatrix}$, whose third row is the sum of the first two.

Try it yourself first. Then open one step at a time.

Try it yourself

$(\mathbf{A}\mid\mathbf{I}),$ one row operation at a time

The same procedure as the first animation, on an array twice as wide. The two settings are Example 15.4 and Example 15.5.

  1. Run it on the first setting and watch the labels above the blocks: at the last operation the identity that started on the right has arrived on the left, and the right block is $\mathbf{A}^{-1}.$
  2. Press Matrix: invertible to switch to the singular matrix, then Next operation step by step. A row of the left block becomes zero and the run stops. Look at the right block at that moment: it is full of numbers, and none of them is an answer.
Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

For $\mathbf{A}=\begin{pmatrix}1&2\\3&7\end{pmatrix}$ one operation, $R_2-3R_1,$ turns $(\mathbf{A}\mid\mathbf{I})$ into $$ \left(\begin{array}{cc|cc} 1 & 2 & 1 & 0\\ 0 & 1 & -3 & 1 \end{array}\right). $$ What is $\mathbf{A}^{-1}$?

4

Many right-hand sides at once

Four systems share one coefficient matrix and differ only in $\mathbf{b}.$ Must you eliminate four times?

The same idea answers a question that has nothing to do with inverses. Suppose $p$ systems share one coefficient matrix, $$ \begin{aligned} &\mathbf{A}\mathbf{x}=\mathbf{b}^{1},\quad \mathbf{A}\mathbf{x}=\mathbf{b}^{2},\\ &\dots,\quad \mathbf{A}\mathbf{x}=\mathbf{b}^{p}\,. \end{aligned} $$ The row operations are dictated by $\mathbf{A}$, so they are the same $p$ times over. Reducing $(\mathbf{A}\mid\mathbf{b}^{1}\;\mathbf{b}^{2}\;\cdots\;\mathbf{b}^{p})$ once solves all $p$ together, one column of answers each. Method 15.3 is the special case $\mathbf{b}^{j}=\mathbf{e}_{j}$.

This is also the honest argument for the inverse, first made in Example 14.25: $\mathbf{A}^{-1}$ is not a fast way to solve one system — it is what one computes when the same $\mathbf{A}$ is to be used again.

Example

Two systems, one reduction

This example is the app's. Solve $\mathbf{A}\mathbf{x}=\mathbf{b}^{1}$ and $\mathbf{A}\mathbf{x}=\mathbf{b}^{2}$ for $$ \begin{aligned} &\mathbf{A}=\begin{pmatrix}1&1&0\\1&2&1\\0&1&2\end{pmatrix},\\ &\mathbf{b}^{1}=\begin{pmatrix}2\\4\\3\end{pmatrix},\quad \mathbf{b}^{2}=\begin{pmatrix}1\\3\\4\end{pmatrix}. \end{aligned} $$

Try it yourself first. Then open one step at a time.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

One $3 \times 3$ matrix $\mathbf{A}$ with $|\mathbf{A}| \ne 0$, and four different right-hand sides.

Which is least work?

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

For a $3\times3$ matrix $\mathbf{A}$ you reduce $(\mathbf{A}\mid\mathbf{b}^{1}\;\mathbf{b}^{2}\;\mathbf{b}^{3})$ and reach $(\mathbf{I}\mid\mathbf{C}),$ where $\mathbf{C}$ is $3\times3.$ Where is the solution of $\mathbf{A}\mathbf{x}=\mathbf{b}^{2}$?

5

Which tool for which question

$|\mathbf{A}|=0,$ and you still need the solutions. Is the system without solutions, and if not, what do you do?

Lecture 14's four equivalent statements for a square $\mathbf{A}$ (Fact 14.26). All four can be checked before any elimination. Negated, they say not exactly one — never none.
Fact 15.7The four questions, and their answers#

Let $\mathbf{A}$ be $n\times n$.

  • Has $\mathbf{A}\mathbf{x}=\mathbf{b}$ exactly one solution? Compute $|\mathbf{A}|$. Non-zero: yes, for every $\mathbf{b}$. Zero: not for any $\mathbf{b}$ — and the determinant says nothing further.
  • What are the solutions? Eliminate. This works whatever $|\mathbf{A}|$ is, and whether or not the system is square.
  • How many are there, when $|\mathbf{A}|=0$? Eliminate and read the last row: $(0\;\cdots\;0\mid 0)$ gives infinitely many, $(0\;\cdots\;0\mid c)$ with $c\ne0$ gives none.
  • What is $\mathbf{A}^{-1}$? Order $2$: the formula of Fact 14.20. Any order: Method 15.3.

Guess first. Before you read the Watch out below, answer the question the hook asked.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

A square system has $|\mathbf{A}| = 0$, and you still need its solutions.

What do you do?

Example

One matrix, four questions

This example is the app's. Let $$ \mathbf{A}=\begin{pmatrix}1&1&0\\1&2&1\\0&1&k\end{pmatrix}. $$ (a) For which $k$ has $\mathbf{A}\mathbf{x}=\mathbf{b}$ exactly one solution for every $\mathbf{b}$?

(b) For $k=1,$ solve the system with $\mathbf{b}=(1,2,1),$ and with $\mathbf{b}=(1,2,2).$

(c) For $k=2,$ find $\mathbf{A}^{-1}.$

Try it yourself first. Then open one step at a time.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

A square system $\mathbf{A}\mathbf{x}=\mathbf{0}$ — every right-hand side zero — has $|\mathbf{A}|=0.$ How many solutions does it have?

6

The course on one page

Fifteen lectures, seven exam problems. Where does each step of a problem live?

One variable

Series and two variables

Optimisation

Matrices

An exam problem is a chain of such steps, and the chain crosses the map. The question below is about the chain in the linear-algebra problem of the exam.

Check yourself

Pick an answer before reading on. Getting it wrong is fine — that is how you find out what you believe.

The exam's linear-algebra problem has the form: compute $|\mathbf{A}|$ for a $3\times3$ matrix with a parameter $a,$ decide for which $a$ the system has exactly one solution, and solve it for each remaining $a.$ Which lectures does a complete solution draw on?

What you should take away

  • The block is one procedure applied to one object. Row operations on $(\mathbf{A}\mid\;\cdot\;)$; what stands right of the rule decides the question.
  • Row operations act on rows. Column interchanges are not among them: they rename the unknowns.
  • A column with no leading entry is a free unknown, not a zero one.
  • The inverse by row operations: reduce $(\mathbf{A}\mid\mathbf{I}_{n})$; if the left block becomes $\mathbf{I}_{n}$, the right block is $\mathbf{A}^{-1}$; if a row of the left block becomes zero, $\mathbf{A}$ is singular. The determinant is never used, and never divided by.
  • The answer is the right block, and only after the left block is exactly $\mathbf{I}$ — clearing above the leading entries is optional when solving a system and compulsory here.
  • $p$ systems sharing a coefficient matrix are solved in one reduction of $(\mathbf{A}\mid\mathbf{b}^{1}\cdots\mathbf{b}^{p})$. The inverse is the case $\mathbf{b}^{j}=\mathbf{e}_{j}$, and this is what $\mathbf{A}^{-1}$ is actually for.
  • $|\mathbf{A}|$ predicts; elimination decides. When $|\mathbf{A}|=0$ the determinant has said all it can, and the last row of the eliminated array says the rest.

Think further

Questions without computation. Think on your own or with a classmate before opening the thought.

  1. Discussion question 1 — counting degrees of freedom

    A system in five unknowns eliminates to a staircase with leading entries in columns $1$, $2$ and $4$, and no inconsistent row. How many degrees of freedom?

    One way to think about it

    Two. There is no inconsistent row, so there are solutions. The columns of the unknowns without a leading entry are $3$ and $5,$ so $x_3$ and $x_5$ are free, and the other three unknowns are written in terms of them: five unknowns minus three leading entries. The column after the rule is not an unknown and is not counted, and neither free unknown is zero (Watch out 15.2).

  2. Discussion question 2 — reversible is not enough

    Why is interchanging two columns of $(\mathbf{A}\mid\mathbf{b})$ not an elementary row operation, given that it can be undone?

    One way to think about it

    Because the row operations are licensed by more than reversibility. Each of them replaces the equations by equations in the same unknowns with the same solutions, so the array still stands for the system one started with (Fact 13.14). A column records which unknown its coefficients belong to; swapping two columns of $\mathbf{A}$ gives the system with those two unknowns renamed. Its solutions are the old ones with two coordinates exchanged — $(1,2,3)$ becomes $(3,2,1)$ when columns $1$ and $3$ change places — so the solution set has changed unless you remember to swap back (Watch out 15.1). Swapping a column of $\mathbf{A}$ with $\mathbf{b}$ is worse: $\mathbf{b}$ is not an unknown at all, and the new array stands for an unrelated system.

  3. Discussion question 3 — a zero row in the left block

    You reduce $(\mathbf{A}\mid\mathbf{I})$ and the left block acquires a row of zeros. What have you learned, and what should you do next?

    One way to think about it

    That $\mathbf{A}$ is singular: it has no inverse, and $|\mathbf{A}|=0$ (Method 15.3, step 4). The left block can never reach $\mathbf{I},$ so stop; the right block means nothing (Example 15.5). If the inverse was wanted to solve $\mathbf{A}\mathbf{x}=\mathbf{b},$ go back to $(\mathbf{A}\mid\mathbf{b})$ and eliminate: the last row decides between infinitely many solutions and none (Fact 15.7, Watch out 15.8). A singular $\mathbf{A}$ is not the end of the system, only of its inverse.

  4. Discussion question 4 — the least work for four systems

    Four systems share one $3\times3$ coefficient matrix with $|\mathbf{A}|\ne0$ and differ only in $\mathbf{b}$. Which of the following is least work?

    (A) Cramer's rule on each: sixteen determinants of order $3$;

    (B) Gaussian elimination on each of the four arrays, from the beginning;

    (C) computing $|\mathbf{A}|$, which determines all four solutions;

    (D) one reduction of $(\mathbf{A}\mid\mathbf{b}^{1}\,\mathbf{b}^{2}\,\mathbf{b}^{3}\,\mathbf{b}^{4})$.

    One way to think about it

    (D). The row operations are chosen by $\mathbf{A}$ alone, so one reduction of the wide array does what (B) does four times, and gives the four solutions as four columns. (A) is correct but the most expensive route: one determinant for $|\mathbf{A}|$ and three more for each system, sixteen of order $3.$ (C) is not a method at all: $|\mathbf{A}|\ne0$ promises that each system has exactly one solution and produces none of them. Writing $\mathbf{I}$ in place of the four $\mathbf{b}$'s would cost the same as (D) and give $\mathbf{A}^{-1},$ which also serves a fifth right-hand side.