Calculator overview
Inputs and outputs
This summary comes from the calculator's published input and output contract.
Inputs
- Line 2, first handle x (required)
-
Default -1 Range -5 to 5
About this input
Line 2, first handle, x (-5 to 5).
- Line 2, first handle y (required)
-
Default 3 Range -5 to 5
About this input
Line 2, first handle, y (-5 to 5).
- Line 2, second handle x (required)
-
Default 3 Range -5 to 5
About this input
Line 2, second handle, x (-5 to 5).
- Line 2, second handle y (required)
-
Default -1 Range -5 to 5
About this input
Line 2, second handle, y (-5 to 5).
- Matrix (required)
-
Default Two lines Allowed Two lines, Tiny pivot, Near-parallel, Hilbert, Vandermonde, Custom
About this input
The system to solve: Two lines (drag their handles), Tiny pivot, Near-parallel, Hilbert, Vandermonde or Custom. Picked with the chips on the stage.
- System size (required)
-
Default 5 Range 2 to 7
About this input
The size n of the Hilbert or Vandermonde system, 2 to 7. Step it with the size stepper on the board.
- Tiny entry exponent m (required)
-
Default -4 Range -20 to -1
About this input
The tiny entry is 10 to this power, -20 to -1: the first pivot of Tiny pivot, or how far Near-parallel is from parallel.
- Your nudge (ring position) (required)
-
Default 24 Range 0 to 63
About this input
Where your own nudge sits on the square ring, 0 to 63: each place nudges the two equations by a different mix. 2 by 2 systems only.
- Pivoting (required)
-
Default Partial pivoting Allowed Partial pivoting, No pivoting
About this input
Partial pivoting (move the largest entry up before each step) or No pivoting.
- Line 1, first handle y (required)
-
Default -1 Range -5 to 5
About this input
Line 1, first handle, y (-5 to 5).
- Custom system size (required)
-
Default 4 Range 2 to 4
About this input
The size of your own system, 2 to 4: only that many equations and coefficients are read.
- Custom system: rows are equations; columns 1 to 4 are the coefficients and the last column the right-hand side (only the rows and columns up to the custom size are read) (required)
-
Default 4 rows
About this input
Your own system, up to 4 equations: the coefficients of each equation and its right-hand side, each from -100 to 100.
Column Range or allowed values Column 1 -100 to 100 Column 2 -100 to 100 Column 3 -100 to 100 Column 4 -100 to 100 Right side -100 to 100 - Your prediction: amplification
-
When omitted Blank
Default Not set Range 1 to 10000000000
About this input
Challenge 1 only: your prediction of the amplification, 1 to 10,000,000,000. Place it on the ruler; until you do, it is not yet predicted.
- Challenge (required)
-
Default 0 Range 0 to 5
About this input
Pick a challenge from 1 to 5, or 0 for none. A challenge sets its own system and settings and leaves one control to you.
- Data error exponent k (required)
-
Default -2 Range -8 to -1
About this input
The data error is 10 to this power, -8 to -1, relative to the size of the terms in the equations.
- Line 1, second handle y (required)
-
Default 2 Range -5 to 5
About this input
Line 1, second handle, y (-5 to 5).
- Line 1, first handle x (required)
-
Default -3 Range -5 to 5
About this input
Line 1, first handle, x (-5 to 5). Drag the handle; it snaps to 0.01.
- Equation order (required)
-
Default As given Allowed As given, First two swapped
About this input
Challenge 4 only: keep the equations as given or swap the first two.
- Line 1, second handle x (required)
-
Default 3 Range -5 to 5
About this input
Line 1, second handle, x (-5 to 5).
Outputs
- Gap between the two answers
-
No unit declared
About this output
The largest gap between the answers with and without pivoting.
- Formula module versions
-
No unit declared
About this output
The versions of the calculation modules it uses.
- Model version
-
No unit declared
About this output
The version of this lab's model.
- Residual after the worst nudge
-
No unit declared
About this output
How well the nudged answer satisfies the original equations, relative to the right-hand side: about the size of the data error, even when the answer moved a lot.
- Amplification of your nudge
-
No unit declared
About this output
The amplification of your own nudge on the ring (2 by 2 systems).
- Without pivoting
-
No unit declared
About this output
How elimination without pivoting went: OK, a zero pivot at a step, or a growth factor above a hundred million.
- Model Status
-
No unit declared
About this output
OK when the system can be solved; CHECK with the reason when the lines are parallel, the matrix is singular or too close to singular, the right-hand side is zero, or elimination without pivoting fails; NOT VALID with the input to fix.
- Line 2, first handle x used
-
No unit declared
About this output
The x of the first handle of line 2 as used, snapped to 0.01.
- Line 2, second handle y used
-
No unit declared
About this output
The y of the second handle of line 2 as used, snapped to 0.01.
- Line 2, second handle x used
-
No unit declared
About this output
The x of the second handle of line 2 as used, snapped to 0.01.
- Matrix used
-
No unit declared
About this output
The system used (blank when a challenge sets it).
- Two-line geometry: the lines, their error bands, your nudged lines, the crossings and the error region corners
-
No unit declared
About this output
For 2 by 2 systems: the two lines, their error bands, your nudged lines, the crossing, the worst and your nudged crossings, and the four corners of the error region.
- Line 2, first handle y used
-
No unit declared
About this output
The y of the first handle of line 2 as used, snapped to 0.01.
- The answer: with and without pivoting, the change from the worst nudge, the nudged answer and the intended answer
-
No unit declared
About this output
One row per unknown: the answer with and without pivoting, the change from the worst nudge, the nudged answer and the intended answer (1 for the built-in families).
- Residual with partial pivoting
-
No unit declared
About this output
How well the answer with partial pivoting satisfies the equations, relative to the size of the terms (0 at rounding level).
- Residual without pivoting
-
No unit declared
About this output
How well the answer without pivoting satisfies the equations, relative to the size of the terms (0 at rounding level).
- Largest shift of the answer (worst)
-
No unit declared
About this output
How far the answer moves under the worst nudge, in the units of the unknowns.
- Tiny entry exponent used
-
No unit declared
About this output
The tiny entry exponent used.
- System size used
-
No unit declared
About this output
The Hilbert or Vandermonde size used.
- Relative change of the answer (worst)
-
No unit declared
About this output
How far the answer moves under the worst nudge, relative to its size.
- Your nudge as a share of the worst
-
No unit declared
About this output
Your nudge's amplification as a share of the worst one: 1 means you found a worst nudge.
- The nudge ring: the 64 places of your nudge and the nudge each gives to the two equations
-
No unit declared
About this output
For the canvas: the 64 places of the nudge ring and the nudge each gives to the two equations.
- Nudge position used
-
No unit declared
About this output
The nudge position used.
- Row swaps with partial pivoting
-
No unit declared
About this output
How many row swaps partial pivoting made.
- Pivoting used
-
No unit declared
About this output
The pivoting used.
- The nudge cloud: amplification and relative change of the answer for 24 fixed directions and the worst one
-
No unit declared
About this output
For 24 fixed nudge directions and the worst one: the amplification and the relative change of the answer.
- Custom system size used
-
No unit declared
About this output
The custom size used.
- Condition number (2-norm, 2 by 2)
-
No unit declared
About this output
The condition number in the 2-norm, for 2 by 2 systems.
- Condition number (1-norm)
-
No unit declared
About this output
The condition number in the 1-norm (column sums).
- Digits lost to the worst nudge
-
No unit declared
About this output
The number of significant digits the worst nudge can cost: the base-10 logarithm of the worst amplification.
- Digits at risk from rounding
-
No unit declared
About this output
How many of the roughly 16 significant digits a computer carries this matrix can cost from rounding alone.
- Data error exponent used
-
No unit declared
About this output
The data error exponent used.
- Condition number
-
No unit declared
About this output
The condition number of the matrix (infinity norm): how many times a relative error in the data can grow in the answer.
- Challenge goal
-
No unit declared
About this output
What the selected challenge asks.
- Challenge feedback
-
No unit declared
About this output
A hint while the selected challenge is not met (in challenge 1, first the prompt to predict), then the explanation once it is met.
- Worst amplification of a data error
-
No unit declared
About this output
How many times larger the relative change in the answer is than the relative change in the data, for the worst nudge. It equals the condition number.
- Challenge result
-
No unit declared
About this output
No challenge selected, NOT MET or MET.
- Challenge score
-
No unit declared
About this output
100 when the selected challenge is met, else 0.
- Challenge: the value scored
-
No unit declared
About this output
The value the selected challenge scores: your prediction over the amplification (1), the worst shift (2), the relative change (3), the gap between the two answers (4) or your nudge's share (5).
- Line 1, second handle x used
-
No unit declared
About this output
The x of the second handle of line 1 as used, snapped to 0.01.
- Heat-map scale, low end
-
No unit declared
About this output
For the canvas: the low end of the inverse heat-map colour scale (the smallest log10 size shown).
- Heat-map scale, high end
-
No unit declared
About this output
For the canvas: the high end of the inverse heat-map colour scale (the largest log10 size shown).
- Line 1, first handle y used
-
No unit declared
About this output
The y of the first handle of line 1 as used, snapped to 0.01.
- Line 1, first handle x used
-
No unit declared
About this output
The x of the first handle of line 1 as used, snapped to 0.01.
- Line 1, second handle y used
-
No unit declared
About this output
The y of the second handle of line 1 as used, snapped to 0.01.
- The inverse heat map: log10 of the size of each entry of A^-1 (blank when it is rounding noise)
-
No unit declared
About this output
The base-10 logarithm of the size of each entry of the inverse matrix (blank when it is rounding noise): the heat map.
- Frames
-
No unit declared
About this output
For the canvas: how many elimination frames the player shows.
- Equation order used
-
No unit declared
About this output
The equation order used (challenge 4).
- Elimination frames: step 0 to 6, the rows of the matrix and right side after each step, the next pivot, its column and how many leading columns elimination has zeroed
-
No unit declared
About this output
Elimination step by step: for steps 0 to 6, each row of the matrix and right-hand side, the equation it came from, the row that is the next pivot, the pivot's column and how many leading columns elimination has zeroed in that row.
- The Hilbert ladder: condition number, digits at stake and the worst relative change for this data error, by size
-
No unit declared
About this output
The Hilbert matrices of size 2 to 7: the exact condition number, the digits at stake, the worst relative change for this data error, and this run's change on its own size.
- Growth factor with partial pivoting
-
No unit declared
About this output
How much the entries grew during elimination with partial pivoting.
- Growth factor without pivoting
-
No unit declared
About this output
How much the entries grew during elimination without pivoting (largest final entry over the largest entry of the matrix).
LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.
Methodology
Purpose and model boundary
This lab solves a linear system A·x = b of size 2 to 7 and shows how far its answer can move when the data move a little. The system is one of six: two lines you drag in the plane, a 2 by 2 system with a tiny first entry, two nearly parallel lines, a Hilbert or a Vandermonde matrix of size 2 to 7, or a custom system of up to 4 equations. The model runs Gaussian elimination step by step, with partial pivoting and without pivoting, builds the inverse and returns the condition number. It then nudges the right-hand side by a relative data error of 10^k, in the worst direction, in 24 fixed directions and in a direction you set, and reports how many times the relative change of the answer exceeds that of the data, the digits lost, the residuals, the growth of the entries, a ladder of Hilbert matrices with their exact condition numbers, and, for 2 by 2 systems, the lines, their error bands and the region the crossing can move in. Five scored challenges go with it.
It is a lab for learning why some linear systems cannot be solved accurately: why digits are lost as the condition number grows, why a small residual does not mean a small error, and how a bad method (elimination without pivoting on a tiny pivot) differs from a bad problem (an ill-conditioned matrix). It is not a solver for real systems: it handles at most 7 unknowns, it shows no answer for a matrix whose condition number is above a billion, and it is not meant for engineering or scientific decisions.
The model is the calculation authority. The page sends the values you set to the model and draws only what it returns: the lines, bands, crossings and error region, the elimination frames with their pivots and row swaps, the inverse heat map, the cloud of nudges and the Hilbert ladder all come from the model's own tables. The page computes no answer, condition number, amplification or residual itself.
Inputs and units
Every input is a pure number or a choice; the lab has no physical units. The answer's change is in the units of the unknowns, and every relative change is a ratio of infinity norms (the largest entry in size).
| Input | Meaning and unit |
|---|---|
| Matrix | Two lines (default), Tiny pivot, Near-parallel, Hilbert, Vandermonde or Custom. |
| Line 1 and line 2 handles | Each line passes through two handles, each coordinate from -5 to 5, snapped to 0.01. Defaults: line 1 through (-3, -1) and (3, 2), line 2 through (-1, 3) and (3, -1). The two handles of a line must differ. Two lines only. |
| System size | n, a whole number from 2 to 7 (default 5). Hilbert and Vandermonde only. |
| Custom size | A whole number from 2 to 4 (default 4): how many equations and coefficients of your system are read. Custom only. |
| Custom system | Up to 4 equations, each with up to 4 coefficients and a right-hand side, every entry from -100 to 100. Default rows 4, -1, 0, 1 | 4; -1, 4, -1, 0 | 2; 0, -1, 4, -1 | 2; 1, 0, -1, 4 | 4. Custom only. |
| Tiny entry | m, a whole number from -20 to -1 (default -4): the tiny entry is ε = 10^m. Tiny pivot and Near-parallel only. |
| Data error | k, a whole number from -8 to -1 (default -2): the nudge is a relative data error δ = 10^k, relative to the size of the terms in the equations. |
| Pivoting | Partial pivoting (default) or No pivoting. Both methods are always computed; the choice sets which one the frames show and whether the no-pivoting CHECK messages apply. |
| Your nudge | A whole number from 0 to 63 (default 24): the place of your own nudge on the square ring. Two lines, Tiny pivot and Near-parallel only. |
| Equation order | As given (default) or First two swapped. Challenge 4 only. |
| Challenge number | 0 for free exploration, or 1 to 5 to load a challenge. |
| Your prediction of the amplification | Blank (not yet predicted) or a number from 1 to 10,000,000,000: your answer for challenge 1. Read only in challenge 1. |
An input is read only when it applies to the matrix in use and is not fixed by the active challenge. An input that is not read is not checked, and the model uses its default.
Where each input is set:
- On the canvas only: the matrix (a row of chips), the four line handles (dragged, in steps of 0.01, each with an exact-entry popover), the data error, the tiny entry, the system size and the custom size (steppers), pivoting (a chip), your nudge (a handle on the square ring, 64 places), the equation order (a chip, shown only in challenge 4) and your prediction (a handle on a logarithmic ruler from 1 to 10,000,000,000, shown only in challenge 1, snapping to 1, 1.8, 3.2, 5.6, 10, 18 and so on). None of these is in the input panel.
- In the input panel: the custom system, as a grid with slider pop-ups, and the challenge number.
Governing relationships
The six systems. For the two dragged lines, each handle is snapped to the 0.01 grid. Each line becomes one equation a_i1·x + a_i2·y = c_i whose coefficients are the line's unit normal, so the right-hand side c_i is the line's signed distance from the origin, and a nudge of the right-hand side moves a line by that distance. The lines are parallel when the cross product of their whole-number normals on the 0.01 grid is exactly 0. The other systems are:
- Tiny pivot: A = [[ε, 1], [1, 1]], b = (ε + 1, 2). Intended answer (1, 1).
- Near-parallel: A = [[1, 1], [1, 1 + ε]], b = (2, 2 + ε). Intended answer (1, 1).
- Hilbert: H_ij = 1/(i + j - 1), b = the row sums. Intended answer all ones.
- Vandermonde: t_i = (i - 1)/(n - 1) and V_ij = t_i^(j-1), built by repeated multiplication; b = the row sums. Intended answer all ones.
- Custom: your coefficients and right-hand side. No intended answer.
In challenge 4, First two swapped exchanges the first two equations before elimination.
Gaussian elimination with partial pivoting. At step k (k = 1 to n - 1) the row, from row k down, whose entry in column k is largest in size is swapped up to row k; on an exact tie the first such row is taken. Each row i below it gets the multiplier l_ik = a_ik / a_kk and loses l_ik times the pivot row, which zeroes column k below the pivot. The multipliers are kept, so the same factorisation solves any other right-hand side. Partial pivoting finds no usable pivot when the largest candidate in a column is at most 1×10⁻¹⁴ · ‖A‖∞; the matrix is then singular to working precision.
Elimination without pivoting. The same steps with the pivot always the current diagonal entry. It meets a zero pivot only when that entry is exactly 0. A tiny pivot gives huge multipliers that wipe out the small entries: with ε = 10⁻²⁰ the answer without pivoting is (0, 1) instead of (1, 1).
The growth factor. The largest entry in size of the final upper triangle U over the largest entry in size of A, for each method. Without pivoting, a growth above 100,000,000 means many digits of that answer may be wrong.
Back substitution. From the last row up, x_i = (y_i - u_i,i+1·x_i+1 - ... - u_i,n·x_n) / u_ii, with y the eliminated right-hand side. Another right-hand side is first put through the same row swaps and multipliers (forward substitution) and then solved the same way.
The inverse and the condition numbers. Column j of A⁻¹ is the solution for the j-th unit vector. Then
- the condition number κ∞ = ‖A‖∞ · ‖A⁻¹‖∞, with ‖·‖∞ the largest row sum of absolute values;
- κ₁ = ‖A‖₁ · ‖A⁻¹‖₁, with ‖·‖₁ the largest column sum;
- for 2 by 2 systems, κ₂ = (s + √(s² - 4·d²)) / (2·|d|), with s the sum of the squares of the four entries and d the determinant.
The data error. With x̂ the answer with partial pivoting, the scale of the terms in the equations is σ = ‖A‖∞ · ‖x̂‖∞. A nudge in a direction d whose largest entry in size is 1 changes the right-hand side by δ·σ·d, so the relative data error is δ for every system. The change of the answer is Δx = δ·σ·w, where w solves A·w = d on the stored factorisation (a linear solve of the direction, not a re-solve and subtraction). The amplification of that nudge is ‖A‖∞ · ‖w‖∞, and the relative change of the answer, ‖Δx‖∞ / ‖x̂‖∞, is δ times the amplification.
The worst nudge. Take the row r of A⁻¹ with the largest sum of absolute values (the first on an exact tie), and the nudge s_j = the sign of the entry (A⁻¹)_rj, with entries within 1×10⁻¹² of the row's largest in size read as +1. Its amplification equals κ∞ exactly in exact arithmetic, so the worst amplification is the condition number. From it:
- digits lost = log₁₀(worst amplification);
- the worst relative change of the answer = δ × the worst amplification;
- the worst shift = ‖Δx‖∞, how far the answer moves in its own units.
Your nudge on the ring. Position p from 0 to 63 runs round the square whose sides are at ±1: with side = the whole part of p/16 and w = -1 + (p mod 16)/8, the nudge to the two equations is (1, w) on side 0, (-w, 1) on side 1, (-1, -w) on side 2 and (w, -1) on side 3. Positions 0, 16, 32 and 48 are the corners (1, -1), (1, 1), (-1, 1) and (-1, -1). Every place has the same size, so only the mix changes. Your nudge's share is its amplification over the worst amplification: 1 means you have found a worst nudge.
The cloud. 24 fixed nudge directions, each with its first entry ±1 and the others in steps of 0.25 from -1 to 1, each with its amplification and the relative change of the answer, plus the worst nudge as a 25th row.
Residuals. The residual with partial pivoting is ‖b - A·x̂‖∞ / (‖A‖∞ · ‖x̂‖∞), and reads 0 when it is at most 1×10⁻¹² (rounding level); the residual without pivoting is the same for its own answer. The nudged residual is ‖b - A·x̃‖∞ / ‖b‖∞ for the answer x̃ after the worst nudge: about the size of the data error even when the answer has moved a lot.
The Hilbert ladder. For each size N from 2 to 7 the model uses the exact integer inverse of the Hilbert matrix,
(H⁻¹)_ij = (-1)^(i+j) · (i + j - 1) · C(N + i - 1, N - j) · C(N + j - 1, N - i) · C(i + j - 2, i - 1)²,
with C the binomial coefficient, and κ∞ = (1 + 1/2 + ... + 1/N) · ‖H⁻¹‖∞. Each row gives the size, that exact condition number, the digits at stake log₁₀ κ∞, the worst relative change κ∞ · δ, and, on the row of the size in use when the matrix is Hilbert, this run's own relative change. log₁₀ κ∞ runs from about 1.4 at size 2 to about 9.0 at size 7.
Digits at risk from rounding. The model counts how many of the 16 thresholds 3.16227766 × 10^(j-1), j = 1 to 16, κ∞ reaches, and says that the matrix can cost about that many of the roughly 16 significant digits a computer carries, from rounding alone.
Two-line geometry. For 2 by 2 systems each band is its line moved by δ·σ along its normal, both ways, and the error region has the four corners x̂ + δ·σ·(±column 1 of A⁻¹ ± column 2 of A⁻¹).
Calculation sequence
- The model checks the inputs it reads, in the order of the status list under Errors and warnings, on the values entered.
- In a challenge it fixes the challenge's own system and settings, except the input that challenge leaves to you.
- It builds A and b for the matrix in use (snapping the line handles, and swapping the first two equations if asked), and the norms of A and b.
- It runs Gaussian elimination with partial pivoting and without pivoting, keeping every step as a frame, finds any zero pivot and computes the growth factors.
- It solves for both answers, builds the inverse column by column, and computes the condition numbers and the Hilbert ladder.
- It finds the worst nudge and solves for it, your nudge and the 24 fixed directions, giving the amplifications, the changes of the answer and the residuals.
- For 2 by 2 systems it computes the lines, bands, crossings and error region.
- It sets the status and, in a challenge, scores the challenge and withholds what that challenge keeps back.
Outputs and interpretation
- Condition number (infinity norm): how many times a relative error in the data can grow in the answer. Also the condition number in the 1-norm and, for 2 by 2 systems, in the 2-norm.
- Worst amplification: how many times larger the relative change in the answer is than the relative change in the data, for the worst nudge. It equals the condition number.
- Digits lost: the base-10 logarithm of the worst amplification.
- Worst relative change of the answer and worst shift (in the units of the unknowns).
- Your nudge's amplification and share of the worst (2 by 2 systems).
- Without pivoting: its status (OK, CHECK: zero pivot at step k, or CHECK: growth factor above a hundred million), the largest gap between the answers with and without pivoting, its growth factor and its residual.
- Row swaps made by partial pivoting, its growth factor and its residual.
- Nudged residual: how well the worst nudged answer satisfies the original equations, relative to the right-hand side.
- Digits at risk from rounding: the sentence described above.
- Settings used: the matrix, the snapped line handles, the sizes, the exponents, pivoting, your nudge and the equation order in effect.
- Solution table: for each unknown, the answer with and without pivoting, the change from the worst nudge, the answer after the worst nudge and the intended answer.
- Elimination frames: steps 0 to 6, each row of the matrix and the right-hand side, the equation it came from, the next pivot row and its column, and how many leading columns of that row have been zeroed.
- Inverse sizes: the base-10 logarithm of the size of each entry of A⁻¹, blank where the entry is at most 1×10⁻¹² of the largest (rounding noise).
- Cloud, Hilbert ladder, two-line geometry and the 64 places of the nudge ring.
Reading the canvas: for 2 by 2 systems the lines view draws the two lines, their shaded bands, the error region, the crossing, an arrow to the worst nudged crossing, and your nudged lines and crossing beside the ring. From the Experiment level the elimination board plays the frames one step at a time, outlining the next pivot and marking row swaps, with a cloud chart of the amplifications on a logarithmic axis with a horizontal line at the condition number, and a ladder of the Hilbert condition numbers with this run's size outlined. At the Advanced level the inverse heat map colours each entry of A⁻¹ by the base-10 logarithm of its size. No value is printed on the canvas.
What to take from the lab: the answer can move by up to the condition number times the data error, so each power of ten in the condition number costs one significant digit; a Hilbert system gets about one and a half digits worse with each step up in size. A small residual does not mean a small error: the nudged answer satisfies the equations to about the size of the nudge while it has moved far. Nearly parallel lines are ill-conditioned, a steep crossing is well conditioned. The worst nudge pushes the two lines apart in opposite directions. A tiny pivot ruins elimination without pivoting even when the matrix is well conditioned; swapping the rows, which is what partial pivoting does, repairs the method.
Challenges
Each challenge loads its own system and settings and leaves one control to you. The model scores each one MET (100) or NOT MET (0) and gives a one-line hint while it is not met. A challenge can be met only while the status reads OK (challenge 1: while it is not NOT VALID). On the page, a challenge shows its setup and holds the answer until you first act. Challenges 1 and 2 are offered at every level, challenges 3 to 5 from the Experiment level.
- Predict the swing (introductory). Two nearly parallel lines (Near-parallel, tiny entry 10⁻⁴, data error 10⁻⁵). Predict how many times larger the relative change in the answer can be than the relative change in the data. Met when your prediction is within a factor of 3 of the worst amplification. The value scored is your prediction over the worst amplification.
- Make it robust (introductory). Two lines with a 1% data error. Keep line 1 and move line 2 so the lines cross within 0.1 of (1, 1) in each coordinate and the worst nudge moves the crossing by at most 0.02. The value scored is the worst shift.
- How big can Hilbert get? (intermediate). With a data error of one part in a hundred million, find the largest Hilbert system whose answer still moves by at most 1%. Met when the worst relative change is at most 0.01 and the next size up would exceed it (or the size is 7, the largest). The value scored is the worst relative change.
- Fix the method (intermediate). Tiny pivot with ε = 10⁻²⁰, without pivoting. Change the equation order so elimination without pivoting gets the right answer. Met when the answers with and without pivoting agree within 1×10⁻¹². The value scored is the largest gap between them.
- Find the worst nudge (intermediate). Two nearly parallel lines (Near-parallel, tiny entry 10⁻³, data error 10⁻⁴). Move your nudge round the ring to find a data error that moves the crossing at least 90% as far as the worst one can. Met when your nudge's share is at least 0.9. The value scored is the share.
Challenge 1 holds back the answer until you predict: while your prediction is blank, every condition number, amplification, relative change, shift, digit count and nudged result is blank, with the cloud and the inverse sizes, and of the geometry only the two lines and the crossing remain. The equations, the answers, the frames and the statuses stay, and the challenge prompts you to place your prediction on the ruler first. Any prediction reveals everything, met or not. Until met, challenge 2 withholds the condition numbers, the worst amplification, the digits lost and at risk, the inverse sizes and the cloud; the bands, the error region and the worst shift of your own line 2 stay. Challenge 3 withholds the ladder's condition numbers, digits and relative changes; your own run at the current size stays. Challenge 5 withholds the condition numbers, every worst-nudge result, the digits at risk, the cloud, the inverse sizes, the bands and the error region; your nudged lines and crossing and your nudge's amplification and share stay. Challenge 4 withholds nothing: the frames with pivoting show the swap to imitate.
Validation and status logic
The status reads the first match in the list under Errors and warnings. The NOT VALID checks read only the inputs that apply, on the values entered: a blank or text in a numeric input fails its check, and the prediction is checked only in challenge 1. A challenge number that is not a whole number from 0 to 5 counts as no challenge. The CHECK items use the values in effect after a challenge has fixed its own, and apply inside challenges as well. The two no-pivoting CHECK items apply only with No pivoting selected; the status without pivoting is computed either way.
Assumptions and limitations
- Systems of size 2 to 7 (Hilbert, Vandermonde) or 2 to 4 (Custom); custom entries from -100 to 100; data errors from 10⁻⁸ to 10⁻¹; tiny entries from 10⁻²⁰ to 10⁻¹.
- A matrix whose condition number is above 1,000,000,000 is not solved for the learner.
- The data error is applied to the right-hand side only. The condition number also bounds, to first order, the effect of small errors in the matrix itself, which the lab does not apply.
- Answers of systems with a condition number near the cap carry rounding errors of about κ times 1.1×10⁻¹⁶ (up to about 1×10⁻⁷ relative at a billion), far below the change any offered data error makes. The solution table shows 8 decimals.
- The bands of the two dragged lines use their normalised equations; for Tiny pivot and Near-parallel, whose equations are not normalised, a band's offset is δ·σ divided by the length of that equation's coefficient vector.
- With partial pivoting a pivot of at most 1×10⁻¹⁴ · ‖A‖∞ counts as zero; without pivoting only an exact 0 does.
- A pivot within about a factor of 10 of the zero-pivot threshold, a condition number within about one part in ten thousand of the cap, or a value within about one part in a million of a challenge threshold may fall either side of it.
Restrictions and non-computing states
Under NOT VALID every result and every table is blank except the challenge status (No challenge selected, or NOT MET with a challenge selected), a score of 0, and the goal and hint of a selected challenge.
With two parallel lines every result is blank except the two lines, the settings used and the challenge texts. When partial pivoting finds no usable pivot, the condition number, the answers, the nudges, the cloud, the inverse, this run's ladder entry, the geometry beyond the two lines and the status without pivoting are blank, and the frames up to the failed step remain. Above the condition-number cap, the condition numbers, the digits at risk, the frames, the growth factors and the ladder remain, and the answers, amplifications, digits lost, nudges, cloud, inverse and geometry beyond the two lines are blank. With an all-zero right-hand side the answer (zero) and the condition number remain, and the relative change, the worst shift, the nudged residual, the change and nudged-answer columns, the cloud's relative changes and the bands, nudged lines and region are blank. When elimination without pivoting meets a zero pivot, its answer and the values derived from it are blank and its frames up to that step remain.
In challenges 1, 2, 3 and 5 the results listed under Challenges are held back until the challenge allows them.
Errors and warnings
The status messages, first match wins (k is the column or step concerned):
- NOT VALID: choose the matrix from the list
- NOT VALID: the system size must be a whole number from 2 to 7
- NOT VALID: the custom system size must be a whole number from 2 to 4
- NOT VALID: every entry of the custom system in use must be a number from −100 to 100
- NOT VALID: each line needs two different points inside the view, with coordinates from −5 to 5: a coordinate out of range, or a line's two snapped handles in the same place.
- NOT VALID: the tiny entry must be 10 to a whole power from −20 to −1
- NOT VALID: the data error must be 10 to a whole power from −8 to −1
- NOT VALID: choose whether elimination uses pivoting
- NOT VALID: the nudge position must be a whole number from 0 to 63
- NOT VALID: choose the equation order: challenge 4 only.
- NOT VALID: the challenge number must be a whole number from 0 to 5, and the amplification prediction blank or a number from 1 to 10,000,000,000
- CHECK: the two lines are parallel, so there is no single crossing; tilt one of them
- CHECK: elimination with partial pivoting found no usable pivot in column k, so the matrix is singular to working precision and no answer is shown
- CHECK: this matrix is too close to singular for this lab (condition number above a billion), so the answer is not shown
- CHECK: the right-hand side is all zeros, so the answer is zero and its relative change is not defined; move the crossing away from the origin or change the right-hand side
- CHECK: elimination without pivoting met a zero pivot at step k; switch pivoting on or change the equation order: No pivoting selected.
- CHECK: without pivoting the entries grew more than a hundred million times, so many digits of that answer may be wrong; compare it with partial pivoting: No pivoting selected, growth factor above 100,000,000.
- OK
References
This laboratory is an educational model of solving a linear system A x = b of size 2 to 7, from two lines in the plane to the Hilbert and Vandermonde matrices. Gaussian elimination runs step by step with partial pivoting, where the row with the largest entry in the pivot column is swapped up, and without pivoting, followed by back substitution. The inverse is built column by column from the stored factorisation, and the condition number ||A|| ||A^-1|| is reported in the infinity norm and the 1-norm. A relative data error of size 10^k is applied in one of 24 fixed directions, in a direction the learner sets, or in the worst direction, whose amplification equals the condition number, so digits are seen to be lost as the condition number grows. A tiny pivot shows the difference between a bad method and a bad problem, and the Hilbert ladder uses the exact integer inverse of the Hilbert matrix.
Sources and further reading
- How errors in the data of a linear system are amplified, Gaussian elimination with and without pivoting, and test matrices: N. J. Higham, Accuracy and Stability of Numerical Algorithms, 2nd edition, SIAM, 2002, chapter 7, Perturbation Theory for Linear Systems, chapter 9, LU Factorization and Linear Equations, and chapter 28, A Gallery of Test Matrices. doi:10.1137/1.9780898718027
- Conditioning and stability, and the solution of systems of equations, at an introductory level: L. N. Trefethen and D. Bau, Numerical Linear Algebra, twenty-fifth anniversary edition, SIAM, 2022, Part III, Conditioning and Stability, and Part IV, Systems of Equations. doi:10.1137/1.9781611977165
- The Hilbert matrix and its inverse with integer entries: M.-D. Choi, "Tricks or treats with the Hilbert matrix", The American Mathematical Monthly 90(5), 1983, pages 301-312. doi:10.1080/00029890.1983.11971218
No table or text from any of these publications is reproduced, and none of their authors or publishers has reviewed or endorses this laboratory.
This laboratory is for learning. Its results hold only within its stated ranges; it is not meant for engineering or scientific decisions, and it shows no answer for a system whose condition number passes its cap.
Found a problem, or have an idea?
Tell us if a result looks wrong, a label is unclear, or something is missing. We read every message.