Calculator
Paste a square matrix using commas or spaces. Rows may be separated by new lines or semicolons.
Example Data Table
These examples illustrate how condition numbers change with matrix structure.
| Matrix | Notes | Typical cond₁ | Typical cond₂ |
|---|---|---|---|
| [ [1, 2], [3, 4] ] |
Common 2×2; stable for many tasks. | ≈ 21 | ≈ 14.93 |
| Hilbert 3×3 | Classic example of a sensitive matrix. | ≈ 748 | ≈ 524.06 |
| [ [1, 2], [2, 4] ] |
Singular matrix; inversion is undefined. | ∞ | ∞ |
Formula Used
For a nonsingular square matrix A, the condition number (with respect to inversion) in a chosen norm is:
In the 2-norm, it is also expressed using singular values:
Larger values indicate greater sensitivity: small changes in inputs can cause large changes in outputs.
How to Use This Calculator
- Paste your square matrix into the Matrix A box.
- Select a norm (1, infinity, Frobenius, or spectral approximation).
- Set precision and, if needed, iterations for the 2-norm option.
- Click Calculate to view results above the form.
- Use the CSV or PDF buttons to export your report.
Why condition numbers matter
When you solve Ax=b or fit parameters from data, small measurement and rounding errors can amplify. The amplification is bounded by the condition number, so it works as a warning light for unstable computations. A value near 1 means the problem is well behaved, while large values signal that outputs may change dramatically for tiny input changes. In practice, this guides whether you should rescale features, switch methods, or improve input precision. This helps prevent costly numerical surprises in production.
What the calculator reports
This tool computes det(A), a matrix norm, an inverse norm, and cond(A)=||A||·||A⁻¹||. It also estimates digits lost using log10(cond). For example, cond≈10⁴ suggests up to four decimal digits of reliability can be lost when solving systems under typical floating point noise. Results are displayed with your chosen precision, and exports capture the same metrics for auditing.
Norm options and meaning
The 1‑norm is the maximum column sum and is useful when column scaling reflects units or feature magnitudes. The infinity norm is the maximum row sum and aligns with row‑scaled constraints and residual checks. The Frobenius norm summarizes overall energy across all entries and is easy to interpret for dense matrices. The spectral 2‑norm approximates σmax/σmin using power iteration on AᵀA, which is a common stability reference in numerical analysis.
Interpreting the sensitivity estimate
If your assumed relative input error is ε, the tool reports an upper bound cond·ε for relative output error. With ε=0.001 and cond=500, relative output error may reach 0.5, meaning a 2% target could drift toward 3%. This is not a guaranteed worst case for every vector b, but it is a conservative screening metric that flags risk before you rely on downstream decisions.
Practical actions for better stability
Start by checking for near‑singularity: very small pivots, det(A) near zero, or cond above 10⁶. Then try scaling rows and columns, using pivoted factorizations, or reformulating variables to reduce magnitude spread. For fitted models, add regularization, remove collinear features, or collect more diverse samples. Compare norms to see if sensitivity is driven by specific rows or columns, and export CSV or PDF to document assumptions and results for colleagues.
FAQs
1) What does the condition number measure?
It measures how sensitive a computed solution is to small changes in the matrix or inputs. Higher values indicate greater amplification of errors in tasks like solving linear systems or inverting matrices.
2) Why do I get an infinite or undefined value?
If the matrix is singular or nearly singular, A⁻¹ does not exist or is numerically unstable. The calculator detects tiny pivots during inversion and reports an undefined or extremely large condition number.
3) Which norm should I use for reporting?
Use the norm that matches your application: 1‑norm for column scaling, infinity norm for row scaling, Frobenius for overall magnitude, and 2‑norm when you want a standard spectral stability indicator.
4) Why is the 2‑norm marked as an approximation?
The spectral norm depends on singular values. This tool estimates them via power iteration on AᵀA and its inverse, which is fast and practical, but iterative methods can converge slowly for some matrices.
5) Can scaling reduce a large condition number?
Yes. Row and column scaling can reduce magnitude imbalance and improve numerical behavior, especially when entries vary across many orders of magnitude. However, scaling cannot fix true rank deficiency or exact linear dependence.
6) How should I interpret “digits lost”?
Digits lost is roughly log10(cond). If it is 6, you may lose about six digits of reliable precision in sensitive computations. It is a rule of thumb, not a strict guarantee for every right‑hand side.