What it is
The online service for multiplying a matrix by a number lets you calculate the product of a matrix of the size you need and a number, and shows how each element is obtained.
A matrix is a mathematical object written as a rectangular table of numbers that allows algebraic operations (addition, subtraction, multiplication) between it and other similar objects.
How it is calculated
The result of multiplying a matrix Am×p by a number B is a matrix Cm×p, each element of which equals the product of the corresponding element of A and the number B: cij = B · aij. The size does not change and there are no size restrictions — any rectangular matrix will do.
Example
Multiply a 2×3 matrix by 2.5:
| A | ||
|---|---|---|
| 1 | −2 | 0 |
| 3 | 4 | 5 |
| C = 2.5·A | ||
|---|---|---|
| 1·2.5 = 2.5 | −2·2.5 = −5 | 0·2.5 = 0 |
| 3·2.5 = 7.5 | 4·2.5 = 10 | 5·2.5 = 12.5 |
In the calculator this is A = {2,3,1,-2,0,3,4,5} and B = 2.5.
Properties
- The order does not matter: B·A = A·B (unlike multiplying two matrices).
- Distributive laws: B·(A + C) = B·A + B·C and (B + k)·A = B·A + k·A.
- (B·k)·A = B·(k·A); 1·A = A; 0·A is the zero matrix; (−1)·A is the opposite matrix −A.
- For a square n×n matrix the determinant is multiplied by Bn: det(B·A) = Bn·det A.
- Dividing a matrix by a number is multiplying by its reciprocal: A / 4 = 0.25·A.
Where it is used
- Economics and accounting — rescaling a table of prices or volumes: a 20% price rise is multiplication by 1.2, currency conversion is multiplication by the exchange rate.
- Scaling in graphics — uniform enlargement of a shape by k; the matrix k·E is a scaling matrix.
- Image processing — brightness changes (pixels times a factor), normalising a filter kernel: a 3×3 box-blur kernel of ones is multiplied by 1/9.
- Statistics — the covariance matrix is (1/(n−1))·XT·X for centred data.
- Machine learning — a gradient descent step subtracts the gradient times the learning rate from the weights.
- Physics and units — converting a whole table (e.g. centimetres to metres is multiplication by 0.01).
- Linear algebra — intermediate steps of Gaussian elimination, computing A − λE when finding eigenvalues.
How to use
- Set the size of A with the add/remove row and column buttons and fill in the cells (fractions and expressions work).
- Enter the number B — integer, fractional or negative.
- The matrix can also be entered as a string
{rows,cols,elements…}in the field below the editor. - The result C, the detailed entry for each element and the link to the calculation appear automatically.