# Determinants

##### Linear Algebra

Some matrix operations and theory apply to special types of matrices, so it is good to be aware of them.

In this article, we will try to provide a comprehensive overview of the various types of matrices. We will also comment on the desirability of certain matrix types.

## Prerequisites

To understand determinants, we recommend familiarity with the concepts in

Follow the above links to first get acquainted with the corresponding concepts.

### Determinants

In the inverse matrix recovery demo, you must have noticed that the space collapses, and is irrecoverable, if the two row vectors of the matrix $\mA$ are perfectly aligned, either in the same direction or opposite. (Try it if you haven't noticed that already)

Let's think of this from a visual perspective. Imagine a parallelogram described by the row vectors of the matrix $\mA$. This parallelogram has area.

When one row vector of the matrix is a scaled version of another, the parallelogram has no area.

And when that is the case, the matrix is not invertible.

In more than two dimensions, this idea can be generalized to a parallelopiped with volume. If the parallelopiped defined by the row vectors of a matrix has zero volume in $n$-dimensional space, then the matrix is not invertible.

This area or more generally volume is called the determinant of the matrix. A matrix with zero determinant is not invertible. Matrices with zero determinants are known as singular matrices.

Imagine a two-dimensional matrix $\mA$

$$\mA = \begin{bmatrix} a & b \\ c & d \\ \end{bmatrix}$$

It's determinant, or area of the corresponding parallelogram, denoted by $| \mA | = ad - bc$. (Verify this to understand it)

As a special case, it is easy to verify that the volume or determinant of a diagonal matrix in any number of dimensions is a simple product of its diagonal elements. Thus, if any diagonal element is zero, the matrix has a zero volume or zero determinant. Consequently, a square diagonal matrix is not invertible if any diagonal element is zero.

It should be obvious that being a volume or area, a determinant is only defined for square matrices. (Think why).

Now, despite being an area the determinant is not always positive. For example, the determinant of an orthogonal matrix is either $+1$ or $-1$.

In the next demo, check out the imaginary parallelogram described by the rows of the matrix. Note how the area changes, in sign and magnitude as you modify the matrix.

## Visualizing determinants: A demo

In the following interactive, we show a $2 \times 2$ matrix. The row vectors of the matrix are represented as arrows, similar to our treatise on the geometry of vectors.

Each row vector is an arrow, with the tail at the origin, and the head at the value of the vector.

A similar geometric interpretation can be imagined for an $n$-dimensional square matrices, in an $n$-dimensional space.

## Where to next?

In this section, we have merely defined the various matrix types. To really build intuition about what these actually mean, we first need to understand the effect of multiplying a particular type of matrix. We present this in matrix as a transformer.

You may also choose to explore other advanced topics linear algebra.

Already feeling like an expert in linear algebra? Move on to other advanced topics in mathematics or machine learning.