A matrix is denoted by a grid of numbers surrounded by two brackets.

In math, a matrix is a function that maps between two vector spaces. A matrix can also be thought of as a shorthand way to write a system of linear equations. For example, the matrix shown below takes in a vector of size 3 as input and produces a vector of size 2 as output.

Note, the variables represent the coefficients that define the function. The number of columns of the matrix corresponds with the size of the input vector and the number of rows corresponds with the size of the output vector. The same matrix can be written as a system of linear equations.

System of Linear Equations

To express the input and output of the matrix the input vector is placed to the right of the matrix and then the output vector is the result of applying the matrix to .

A matrix with an input and an output


Matrix Multiplication

Matrix Multplication of 2 by 3 matrix with 3 by 2 matrix.

Matrix multiplication is the process of composing two matrices together. Multiplying two matrices together is analogous to composing two functions together. This is why the number of rows in the left matrix must be equal to the number of columns in the second matrix; the output of the first matrix feeds into the second matrix as input.

The number of columns in a matrix corresponds to the size of the input and the number or rows cooresponds to the size of the output.