The condition number of a matrix is a measure of how sensitive its solutions are to perturbations in the input. If you solve and the matrix has a large condition number, even tiny errors in or in the matrix entries can lead to significant errors in the computed solution . In numerical linear algebra, well-conditioned matrices are desirable because they produce reliable, stable answers. Poorly conditioned matrices might amplify rounding errors so drastically that the results become meaningless.
One common definition of the condition number uses the matrix 2-norm, which is tied to singular values. For an invertible matrix , the 2-norm condition number is defined as
where and are the largest and smallest singular values of . A condition number near one indicates a stable matrix, while a very large value signals that small relative perturbations could produce large relative changes in the solution.
This calculator accepts a 2×2 or 3×3 matrix. It uses math.js
to perform singular value decomposition (SVD), extracting singular values to compute . If you omit the last row and column, it treats the input as 2×2. SVD is robust and works for real or complex entries, though here we focus on real numbers for simplicity.
After computing the singular values, the script divides the largest by the smallest. If the smallest value is close to zero, the matrix is nearly singular, and the condition number will be very large. Interpreting this number helps predict how errors propagate through linear systems and matrix inversion.
Engineers and scientists routinely solve linear systems when modeling physical processes or analyzing data. If a matrix is poorly conditioned, algorithms like Gaussian elimination can produce inaccurate results. Even when using double-precision arithmetic, rounding errors may be magnified by orders of magnitude. By checking the condition number first, you can decide whether to reformulate the problem, precondition the matrix, or use more stable techniques.
The concept extends beyond solving equations. Condition numbers appear in eigenvalue computations, optimization, and differential equations, wherever matrices approximate complicated operators. Understanding how to compute and interpret provides insight into algorithmic reliability across these applications.
Compute eigenvalues and eigenvectors of a symmetric 2x2 matrix and display its spectral decomposition.
Evaluate power towers like a^^b for small integer heights.
Approximate solutions of symmetric positive-definite systems using the conjugate gradient algorithm.