Condition Number Calculator
Solve condition number problems step-by-step with our free calculator. See formulas, worked examples, and clear explanations.
Reviewed for accuracy by Manoj Kumar, Mathematics Educator
Condition Number Calculator
Calculator
Adjust values & calculateEnter your values below. Every result is computed in your browser โ no data is sent to any server.
Formula: cond(A) = ||A|| * ||A^(-1)|| or cond_2(A) = sigma_max / sigma_min
Worked example โ Condition number = 1 (perfectly conditioned)
Formula
cond(A) = ||A|| * ||A^(-1)|| or cond_2(A) = sigma_max / sigma_min
The condition number is the product of the matrix norm and its inverse norm. For the 2-norm, it equals the ratio of the largest to smallest singular values. A condition number near 1 indicates stability, while a large value indicates the system is sensitive to perturbations.
Worked Examples
Example 1: Well-Conditioned Matrix
Problem:Find the condition number of A = [[1, 0], [0, 1]] (identity matrix).
Solution:The identity matrix has singular values sigma1 = 1, sigma2 = 1. Condition number (2-norm) = sigma1/sigma2 = 1/1 = 1. The inverse is also the identity, so all norms give condition number = 1. This is the best possible conditioning.
Result:Condition number = 1 (perfectly conditioned)
Example 2: Ill-Conditioned Matrix
Problem:Find the condition number of A = [[1, 2], [3, 4]].
Solution:Determinant = 1(4) - 2(3) = -2 Inverse = [[-2, 1], [1.5, -0.5]] Frobenius norm of A = sqrt(1+4+9+16) = sqrt(30) Frobenius norm of inverse = sqrt(4+1+2.25+0.25) = sqrt(7.5) Condition (Frobenius) = sqrt(30) * sqrt(7.5) = sqrt(225) = 15 2-norm condition = sigma_max/sigma_min = 5.465/0.366 = 14.933
Result:Condition number (2-norm) = 14.93 | Well-conditioned
Frequently Asked Questions
What is the condition number of a matrix?
The condition number of a matrix measures how sensitive the solution of a linear system Ax = b is to small changes in A or b. It is defined as the product of the norm of A and the norm of its inverse. A condition number close to 1 means the matrix is well-conditioned and the solution is stable. A large condition number means the matrix is ill-conditioned and even tiny perturbations in the input can cause large changes in the output. The condition number is always greater than or equal to 1, and it equals 1 only for orthogonal matrices (in the 2-norm).
How is the condition number calculated?
The condition number depends on the matrix norm chosen. For the 2-norm, it is the ratio of the largest to smallest singular values of the matrix. For the Frobenius norm, it equals the product of the Frobenius norms of the matrix and its inverse. For the 1-norm, it uses maximum absolute column sums, and for the infinity-norm, maximum absolute row sums. The 2-norm condition number is most commonly used because it has a direct geometric interpretation in terms of how much the matrix stretches or compresses vectors. Each norm gives a slightly different condition number, but they all convey similar information about sensitivity.
What does a high condition number mean?
A high condition number indicates that the matrix is ill-conditioned, meaning that the solution to Ax = b is highly sensitive to perturbations. In floating-point arithmetic, you can expect to lose roughly log10(condition number) digits of accuracy in the computed solution. For example, if the condition number is 10^6 and you use double precision (about 16 significant digits), the solution may only be accurate to about 10 digits. In practical applications, a condition number above 10^12 or so means the computed solution may be completely unreliable. High condition numbers arise when the matrix is close to being singular.
What is the difference between the condition number and the determinant?
While both relate to matrix invertibility, they measure different things. The determinant tells you whether a matrix is singular (zero determinant) or not, but a nonzero determinant does not guarantee good conditioning. A matrix can have a large determinant and still be ill-conditioned, or a small determinant and be well-conditioned. The condition number provides a quantitative measure of how close the matrix is to being singular in a meaningful numerical sense. For numerical computation, the condition number is far more informative than the determinant about the reliability of solving linear systems.
How does the condition number affect numerical computations?
In numerical linear algebra, the condition number is critical for understanding the accuracy of computed solutions. When solving Ax = b using floating-point arithmetic, the relative error in the solution x is bounded by the condition number times the relative error in the input data. This means that for a condition number of 1000, a 0.001% error in the input could produce up to a 1% error in the output. Iterative solvers may converge slowly for ill-conditioned systems. Preconditioning techniques are specifically designed to reduce the effective condition number and improve both accuracy and convergence speed.
What is a well-conditioned matrix?
A well-conditioned matrix has a condition number close to 1, indicating that the linear system Ax = b can be solved accurately and the solution is not overly sensitive to perturbations. Orthogonal matrices have a 2-norm condition number of exactly 1, making them the best-conditioned matrices. Diagonal matrices with entries of similar magnitude are also well-conditioned. In practice, a condition number below 100 is generally considered well-conditioned, between 100 and 10000 is moderate, and above 10000 may require special care. The condition number depends on the scaling of the matrix, so proper scaling can improve conditioning.
What are singular values and how do they relate to the condition number?
Singular values are the square roots of the eigenvalues of A-transpose times A, and they represent the stretching factors of the matrix transformation along orthogonal directions. Every matrix has a singular value decomposition (SVD), and the singular values are always non-negative real numbers. The largest singular value measures the maximum stretching, and the smallest measures the minimum. The 2-norm condition number is simply the ratio of the largest to the smallest singular value. When the smallest singular value is close to zero, the condition number is large, indicating near-singularity and numerical instability.
Can the condition number be improved or reduced?
Yes, several techniques can improve the effective condition number of a system. Preconditioning involves multiplying the system by a carefully chosen matrix to reduce the condition number before solving. Row and column scaling (equilibration) adjusts the matrix so that entries have similar magnitudes. Pivoting strategies in Gaussian elimination help avoid numerical instability caused by ill-conditioning. In some cases, regularization techniques like Tikhonov regularization add a small amount to the diagonal, trading a small bias for greatly improved stability. Choosing appropriate coordinate systems or variable transformations can also reduce conditioning issues.
Why do different norms give different condition numbers?
Different matrix norms measure the size of a matrix in different ways, leading to different condition number values. The 1-norm focuses on columns (maximum absolute column sum), the infinity-norm focuses on rows (maximum absolute row sum), the 2-norm uses singular values, and the Frobenius norm considers all entries equally. These norms are all equivalent up to constant factors depending on the matrix dimensions. For an n-by-n matrix, the different condition numbers are within a factor of n of each other. The 2-norm condition number is generally preferred because it has the tightest bound on solution sensitivity and a clear geometric meaning.
What are some practical applications of the condition number?
The condition number is widely used in engineering, science, and data analysis. In finite element analysis, ill-conditioned stiffness matrices indicate potential numerical problems in structural simulations. In signal processing, the condition number of correlation matrices affects the stability of filter design. In machine learning, the condition number of the feature covariance matrix influences the convergence speed of gradient descent and the reliability of linear regression. In control theory, condition numbers help assess the robustness of control system designs. GPS positioning systems use geometric dilution of precision, which is closely related to the condition number of the satellite geometry matrix.
References
Reviewed for accuracy by Manoj Kumar, Mathematics Educator ยท Editorial policy
Related Calculators
๐งฎSum of a Linear Number Sequence Calculator
Calculate sum of alinear number sequence with inputs, formulas, and instant results.
๐งฎComplex Number Calculator
Calculate complex number with inputs, formulas, and instant results.
๐งฎPrime Number Calculator
Calculate prime number with inputs, formulas, and instant results.
๐งฎAbundant Number Checker
Calculate abundant number checker with inputs, formulas, and instant results.
๐งฎDeficient Number Checker
Calculate deficient number checker with inputs, formulas, and instant results.
๐งฎImproper Fraction to Mixed Number Calculator
Calculate improper fraction to mixed number with inputs, formulas, and instant results.
๐งฎMixed Number Calculator
Calculate mixed number with inputs, formulas, and instant results.
๐งฎMixed Number to Improper Fraction Calculator
Calculate mixed number to improper fraction with inputs, formulas, and instant results.