Multiply two matrices of compatible dimensions. Enter custom values, change dimensions on the fly, and see the product matrix instantly. Includes step‑by‑step interpretation, real‑world use cases, and advanced linear algebra insights.
Matrix multiplication is a fundamental operation in linear algebra where two matrices are combined to produce a third matrix. Given A of size m × n and B of size n × p, the product C = A·B is an m × p matrix where each entry cij = Σk=1..n aik · bkj (the dot product of row i of A and column j of B). Unlike scalar multiplication, matrix multiplication is not commutative (A·B ≠ B·A generally), but it is associative and distributive.
(A × B)ij = ∑k=1n Aik · Bkj
Row i of A combined with column j of B via dot product.
The classical matrix multiplication algorithm runs in O(m·n·p) time. For square matrices of size n, complexity is O(n³). However, the Strassen algorithm and Coppersmith–Winograd approach achieve better asymptotic bounds for very large matrices. Our calculator uses the standard triple‑loop method, ideal for small‑to‑medium sized matrices (up to 6×6) with high numerical precision using double-precision floating point.
In a simple dense layer, output = activation(W·X + b). For a batch of 128 samples and a hidden layer of 256 neurons, the weight matrix size is 256×previous_dim. Our calculator reproduces the core matrix‑vector operation logic — essential for understanding model inference.
| Property | Description |
|---|---|
| Associativity | (A·B)·C = A·(B·C) |
| Distributivity | A·(B + C) = A·B + A·C |
| Non‑commutative | In general A·B ≠ B·A |
| Identity matrix | I·A = A·I = A |
| Zero matrix | 0·A = 0 |