Linear systems

GUIDING QUESTION: What is a linear system and what does a matrix have to do with it?

What is a matrix?

A matrix is a rectangular array of real numbers.
Matrices help us organize information. They are ubiquitous in mathematics and applications.
The entries of a matrix could be taken in any field, or more generally, any ring. In this course we'll only consider matrices with real entries.
In this context we define a vector as a matrix with a single column.
(Clothing Store) The following paragraph describing store inventory can be conveniently summarized in a matrix.
Your clothing store currently has 5 small T-shirts, 3 medium T-shirts, 4 large pants, 1 small sweater, 10 large sweaters, and 3 X-Large sweaters.
\begin{equation} \begin{bmatrix} \text{Small} & \text{Medium} & \text{Large} & \text{X-Large} \\ 5 & 3 & 0 & 0\\ 0 & 0 & 4 & 0\\ 1 & 0 & 10 & 2\\ \end{bmatrix} \end{equation}
Each column corresponds to a size (S, M, L, XL) and each row corresponds to a product (T-shirts, pants, sweaters).

Size

The entries of a matrix are called elements. We say that a matrix with $n$ rows and $m$ columns is $n \times m$.

We refer to the element in the $i$th row and $j$th column of the matrix $A$ by $a_{\color{var(--emphColor)}{ij}}$.

By convention the row index always comes first!

As an array of elements

A matrix is determined by its elements, so specifying an $\color{var(--emphColor)}{n} \times \color{var(--emphColor)}{m}$ matrix $A$ is the same thing as specifying each $a_{ij}$, for $1 \leq i \leq \color{var(--emphColor)}{n}$ and $1 \leq j \leq \color{var(--emphColor)}{m}$.

Matrix math

Matrices are algebraic objects and as such we can perform operations with/on them.

(New inventory) Suppose 1 large T-shirt, 3 small pants, 4 large pants and 7 medium sweaters are shipped to the store. Which matrix defines the new inventory?

Matrix addition

(New inventory) Suppose 1 large T-shirt, 3 small pants, 4 large pants and 7 medium sweater are shipped to the store. Which matrix defines the new inventory?
Arrange the new inventory into a matrix and add it to the old inventory: \begin{equation} \begin{bmatrix} 5 & 3 & 0 & 0\\ 0 & 0 & 4 & 0\\ 1 & 0 & 10 & 2\\ \end{bmatrix} + \begin{bmatrix} 0 & 0 & 1 & 0\\ 3 & 0 & 4 & 0\\ 0 & 7 & 0 & 2\\ \end{bmatrix} = \begin{bmatrix} 5 & 3 & 1 & 0\\ 3 & 0 & 8 & 0\\ 1 & 7 & 10 & 2\\ \end{bmatrix}. \end{equation}
Since we've arranged both arrays in the same way, we may simply add corresponding entries together to obtain the correct result!
Addition requires the arrays to have the same number of rows and columns, and we compute it component-wise: each entry in the sum array is the sum of corresponding entries in the summands.

Matrix Addition

Our motivating example suggests the following definition.
If $A$ and $B$ are $\color{var(--emphColor)}{n \times m}$ matrices, then the sum $A + B$ is an $\color{var(--emphColor)}{n \times m}$ matrix given by $$(A+B)_{ij} = a_{ij} + b_{ij}.$$