Matrix
Basics
Mathematically an array or matrix is define by arranging numerical or symbolic elements. The elements are arranged in rows and columns and in a specific order. In its simplest form an array containing only one element is a scalar value. For example:
is a scalar representing a single number 2. Also note that matrices are typically denoted by boldface capital letters.
A vector is an array that contains only one row or column,
each containing multiple elements.
Note that vectors are two-dimensional arrays with
dimensions
For example:
is a horizontal vector with dimensions
On the other hand,
represents a vertical vector with three rows and one column and elements equal to 1, 2, and 3.
A matrix is a two-dimensional array that has a fixed number of rows and columns and
contains a number at the intersection of each row and column.
A matrix, like vectors and scalars,
is usually delimited by square brackets.
In general a matrix has dimensions of
In general, a matrix with dimensions of
where
Algebraic Operations
Addition and Subtraction
If
and
then
The same is true for subtraction, just apply a negative sign to the second matrix being subtracted.
Scalar Multiplication
Scalar multiplication seems different than just plain multiplication.
This is true, you can multiply matrices in different ways.
Scalar multiplication is the simplest form of matrix multiplication.
You take one matrix and multiply it by a single number.
Given the scalar
and the matrix
then their product is given by:
Matrix Multiplication
Things get more complicated when multiplying two matrices,
i.e. matrices both with more than one element in both rows and columns, together.
In this case,
the number of columns of the leftmost matrix must be equal to
the number of rows of the rightmost matrix.
If
For example, given
and
then their product is given by
You take the sum of products of the elements in the rows of the first matrix and the columns of the second matrix when determining the element in the product matrix of the first row and first column.
Dot Product
The dot product is one way of multiplying two vectors together. However the result of the dot product is a scalar. This scalar indicates the degree to which the two vectors are similar. Both in terms of magnitude and orientation. The dot product is also known as the scalar product or inner product. The dot product is defined as:
where