Matrices

Learn about matrices and their usage in analyzing linear systems.

What is a matrix?

A matrix is a two-dimensional array of objects. An element of a matrix can be an object of any type. However, most problems in data science need matrices with only real numbers as their elements. Therefore, we’ll also work with matrices that only have real numbers as their elements, unless stated otherwise. A matrix is typically denoted as an uppercase letter with subscripts. The subscripts describe the order of the matrix. For example, a matrix of order m×nm \times n can be denoted as Am×nA_{m \times n}. Here, mm is the number of rows and nn is the number of columns. For example, a two-dimensional array with three rows and two columns is denoted as A3×2A_{3 \times 2}.

An element of a matrix is denoted by aija_{ij} where ii and jj are the respective row and column indices. So, a generic representation of a matrix is as follows:

Am×n=[a11a12a1na21a22a2nam1am2amn]A_{m \times n} = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix}

Types of matrices

Matrices are characterized into different types based on certain properties. Below is a list of the most common ones.

Row matrix

A matrix with only one row is called a row matrix, like the one below:

x=[a11a12a13a1n]\bold{x}=\begin{bmatrix} a_{11} & a_{12} & a_{13} & \cdots & a_{1n} \end{bmatrix}

Column matrix

A matrix with only one column is called a column matrix, like the one below:

z=[a11a21a31am1]\bold{z}=\begin{bmatrix} a_{11} \\ a_{21} \\ a_{31} \\ \vdots \\ a_{m1} \end{bmatrix} ...