Matrix Operations Calculator
Run bounded matrix arithmetic and linear solves with dimension checks, then review pivot tolerance, residuals and condition evidence.{{ summaryTitle }}
{{ summaryLine }}
{{ primaryCopyAnnouncement }}
{{ analysis.result_text }}
- {{ row.label }}
- {{ row.value }}
The chart renderer is unavailable. The same cell values remain available in the matrix result.
| Check | Value | Meaning | Copy |
|---|---|---|---|
| {{ row.label }} | {{ row.value }} | {{ row.meaning }} |
A matrix organizes numbers by row and column so a whole system can be transformed at once. The shape is part of the mathematics. Two matrices can be added only when both shapes match, while multiplication links the columns of the first matrix to the rows of the second.
Some operations answer structural questions rather than producing another same-shaped grid. A determinant indicates whether a square matrix is singular and how it scales oriented area or volume. Rank counts independent directions at a chosen numerical tolerance. An inverse or solution exists uniquely only when the coefficient matrix is square and full rank.
| Operation | Dimension requirement | Result |
|---|---|---|
| Add or subtract | A and B have identical rows and columns | The same shape as A and B. |
| Multiply A × B | Columns of A equal rows of B | Rows of A × columns of B. |
| Transpose A | Any rectangular A | Rows and columns exchanged. |
| Determinant or inverse | A is square | A scalar determinant or square inverse. |
| Rank | Any rectangular A | A scalar pivot count. |
| Solve A × X = B | A is square; B has the same row count | One solution column for each column of B. |
Exact-looking input does not guarantee an exact floating-point result. Near-dependent rows can make a matrix numerically singular even when its determinant is not symbolically zero. A pivot tolerance decides which small values count as zero, and an ill-conditioned matrix can magnify tiny input or rounding changes into large changes in an inverse or solution.
For learning, checking small examples, and exploring numerical behavior, the result, rank, residual, and condition estimate belong together. Sensitive scientific, engineering, or financial work should reproduce the calculation in validated numerical software with appropriate precision and error analysis.
How to Use This Tool:
Choose the operation first so the required matrix shapes are clear before entering values.
- Select Operation. Matrix B appears only for multiplication, addition, subtraction, and solving A × X = B.
- Enter Matrix A with one row per line and spaces or commas between values. Semicolons may also separate rows.
- Enter Matrix B when required and match the dimension rule shown for the selected operation.
- Leave Pivot tolerance at 0 for a scale-aware automatic threshold. Use a positive override only when you understand how it changes rank and singularity decisions.
- If no result appears, fix the first reported shape, rectangularity, finite-number, or singularity error. Matrices are limited to 6 rows and 6 columns.
- Read the matrix or scalar result together with Rank A, effective tolerance, condition estimate, and any reconstruction residual before copying the answer.
Interpreting Results:
The displayed matrix is the answer for the selected operation. The heatmap helps locate large positive and negative cells, but color is not evidence of numerical accuracy. Use the audit values to decide how much confidence to place in the digits.
- Effective tolerance is the pivot threshold used for rank and singularity decisions. Raising it can reduce the reported rank or make inverse and solve unavailable.
- Rank A is the number of accepted pivots. A square matrix needs full rank for a unique inverse or solution.
- Reconstruction residual is ‖A × A−1 − I‖∞ for an inverse or ‖A × X − B‖∞ for a solve. Smaller is better, but scale and conditioning still matter.
- Condition estimate measures sensitivity for square invertible A. A large value means small input changes or rounding can cause much larger result changes.
A zero residual in displayed precision does not prove an exact symbolic answer. Verify ill-conditioned, high-magnitude, or consequential results with independent software and a precision level suited to the data.
Technical Details:
Entry-wise arithmetic and transpose are direct transformations. Multiplication uses row-by-column dot products. Rank, determinant, inverse, and solving use Gaussian elimination or LU factorization with partial pivot selection, so pivot size and rounding affect the result.
Formula Core:
For compatible matrices, the core element rules are:
In multiplication, p is the shared inner dimension. Solving and inversion require a nonsingular square A. A determinant is the sign from row interchanges multiplied by the diagonal pivots of the LU factorization.
Mechanism Core:
Partial pivoting chooses the largest available magnitude in the current column and swaps that row into the pivot position. Elimination then produces lower- and upper-triangular factors. The same factorization supports determinant, inverse, and solve calculations.
Here d is the largest active matrix dimension, ε is Binary64 machine epsilon, and the maximum covers the absolute entries of the matrices used by the operation. A positive tolerance override replaces this automatic value.
| Condition estimate | Status | Interpretation |
|---|---|---|
| < 108 | Stable | Suitable for bounded exploration, with independent verification for sensitive use. |
| ≥ 108 and < 1012 | Caution | Small input changes may materially affect the result. |
| ≥ 1012 | Severe | Verify displayed digits with an independent numerical package. |
| Singular at tolerance | Singular | Inverse is unavailable and A × X = B has no unique solution under that threshold. |
Inputs are bounded to 1 to 6 rows and columns, 1,200 source characters per matrix, finite entries with magnitude at most 10100, and a tolerance from 0 to 1. Results use Binary64 floating-point arithmetic and are formatted to about 11 significant digits.
Accuracy Notes:
- This is bounded numeric arithmetic, not symbolic or arbitrary-precision algebra.
- Eigenvalues, singular-value decomposition, least-squares solutions, sparse matrices, and complex numbers are not included.
- A tolerance is an interpretation choice. It can change rank, determinant treatment, and whether inverse or solve succeeds.
- Residual and condition evidence help expose risk but do not provide a formal error bound for every result cell.
Worked Examples:
Matrix multiplication
Multiplying A = [[1, 2], [3, 4]] by B = [[5, 6], [7, 8]] gives [[19, 22], [43, 50]]. Each output cell is one row of A dotted with one column of B.
Solving two equations
For A = [[3, 1], [1, 2]] and B = [[9], [8]], solving A × X = B gives X = [[2], [3]]. With a 10−12 tolerance, the reconstruction residual is 0 in Binary64 arithmetic and the infinity-norm condition estimate is 3.2.
References:
- DGETRF: LU factorization with partial pivoting, LAPACK and Netlib.
- numpy.linalg.solve, NumPy documentation.
- Error bounds for linear equation solving, LAPACK Users' Guide.