Courses / Mathematics I
Scientific Programming

Solving Linear Systems Numerically

Solving Ax = b is one of the most common tasks in scientific computing — arising in simulations, data fitting, and optimization, often with thousands or…

Mathematics I 388 words Free to read

Linear Systems at Scale

Solving Ax=bA\mathbf{x} = \mathbf{b} is one of the most common tasks in scientific computing — arising in simulations, data fitting, and optimization, often with thousands or millions of unknowns. The theory (Unit 3) says to use Gaussian elimination; making it work reliably at scale is the numerical challenge.

The direct method row-reduces AA to triangular form and back-substitutes, at a cost of about 23n3\frac{2}{3}n^3 operations for an n×nn \times n system — cubic, so doubling nn multiplies the work eightfold. For very large or sparse systems, iterative methods (Jacobi, Gauss–Seidel, conjugate gradient) instead refine an approximate solution step by step, often far cheaper.

A crucial numerical refinement is pivoting. Plain Gaussian elimination divides by the pivot element; if a pivot is zero, it fails, and if a pivot is merely small, dividing by it amplifies round-off error catastrophically. Partial pivoting — swapping rows to put the largest available entry on the pivot — avoids both, making the elimination numerically stable. It is essential in practice, not optional.

Even with a perfect algorithm, some systems are inherently hard. The condition number of AA measures how sensitive the solution is to small changes in AA or b\mathbf{b}:

For an ill-conditioned system, no algorithm can deliver an accurate answer from imprecise data — the problem itself amplifies error. Recognizing conditioning tells you whether a computed solution can be trusted.

Common pitfall: blaming a wildly wrong solution on the algorithm when the problem is ill-conditioned. A large condition number means the solution is intrinsically hyper-sensitive to input error — nearly parallel equations whose intersection shifts enormously with tiny data changes. Even a perfect, stable solver cannot rescue an ill-conditioned system from imprecise inputs; the error lives in the problem, not the method. (And use pivoting — dividing by a small pivot is a self-inflicted instability.)

Two nearly parallel lines whose accent intersection point slides far along the lines when one is nudged slightly, beside two perpendicular lines whose intersection barely moves — ill- versus well-conditioning.

large condition numbersensitive solution\text{large condition number} \Rightarrow \text{sensitive solution}

Solving Linear Systems Numerically

Practise this lesson

The explanation above is free to read. The graded practice for this lesson lives in the Tryals app.

11practice questions
2interactive scenes
Start Mathematics I free

Scientific Programming