Matrix Condition Number Calculator
Enter matrix values.

What Is a Condition Number?

The condition number of a matrix is a measure of how sensitive its solutions are to perturbations in the input. If you solve Ax=b and the matrix A has a large condition number, even tiny errors in b or in the matrix entries can lead to significant errors in the computed solution x. 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.

2-Norm Condition Number

One common definition of the condition number uses the matrix 2-norm, which is tied to singular values. For an invertible matrix A, the 2-norm condition number is defined as

\kappa_2A=\sigma_{\max}\sigma_{\min}

where \sigma_{\max} and \sigma_{\min} are the largest and smallest singular values of A. 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.

Computation Strategy

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 \kappa_2. 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.

Why It Matters

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 \kappa_2 provides insight into algorithmic reliability across these applications.

Related Calculators

Spectral Decomposition Calculator - Diagonalize Symmetric Matrices

Compute eigenvalues and eigenvectors of a symmetric 2x2 matrix and display its spectral decomposition.

spectral decomposition calculator symmetric matrix eigenvalues eigenvectors

Tetration Calculator

Evaluate power towers like a^^b for small integer heights.

tetration calculator power tower

Conjugate Gradient Solver - Efficient SPD Linear Systems

Approximate solutions of symmetric positive-definite systems using the conjugate gradient algorithm.

conjugate gradient calculator iterative linear solver SPD matrix