What is the matrix condition number?
The condition number \(\kappa(A)\) measures how sensitive the solution of a linear system \(Ax = b\) is to small changes (errors) in the data. A small condition number (close to 1) means the matrix is well-conditioned and numerically stable; a large condition number means it is ill-conditioned, so tiny input errors can produce large output errors. The spectral or 2-norm condition number equals the ratio of the largest singular value to the smallest singular value: \(\kappa_2(A) = \sigma_{\max} / \sigma_{\min}\).
How to use this calculator
Enter the four entries of your 2×2 matrix A (\(a_{11}\), \(a_{12}\), \(a_{21}\), \(a_{22}\)) and the calculator returns the 2-norm condition number along with the two singular values and the determinant. If the smallest singular value is zero the matrix is singular and the condition number is infinite.
The formula explained
For any matrix, \(\kappa(A) = \lVert A \rVert \cdot \lVert A^{-1} \rVert\). Using the 2-norm, \(\lVert A \rVert = \sigma_{\max}\) and \(\lVert A^{-1} \rVert = 1/\sigma_{\min}\), giving \(\kappa_2(A) = \sigma_{\max}/\sigma_{\min}\). The singular values are the square roots of the eigenvalues of \(A^{T}A\). For a 2×2 matrix we form \(M = A^{T}A\), compute its eigenvalues, and take \(\sigma = \sqrt{\lambda}\).
$$\kappa(A) = \frac{\sigma_{\max}}{\sigma_{\min}} = \sqrt{\frac{\lambda_{\max}}{\lambda_{\min}}}$$
$$\lambda = \frac{\operatorname{tr} \pm \sqrt{\operatorname{tr}^2 - 4\cdot\det}}{2}$$
Worked example
Take \(A = \begin{bmatrix} 2 & 0 \\ 0 & 1 \end{bmatrix}\). Then \(A^{T}A = \begin{bmatrix} 4 & 0 \\ 0 & 1 \end{bmatrix}\), whose eigenvalues are 4 and 1. The singular values are \(\sigma_{\max} = 2\) and \(\sigma_{\min} = 1\), so $$\kappa_2(A) = \frac{2}{1} = 2.$$ This matrix is very well-conditioned.
FAQ
What is a "good" condition number? Values near 1 are ideal. As a rough rule, \(\log_{10}(\kappa)\) tells you roughly how many digits of accuracy you may lose when solving the system.
Why is my condition number infinite? The matrix is singular (determinant 0), so \(\sigma_{\min} = 0\) and \(A^{-1}\) does not exist.
Which norm does this use? The 2-norm (spectral) condition number, based on singular values. Other norms (1-norm, \(\infty\)-norm) can give different numeric values.