Introduction to Matrices
What are Matrices?
A matrix is a rectangular array of numbers, symbols, or expressions, arranged in rows and columns. It is a fundamental object in linear algebra and appears in many areas of mathematics and applied sciences.
⎡a₁₁ a₁₂ … a₁n⎤
⎢a₂₁ a₂₂ … a₂n⎥
⎢ ⋮ ⋮ ⋱ ⋮ ⎥
⎣am₁ am₂ … amn⎦
Basic Operations
- Addition: Element‑wise addition of two matrices of the same dimensions.
- Scalar Multiplication: Multiply each entry by a constant.
- Matrix Multiplication: The dot product of rows of the first matrix with columns of the second.
Example of matrix multiplication:
// Multiply A (2×3) by B (3×2)
A = [[1,2,3],
[4,5,6]];
B = [[7,8],
[9,10],
[11,12]];
// Result C = A·B (2×2)
C = [[58, 64],
[139,154]];
Determinant
The determinant is a scalar value that can be computed from the elements of a square matrix. For a 2×2 matrix:
det([[a,b],
[c,d]]) = a·d - b·c
It provides information about the matrix such as invertibility.
Inverse Matrix
A matrix A has an inverse A⁻¹ if and only if it is square and its determinant is non‑zero. For a 2×2 matrix:
A⁻¹ = (1/det(A)) * [[d, -b],
[-c, a]]
Try the interactive calculator below:
Applications
Matrices are used in:
- Computer graphics (transformations)
- Systems of linear equations
- Markov chains
- Machine learning (weight matrices)