16.8  How Wrong Can the Answer Be

Chapter 3 solved Ax=b and Chapter 11 solved it when it had no solution. Neither chapter could ask the question a user of either method asks first: the vector b is a measurement, so it is wrong in the last few digits, and the answer x is then wrong too — by how much? The question needs a way to compare the size of an error with the size of the thing it corrupts, and that is what the last seven sections have built.

The answer turns out to be one number attached to A, independent of b, and it is the last object this chapter defines. It also carries a warning, and the warning is more useful than the number.

Throughout, matrices are complex, as in Sections 4 to 7, and ‖⋅‖ is a norm on Cn together with the operator norm it induces on Mn(C) (Definition 16.3.2) — the standing convention of Section 5, whose results are used here throughout. A real matrix is read inside Mn(C), which changes none of the three norms we actually compute with, since Theorem 16.3.3 gives the same three formulas over either field.

16.8.1. A recurring product

Let A∈Mn(C) be invertible, let b≠0, and let x solve Ax=b. Suppose the data arrives as b+Δb instead, so the computed answer solves Ax~=b+Δb. Subtracting the two equations, A(x~−x)=Δb, so x~−x=A−1Δb,‖x~−x‖≤‖A−1‖‖Δb‖ by Theorem 16.3.2 (a). That is an absolute bound, and absolute bounds are the wrong currency: whether an error of 10−3 is a catastrophe depends on whether the answer is of size 1 or of size 106. Divide by ‖x‖, and use ‖b‖=‖Ax‖≤‖A‖‖x‖, that is 1/‖x‖≤‖A‖/‖b‖: ‖x~−x‖‖x‖≤‖A−1‖‖Δb‖‖A‖‖b‖=‖A‖‖A−1‖‖Δb‖‖b‖. The relative error in the answer is at most the relative error in the data, multiplied by ‖A‖‖A−1‖. That product depends only on A. It will reappear in every estimate in this section, so we name it.

The condition number is the worst factor by which A can magnify a relative error.

Definition 16.8.1 (Condition Number)

Let ‖⋅‖ be a norm on Cn, and write ‖⋅‖ also for the operator norm it induces on Mn(C). For A∈Mn(C), the condition number of A with respect to that norm is κ(A):={‖A‖‖A−1‖if A is invertible,∞if A is singular. We write κ1,κ2,κ∞ for the condition numbers with respect to ‖⋅‖1, ‖⋅‖2, ‖⋅‖∞; κ2 is also called the spectral condition number. For a rectangular A∈Mm×n(C) with m≥n and rankA=n, we define κ2(A):=σ1(A)σn(A), the ratio of the largest to the smallest singular value (Definition 13.8.1).

Clause by clause. The number is attached to A and to a norm: κ1(A), κ2(A) and κ∞(A) are three different numbers, and a statement like “κ(A)=400” is incomplete until the norm is named. They cannot disagree wildly — Theorem 16.2.2 traps them within dimension-dependent factors of each other, and Exercise (C1: Changing the norm changes κ, but not much) makes that precise — so the order of magnitude of κ, which is all anyone uses, does not depend on the choice. The value ∞ for a singular matrix is a convention, and the right one: a singular A either makes Ax=b unsolvable or makes its solution set a whole coset x+nul(A) with nul(A)≠{0} (Theorem 3.1.3), so no finite bound on the error can hold. Finally, the square case and the rectangular case agree where they overlap: Proposition 16.8.2 (d) shows κ2(A)=σ1/σn for an invertible square A as well.

Before the examples, a small lemma that says what κ is measuring. It is the one geometric picture in this section, and it is worth carrying.

Lemma 16.8.1 (The Inverse Measures the Smallest Stretch)

Let A∈Mn(C) be invertible and let ‖⋅‖ be a norm on Cn. Then ‖A−1‖=1min{‖Ax‖:‖x‖=1},κ(A)=max{‖Ax‖:‖x‖=1}min{‖Ax‖:‖x‖=1}.

Idea. Both maxima and the minimum exist by compactness, which is Lemma 16.3.1 and the same argument with a minimum. After that it is one substitution: as x runs over the non-zero vectors so does y=Ax, and the ratio ‖A−1y‖/‖y‖ is the reciprocal of ‖Ax‖/‖x‖.

Proof. The function x↦‖Ax‖ is continuous on the unit sphere S, which is compact, so it attains a maximum and a minimum there (Lemma 16.3.1 for the maximum; the same proof, or the extreme value theorem (A4) applied to the same continuous function, for the minimum). Write m=minx∈S‖Ax‖. Since A is invertible, Ax≠0 for x∈S, so m>0.

By Definition 16.3.2 and homogeneity, ‖A−1‖=max{‖A−1y‖/‖y‖:y≠0}. The map y↦A−1y is a bijection of Cn∖{0} onto itself, so substituting y=Ax with x≠0, ‖A−1‖=maxx≠0‖x‖‖Ax‖=1minx≠0‖Ax‖‖x‖=1m, the last step by homogeneity again, which lets the minimum over x≠0 be taken over S. Multiplying by ‖A‖=maxx∈S‖Ax‖ gives the second formula. This proves the lemma.

So κ(A) is the distortion of A: feed A the unit sphere and it comes out as a lopsided surface, and κ is the ratio of its longest radius to its shortest. A matrix with κ=1 carries the sphere to a sphere. A matrix with κ=106 flattens it into something a million times longer than it is wide, and a direction of b that lands along the short axis has its errors magnified by a million on the way back.

Some values, simplest first.

  • The identity, and any unitary matrix. ‖I‖=1=‖I−1‖, so κ(I)=1 in every norm. For unitary U, ‖Ux‖2=‖x‖2 for every x (Theorem 11.7.3), so every stretch is 1 and κ2(U)=1 by Lemma 16.8.1. These are the best-conditioned matrices there are.
  • A diagonal matrix. For D=diag(d1,…,dn) with all di≠0, ‖D‖2=maxi|di| and ‖D−1‖2=1/mini|di|, so κ2(D) is the ratio of the largest to the smallest modulus. Thus κ2(diag(1,10−6))=106.
  • A small matrix that is perfectly conditioned. A=10−6I has ‖A‖2=10−6, a tiny norm, and κ2(A)=1. Being small and being ill-conditioned are unrelated.
  • A singular matrix, the degenerate case: κ=∞ by convention, consistent with Lemma 16.8.1, where the minimum stretch is 0.
Example (Three condition numbers of one matrix)

Compute κ∞(A) and κ2(A) for A=(2111).

Solution. detA=1, so A−1=(1−1−12). The largest absolute row sums are 3 for A and 3 for A−1, so by Theorem 16.3.3 (b), κ∞(A)=3⋅3=9.

For κ2: A is real symmetric with trA=3 and detA=1, so its eigenvalues are (3±5)/2, both positive, and the singular values of a symmetric matrix with positive eigenvalues are those eigenvalues (its A∗A=A2 has eigenvalues their squares). Hence κ2(A)=3+53−5=(3+5)24=7+352≈6.854. Two different norms, two different numbers, the same order of magnitude — which is the general picture.

Warning. A large κ is not a large determinant defect, and a small determinant is not ill-conditioning. The matrix 10−6I10 has determinant 10−60 and κ2=1; the matrix diag(106,10−6) has determinant 1 and κ2=1012. The determinant scales with cn under A↦cA while κ does not move at all (Proposition 16.8.2 (b)), so no threshold on |detA| can detect ill-conditioning. This is the most common wrong test, and it fails in both directions.

The basic properties are all one line each, and the third is the reason κ behaves well under the factorizations of Chapters 11 and 13.

Proposition 16.8.2 (Properties of the Condition Number)

Let A,B∈Mn(C) be invertible and let c∈C∖{0}. With respect to any operator norm:

  • (a) κ(A)≥1;
  • (b) κ(cA)=κ(A);
  • (c) κ(AB)≤κ(A)κ(B);
  • (d) κ2(A)=σ1(A)/σn(A), and κ2(UAV)=κ2(A) for all unitary U,V.

Proof.

  • (a) 1=‖I‖=‖AA−1‖≤‖A‖‖A−1‖=κ(A), using Theorem 16.3.2 (c) and (d).

  • (b) (cA)−1=c−1A−1, so by homogeneity ‖cA‖‖(cA)−1‖=|c||c|−1‖A‖‖A−1‖.

  • (c) (AB)−1=B−1A−1, so submultiplicativity (Theorem 16.3.2 (d)) gives ‖AB‖‖B−1A−1‖≤‖A‖‖B‖‖B−1‖‖A−1‖.

  • (d) By Theorem 16.3.3 (c), ‖A‖2=σ1(A). By Lemma 16.8.1, ‖A−1‖2=1/m with m=min{‖Ax‖2:‖x‖2=1}, so it remains to see m=σn(A). Write A=UΣV∗ (Theorem 13.8.1) and y=V∗x; unitary matrices preserve ‖⋅‖2 (Theorem 11.7.3), so ‖x‖2=‖y‖2 and ‖Ax‖2=‖Σy‖2. Then ‖Σy‖22=∑i=1nσi2|yi|2≥σn2∑i=1n|yi|2=σn2 for ‖y‖2=1, with equality at y=en, that is at x=vn, the last column of V. So m=σn. For the last claim, if A=U1ΣV1∗ then UAV=(UU1)Σ(V∗V1)∗, and a product of unitary matrices is unitary, so this is a singular value decomposition of UAV with the same Σ: unitary factors do not change the singular values. This proves the proposition.

Part (d) is the reason κ2 is the condition number of choice in theory: it is invariant under the unitary changes of coordinates that Chapters 11 to 13 use throughout, so it is a property of the linear map and not of the basis it is written in.

16.8.2. What the condition number predicts

The computation that opened the section is now a theorem, together with the version where A itself, and not only b, carries the error. Both halves matter in practice: the entries of A are measurements too. Section 5 already proved the two perturbations together, in Theorem 16.5.3, and its constant ‖A‖‖A−1‖ is the product we have just named; what is added here is that the first half is sharp on its own, and that it needs no smallness hypothesis at all.

Theorem 16.8.3 (Relative Error Under Perturbation of the Data)

Let A∈Mn(C) be invertible, let b≠0, and let Ax=b.

  • (a) (Perturbing b.) If Ax~=b+Δb, then ‖x~−x‖‖x‖≤κ(A)‖Δb‖‖b‖, and there are b and Δb for which equality holds.
  • (b) (Perturbing A.) Let E∈Mn(C) with r:=κ(A)‖E‖/‖A‖<1. Then A+E is invertible; and if (A+E)x~=b, then ‖x~−x‖‖x~‖≤κ(A)‖E‖‖A‖,‖x~−x‖‖x‖≤r1−r.

Idea. For (a), the displayed computation at the head of the section, plus a choice of the two vectors that makes both inequalities in it equalities — and both are attained, because Lemma 16.3.1 says an operator norm is a maximum and not a supremum. For (b), factor A+E=A(I+A−1E) so that Theorem 16.5.1 decides invertibility, then subtract the two equations. Subtracting gives x~−x in terms of x~, which is why the clean bound is relative to x~; subadditivity of the norm converts it to a bound relative to x at the cost of the factor 1/(1−r), and that factor is where “to first order” hides.

Proof. (a). Subtracting Ax=b from Ax~=b+Δb gives A(x~−x)=Δb, so x~−x=A−1Δb and ‖x~−x‖≤‖A−1‖‖Δb‖ by Theorem 16.3.2 (a). Also ‖b‖=‖Ax‖≤‖A‖‖x‖, and x≠0 because b≠0, so 1/‖x‖≤‖A‖/‖b‖. Multiplying the two estimates, ‖x~−x‖‖x‖≤‖A−1‖‖Δb‖⋅‖A‖‖b‖=κ(A)‖Δb‖‖b‖.

For equality, use Lemma 16.3.1 twice. Choose a unit vector x with ‖Ax‖=‖A‖ and put b=Ax, so that ‖b‖=‖A‖‖x‖ and the second estimate is an equality. Choose a unit vector y with ‖A−1y‖=‖A−1‖ and put Δb=y, so that the first estimate is an equality. Then ‖x~−x‖‖x‖/‖Δb‖‖b‖=‖A−1‖1⋅‖A‖1=κ(A).

(b). Write A+E=A(I+A−1E). By Theorem 16.3.2 (d), ‖A−1E‖≤‖A−1‖‖E‖=κ(A)‖E‖‖A‖=r<1, so I−(−A−1E) is invertible by Theorem 16.5.1, and A+E is a product of two invertible matrices, hence invertible. (This is the openness of GLn(F) recorded in Corollary 16.5.2, with the radius made explicit.)

Since b≠0 we have x~=(A+E)−1b≠0. Subtracting Ax=b from (A+E)x~=b gives Ax~−Ax=−Ex~, hence x~−x=−A−1Ex~,‖x~−x‖≤‖A−1‖‖E‖‖x~‖=r‖x~‖, which is the first bound. For the second, ‖x~‖≤‖x‖+‖x~−x‖ since ‖⋅‖ is subadditive (Definition 16.1.1), so ‖x~−x‖≤r‖x‖+r‖x~−x‖; as r<1 we may divide by 1−r>0 to get ‖x~−x‖≤r1−r‖x‖. This proves the theorem.

The two bounds in (b) say the same thing differently. The first is exact and needs nothing but invertibility, but it measures the error against the computed answer. The second measures it against the true answer, at the cost of the factor 1/(1−r) — which is 1+r+r2+⋯, so for a small r it is 1 to first order and the two bounds agree. That is all “to first order in the perturbation of A” ever means here, and it is now a stated inequality rather than a gesture. Adding the two halves, with the factor 1/(1−r) covering both, recovers Theorem 16.5.3 exactly.

Quick check. Where in the proof of (a) is the hypothesis b≠0 used, and what goes wrong without it?

Solution. It is used to know x≠0, so that ‖x‖ may be divided by, and to know ‖b‖≠0, so that the relative perturbation ‖Δb‖/‖b‖ means anything. With b=0 the true solution is x=0 and every non-zero Δb produces an infinite relative error. Relative error is only defined against a non-zero reference.

Now a case where the bound of (a) is not merely an inequality. The point of computing the example exactly is to see that κ is not a pessimistic overestimate manufactured by the inequalities used to reach it: it is achieved.

Example (A system where the bound is attained)

Let A=(1111.01),b=(22.01), whose solution is x=(1,1). Compute κ∞(A); then perturb b to b+Δb with Δb=(0.01,−0.01), solve again, and compare the two relative errors.

Solution. Work with exact fractions: 1.01=101100 and detA=101100−1=1100, so A−1=100(101100−1−11)=(101−100−100100). The largest absolute row sums are 201100 for A and 201 for A−1, so by Theorem 16.3.3 (b), κ∞(A)=201100⋅201=40401100=404.01.

Check that Ax=b: the two rows give 1+1=2 and 1+101100=201100. Now x~−x=A−1Δb=1100(101+100−100−100)=(2.01−2), so x~=(3.01,−1). Verify directly: 3.01−1=2.01 and 3.01−1.01=2, which is b+Δb=(2.01,2).

The two relative errors, in ‖⋅‖∞: ‖Δb‖∞‖b‖∞=1/100201/100=1201≈0.50%,‖x~−x‖∞‖x‖∞=201/1001=201100=201%. Their ratio is 201100⋅201=404.01, which is exactly κ∞(A). A perturbation of half a percent in the data has turned the answer (1,1) into (3.01,−1), and the bound of Theorem 16.8.3 (a) is attained, not approached.

Geometrically the example is Lemma 16.8.1 at work: the two rows of A are nearly parallel, so the two lines whose intersection is x cross at a very small angle, and moving either line slightly slides the crossing point a long way. Ill-conditioning is that picture, in any dimension.

Warning. The condition number bounds the error; it does not produce it. Theorem 16.8.3 is a worst case over all perturbations Δb of a given size. A particular Δb may do far less damage: in the example above, Δb=(0.01,0.01) gives x~−x=A−1Δb=(0.01,0), a relative error of 1% against a relative perturbation of 0.5% — a magnification of 2, not 404. A large κ says that some direction is dangerous, not that yours is.

16.8.3. Why the normal equations are worse

Chapter 11 §04 solved the least-squares problem through the normal equations A∗Ax=A∗b (Theorem 11.4.2), and Chapter 11 §08 then recommended against actually forming that system. Its words were: “The deeper reason to prefer it is not the operation count: forming A∗A squares the sensitivity of the problem to rounding, while (†) never forms that product at all. Chapter 24 makes ‘sensitivity’ precise and proves the comparison; here we record only the practice.” The word “sensitivity” now has a meaning, and the word “squares” is now a theorem.

Theorem 16.8.4 (The Normal Equations Square the Condition Number)

Let m≥n≥1 and let A∈Mm×n(C) have rank n. Then A∗A∈Mn(C) is invertible, and κ2(A∗A)=κ2(A)2.

Idea. An SVD of A is also, after one multiplication, an eigenvalue decomposition of A∗A: the singular values get squared and nothing else happens. Both condition numbers are then ratios of the same list of numbers, one list being the squares of the other.

Proof. Write A=UΣV∗ with U∈Mm(C), V∈Mn(C) unitary and Σ∈Mm×n(R) carrying σ1≥⋯≥σn≥0 (Theorem 13.8.1). Since rankA=n, exactly n singular values are non-zero (Theorem 13.8.1), so σn>0. Using U∗U=Im, A∗A=VΣ∗U∗UΣV∗=V(Σ∗Σ)V∗,Σ∗Σ=diag(σ12,…,σn2). So A∗A is unitarily similar to a diagonal matrix with the positive entries σi2; it is therefore invertible, Hermitian and positive definite, with eigenvalues σ12≥⋯≥σn2>0.

The singular values of A∗A are those same numbers. Indeed the displayed identity is a singular value decomposition of A∗A, with both unitary factors equal to V and the diagonal entries already in decreasing order; alternatively, (A∗A)∗(A∗A)=Vdiag(σi4)V∗ has eigenvalues σi4, whose non-negative square roots are the σi2 (Definition 13.8.1). Hence by Definition 16.8.1 and Proposition 16.8.2 (d), κ2(A∗A)=σ12σn2=(σ1σn)2=κ2(A)2. This proves the theorem.

Example (Squaring, on a 3×2 example)

Let A=(110.1000.1). Compute κ2(A) and κ2(A⊤A).

Solution. A⊤A=(1.01111.01). It sends (1,1) to 2.01(1,1) and (1,−1) to 0.01(1,−1), so its eigenvalues are 201100 and 1100. Hence σ1(A)=201/10 and σ2(A)=1/10, so κ2(A)=201≈14.18,κ2(A⊤A)=201/1001/100=201=(201)2. A matrix whose conditioning is unremarkable becomes, on forming A⊤A, a matrix whose conditioning is fourteen times worse.

What is proved here, and what is not. Theorem 16.8.4 is a statement about matrices: the matrix one forms when one writes down the normal equations has the square of the condition number of the matrix one started with. Combined with Theorem 16.8.3, it says that the linear system A∗Ax=A∗b, considered as a problem in its own data, is more sensitive than A itself by a factor κ2(A) — and the QR route Rx=Q∗b of Chapter 11 §08 never forms A∗A, so it never incurs that factor. Indeed the triangular matrix it does solve with is no worse conditioned than A: from A=QR with Q∗Q=In (Theorem 11.8.1) we get A∗A=R∗Q∗QR=R∗R, so A and R have the same singular values (Definition 13.8.1) and κ2(R)=κ2(A) exactly.

Three things are not proved here, and all three belong to Chapter 24.

  • The conditioning of the least-squares problem itself is not κ2(A). The map b↦x+ from data to least-squares solution has a sensitivity that depends on κ2(A), on the residual ‖Ax+−b‖ and on the angle between b and col(A); when the residual is large, a term in κ2(A)2 appears even for the QR route. The bound above is about the linear systems being solved, not about the underlying fitting problem.
  • Nothing here is about arithmetic. A condition number describes a problem, and an error bound of the form “relative error ≤κ⋅ (relative perturbation)” only becomes a statement about a computation once one knows how large a perturbation the computation itself introduces. That requires a model of floating-point arithmetic and a backward error analysis, neither of which exists in this book yet.
  • Hence the comparison of the two algorithms — that a stable implementation of the QR route loses about log10⁡κ2(A) decimal digits while forming and solving the normal equations loses about 2log10⁡κ2(A) — is still Chapter 24’s to prove. What this section supplies is the number that appears in both statements, and the reason a square appears in one of them.

16.8.4. Conditioning is a property of the problem

This is the last warning of the chapter, and it is the one readers most often need.

Warning. Conditioning belongs to the problem; stability belongs to the algorithm. κ(A) is computed from A alone. It knows nothing about how anyone intends to solve Ax=b, and it does not change if the method changes. Two consequences, both regularly got wrong:

  • A large κ(A) does not mean a computed answer is wrong. It means that the answer is not determined to high relative accuracy by data of limited accuracy — a statement about the information available, not about the arithmetic performed. If the data are exact and the arithmetic is exact, the answer is exact however large κ is. And even in inexact arithmetic, a good algorithm returns the exact answer to a problem whose data differ from yours by a rounding error, which is the most anyone can ask of it.
  • A small κ(A) does not make an algorithm trustworthy. An unstable method can wreck a perfectly conditioned problem all by itself, by introducing errors far larger than the data warrant; Exercise (C3: A well-conditioned problem and a bad method) gives an elementary example in which κ∞ is below 5 and a computed coordinate comes out as 0 instead of 1.

Chapter 24 draws the distinction properly, defines backward stability, and proves which of the algorithms in this book have it. Until then, read κ as an upper bound on what any method can promise, and never as a verdict on a particular answer.

16.8.5. What this chapter has settled

Nine chapters wrote promissory notes that only a norm could pay. Here is the ledger, with the section that closed each entry.

  • Chapter 11 §01 said that not every norm comes from an inner product and that the parallelogram law is the test. Section 1 proved it, in Theorem 16.1.3, building on the R2 case of Exercise (C1: The parallelogram law characterizes inner-product norms).
  • Chapter 10 §10 promised that this chapter would prove ρ(A)≤‖A‖ for the norm induced by any vector norm, and would recover ρ(A) as a limit built from the norms of the powers. Section 4 did both: Theorem 16.4.1 and Gelfand’s formula Theorem 16.4.4. The same section also gave ρ the labeled definition Definition 16.4.1 that Chapter 10 used only in prose, and Corollary 16.4.5 restored Chapter 10’s convergence criterion with a rate attached. And Chapter 10’s entrywise convergence turned out to be the convergence, by Corollary 16.2.4.
  • Chapter 13 §08 and §12 asked, twice, for a name for max{‖Ax‖:‖x‖=1}. Section 3 supplied it — Definition 16.3.2 — and separated the name from the computation ‖A‖2=σ1(A), which is Theorem 16.3.3 (c); Example (The oblique projection, finally measured) measured Chapter 13 §12’s oblique projection. The spectral norm that Chapter 13 §10 needed in order even to state the second half of its approximation theorem now exists; the theorem itself waits for Chapter 17, which proves it from the min–max description of the singular values. The version covering every unitarily invariant norm at once is Chapter 21’s.
  • Chapter 10 §09 promised a return to eA with norms available, giving quantitative bounds in place of exact formulas. Section 6 gave them, in Theorem 16.6.1, and its Theorem 16.6.3 is the statement Chapter 12 §10 pointed at when it said that the consequence of stability for x˙=Ax belonged to Chapter 16.
  • Chapter 12 §01 said that this chapter, “where matrices acquire norms and limits can be spoken of properly, runs arguments of exactly this shape”. Section 7 ran one: Corollary 16.7.5 and Corollary 16.7.6 turn “prove it for diagonalizable matrices, then take a limit” into three lines, and Example (Cayley–Hamilton, by a limit) is the demonstration.
  • Chapter 11 §08 deferred its reason for preferring QR to the normal equations. Theorem 16.8.4 supplies the matrix half of it; the arithmetic half is Chapter 24’s, as listed above.

What the chapter has not done is equally worth recording. It has not bounded how far an individual eigenvalue moves under a perturbation — Example (A Jordan block’s eigenvalues move like ε1/k) shows there is no bound of the obvious kind, and the bounds that do exist, Weyl’s and Bauer–Fike’s, are Chapters 17 and 20. It has not said which norms are invariant under unitary multiplication, which is Chapter 21. And it has not touched arithmetic. The condition number is the bridge to that last subject: it is the exact point at which linear algebra stops and numerical analysis begins.

16.8.6. Exercises

A. Check your understanding

Exercise (A1)
  • (a) Define κ(A), naming what it depends on besides A.
  • (b) Explain why κ(A)≥1 for every invertible A.
  • (c) Decide whether each statement is correct, and justify: (i) “if κ(A)=108 then any computed solution of Ax=b has at most a few correct digits”; (ii) “if κ(A) is small then any method of solving Ax=b is reliable”.
  • (d) State what κ2(A∗A) is in terms of κ2(A), and say what that has to do with the QR factorization.

Solution.

  • (a) See Definition 16.8.1: κ(A)=‖A‖‖A−1‖, with κ(A)=∞ for singular A. Besides A it depends on the choice of vector norm, through the operator norm it induces; κ1, κ2 and κ∞ are three different numbers.

  • (b) 1=‖I‖=‖AA−1‖≤‖A‖‖A−1‖, by Theorem 16.3.2 (c) and (d). See Proposition 16.8.2 (a).

  • (c)
    • (i) Incorrect. κ bounds the effect of a perturbation of the data; with exact data and exact arithmetic the answer is exact. It says that the answer cannot be determined to high relative accuracy from inaccurate data, which is a statement about the problem, not a verdict on a computed answer. (ii) Incorrect. Conditioning is a property of the problem and stability a property of the algorithm; a small κ leaves an unstable method free to introduce errors of its own.
  • (d) κ2(A∗A)=κ2(A)2 for A of full column rank (Theorem 16.8.4). The normal equations form A∗A and so solve a system with the squared condition number, while the route Rx=Q∗b of Chapter 11 §08 never forms that product and keeps κ2(R)=κ2(A).

B. Practice

Exercise (B1: Three condition numbers)

For A=(300−12) and B=(1201), compute κ∞ and κ2 of each. Hint: B∗B has trace 6 and determinant 1.

Solution. A−1=diag(13,−2). Largest absolute row sums: 3 for A, 2 for A−1, so κ∞(A)=6 by Theorem 16.3.3 (b). For κ2: A∗A=diag(9,14), so σ1=3, σ2=12 and κ2(A)=6 by Proposition 16.8.2 (d). The two agree here because A is diagonal.

B−1=(1−201), and both have largest absolute row sum 3, so κ∞(B)=9. For κ2: B∗B=(1225) has trace 6 and determinant 1, so its eigenvalues are 3±22, giving κ2(B)=3+223−22=3+22≈5.828, using (3−22)(3+22)=1, so that the ratio is (3+22)2.

Exercise (B2: A perturbation, measured against the bound)

Let A=(1111.01) and b=(2,2.01) as in Example (A system where the bound is attained), and take Δb=(0,0.01).

  • (a) Solve Ax~=b+Δb exactly.
  • (b) Compute both relative errors in ‖⋅‖∞ and the factor between them, and compare with κ∞(A)=404.01.

Solution.

  • (a) With A−1=(101−100−100100) from Example (A system where the bound is attained) and Δb=(0,1100), x~−x=A−1Δb=(−11),x~=(02). Check: 0+2=2 and 0+2⋅101100=202100=2.02=b+Δb in the second coordinate.

  • (b) ‖Δb‖∞/‖b‖∞=1/100201/100=1201, and ‖x~−x‖∞/‖x‖∞=1. The factor is 201, which is below κ∞(A)=404.01 by a factor of about 2. The bound holds, as Theorem 16.8.3 (a) requires, and is not attained: this Δb is not the worst direction, which Example (A system where the bound is attained) found.

Exercise (B3: Squaring, again)

Let A=(1001200).

  • (a) Compute the singular values of A and κ2(A).
  • (b) Compute A⊤A and κ2(A⊤A) directly, and confirm Theorem 16.8.4.
  • (c) Does κ∞ also square? Compute κ∞(A⊤A) and compare with κ∞ of the square matrix (10012).

Solution.

  • (a) A⊤A=diag(1,14), whose eigenvalues are 1 and 14; so σ1(A)=1, σ2(A)=12 and κ2(A)=2.

  • (b) A⊤A=diag(1,14) is diagonal with positive entries, so its singular values are 1 and 14 and κ2(A⊤A)=4=22=κ2(A)2, as Theorem 16.8.4 says.

  • (c) For a diagonal matrix every κp is the ratio of the largest to the smallest modulus on the diagonal, so κ∞(A⊤A)=4 while κ∞(diag(1,12))=2; here the squaring happens in κ∞ too. It does not in general: Theorem 16.8.4 is stated for κ2, and the proof uses singular values, which only ‖⋅‖2 sees. Exercise (C1: Changing the norm changes κ, but not much) bounds how far the other condition numbers can stray.

C. Going deeper

Exercise (C1: Changing the norm changes κ, but not much)

Let ‖⋅‖a and ‖⋅‖b be norms on Cn with c‖v‖b≤‖v‖a≤C‖v‖b for all v, as supplied by Theorem 16.2.2, and write κa,κb for the corresponding condition numbers.

  • (a) Prove that ‖A‖a≤(C/c)‖A‖b for every A∈Mn(C).
  • (b) Deduce that κa(A)≤(C/c)2κb(A) and κb(A)≤(C/c)2κa(A) for every invertible A.
  • (c) Using ‖v‖∞≤‖v‖2≤n‖v‖∞, bound κ2 in terms of κ∞ for n=2, and check the bound on the matrix B=(1201) of Exercise (B1: Three condition numbers).

Solution.

  • (a) Let x≠0. Then ‖Ax‖a‖x‖a≤C‖Ax‖bc‖x‖b≤Cc‖A‖b, using the two inequalities and Theorem 16.3.2 (a) for ‖⋅‖b. Taking the maximum over x≠0, which is ‖A‖a by Definition 16.3.2 and homogeneity, gives the claim.

  • (b) Apply (a) to A and to A−1 and multiply: κa(A)=‖A‖a‖A−1‖a≤(C/c)2‖A‖b‖A−1‖b=(C/c)2κb(A). The reverse follows by symmetry, since the hypothesis also reads C−1‖v‖a≤‖v‖b≤c−1‖v‖a, whose ratio of constants is again C/c.

  • (c) With ‖⋅‖a=‖⋅‖2 and ‖⋅‖b=‖⋅‖∞, we have c=1 and C=n=2, so κ2(A)≤2κ∞(A) and κ∞(A)≤2κ2(A). For A=(1201): κ2=3+22≈5.83 and κ∞=9, and indeed 5.83≤18 and 9≤11.66. Both bounds hold, with room to spare; the point is only that no choice of norm can turn a well-conditioned matrix into an ill-conditioned one.

Exercise (C2: The condition number is the reciprocal distance to singularity)

Let A∈Mn(C) be invertible.

  • (a) Prove that every singular B∈Mn(C) satisfies ‖A−B‖‖A‖≥1κ(A).
  • (b) For the 2-norm, prove that equality is achieved: exhibit a singular B with ‖A−B‖2=σn(A). Hint: use a singular value decomposition and delete one term.
  • (c) Hence interpret 1/κ2(A) in one sentence, and say what it gives for the matrix of Example (A system where the bound is attained).

Solution.

  • (a) Put E=B−A, so A+E=B is singular. If ‖A−1E‖<1 then A+E=A(I+A−1E) would be invertible, by Theorem 16.5.1 and the fact that a product of invertible matrices is invertible; so ‖A−1E‖≥1. By Theorem 16.3.2 (d), 1≤‖A−1‖‖E‖, that is ‖E‖≥1/‖A−1‖. Dividing by ‖A‖, ‖A−B‖‖A‖=‖E‖‖A‖≥1‖A‖‖A−1‖=1κ(A).

  • (b) Let A=UΣV∗ (Theorem 13.8.1) with Σ=diag(σ1,…,σn), and put B=Udiag(σ1,…,σn−1,0)V∗. Then B is singular, since diag(σ1,…,σn−1,0) is and U,V are invertible; and A−B=Udiag(0,…,0,σn)V∗, whose singular values are those of diag(0,…,0,σn) — for any M, (UMV∗)∗(UMV∗)=VM∗MV∗ is similar to M∗M, so unitary factors leave the singular values alone, invertible or not — the largest of them being σn; so ‖A−B‖2=σn by Theorem 16.3.3 (c). Since ‖A‖2=σ1, the ratio is σn/σ1=1/κ2(A), matching (a) with equality.

  • (c) 1/κ2(A) is the relative distance, in the 2-norm, from A to the nearest singular matrix. For A=(1111.01), whose κ2 is the ratio of the eigenvalues (201±40001)/200 of the symmetric A, one gets κ2(A)≈402.0, so a relative perturbation of about 0.25% suffices to make A singular. Ill-conditioned means nearly singular, in exactly this quantitative sense.

Exercise (C3: A well-conditioned problem and a bad method)

Consider the two-by-two system 10−15x1+x2=1,x1+x2=2, with coefficient matrix A=(10−15111).

  • (a) Show that κ∞(A)<5, so that the problem is well conditioned.
  • (b) Solve the system exactly.
  • (c) Eliminate x1 using the first equation as the pivot row, rounding every intermediate quantity to 12 significant decimal digits, and compare the result with (b). Then do the same after exchanging the two equations, and say what the exchange achieved.
  • (d) What does this show about the relationship between κ(A) and the accuracy of a computed answer?

Solution.

  • (a) Write ε=10−15. Then detA=ε−1≠0 and A−1=1ε−1(1−1−1ε). The largest absolute row sum of A is 2, and that of A−1 is 2/(1−ε), so by Theorem 16.3.3 (b), κ∞(A)=41−ε<5.

  • (b) Subtracting the first equation from the second gives (1−ε)x1=1, so x1=11−ε=1+10−15+…,x2=1−εx1=1−2ε1−ε=1−10−15+…. Both coordinates are 1 to fourteen decimal places.

  • (c) Without the exchange. The multiplier is 1/ε=1015, and the second equation becomes (1−1015)x2=2−1015. Both sides need fifteen significant digits to be recorded exactly, so at twelve digits both round to −1.00000000000×1015, and the computed x2 is exactly 1 — accurate, as it happens. Back-substitution into the first equation then gives x1=1−x2ε=010−15=0, against a true value of 1+10−15: every digit is wrong. The damage was done by subtracting two numbers that agree in all twelve retained digits, so that the difference retains none of them.

    With the exchange. Pivoting on x1+x2=2, the multiplier is ε=10−15 and the second equation becomes (1−ε)x2=1−2ε. At twelve digits both coefficients round to 1.00000000000, giving x2=1.00000000000, and back-substitution gives x1=2−x2=1.00000000000. Both agree with (b) to all twelve digits. The exchange achieved one thing: it made the multiplier at most 1 in modulus, so nothing in the elimination was amplified, and no large quantity was ever created to be subtracted from a comparable one. This is why every practical elimination scheme chooses the largest available pivot.

  • (d) The conditioning of the problem is excellent, κ∞(A)<5, and it is the same for both computations, since it does not mention a method. Yet one method returns (0,1) and the other returns the right answer. Conditioning bounds what any method can promise; whether a given method keeps that promise is stability, and it is Chapter 24’s subject.

Found a typo or a mistake? Report it, or read this page’s source

The text of this book is licensed under CC BY-NC-SA 4.0.