The objects of study in linear algebra are linear operators. We have seen that linear operators can be represented as matrices through choices of ordered bases, and that matrices provide a means of efficient computation. We now begin an in depth study of matrices.
Definition: matrix, Column and Row Vectors An \(r \times k\) matrix \(M=(m^_)\) for \(i=1, \ldots, r; j=1, \ldots, k\) is a rectangular array of real (or complex) numbers: \[M =
\begin
m_^ & m_^ & \cdots & m_^ \\
m_^ & m_^ & \cdots & m_^ \\
\vdots & \vdots & & \vdots \\
m_^ & m_^ & \cdots & m_^ \\
\end\, .
\] The numbers \(m^_\) are called entries. The superscript indexes the row of the matrix and the subscript indexes the column of the matrix in which \(m_^\) appears. An \(r\times 1\) matrix \(v = (v^_) = (v^)\) is called a column vector, written \[v = \beginv^\\v^\\ \vdots \\ v^ \end\, .\] A \(1\times k\) matrix \(v = (v^_) = (v_)\) is called a row vector, written \[v = \beginv_ & v_ & \cdots & v_ \end\, .\]
Example \(\PageIndex<2>\): Gif images In computer graphics, you may have encountered image files with a .gif extension. These files are actually just matrices: at the start of the file the size of the matrix is given, after which each number is a matrix entry indicating the color of a particular pixel in the image. This matrix then has its rows shuffled a bit: by listing, say, every eighth row, a web browser downloading the file can start displaying an incomplete version of the picture before the download is complete. Finally, a compression algorithm is applied to the matrix to reduce the file size.2>
Example \(\PageIndex<3>\): Graphs occur in many applications, ranging from telephone networks to airline routes. In the subject of graph theory, a graph is just a collection of vertices and some edges connecting vertices. A matrix can be used to indicate how many edges attach one vertex to another. For example, the graph pictured above would have the following matrix, where \(m^_\) indicates the number of edges between the vertices labeled \(i\) and \(j\): \[n^
_.\] This rule obeys linearity.3>
Notice that in order for the multiplication make sense, the columns and rows must match. For an \(r\times k\) matrix \(M\) and an \(s\times m\) matrix \(N\), then to make the product \(MN\) we must have \(k=s\). Likewise, for the product \(NM\), it is required that \(m=r\). A common shorthand for keeping track of the sizes of the matrices involved in a given product is: \[\left(r \times k\right)\times \left(k\times m\right) = \left(r\times m\right)\]
Example \(\PageIndex<4>\): Multiplying a \((3\times 1)\) matrix and a \((1\times 2)\) matrix yields a \((3\times 2)\) matrix. \[
\begin1\\3\\2\end \begin2 & 3\end =
\begin
1\cdot 2 & 1\cdot 3 \\
3\cdot 2 & 3\cdot 3 \\
2\cdot 2 & 2\cdot 3 \\
\end
= \begin
2 & 3 \\
6 & 9 \\
4 & 6 \\
\end
\]4>
Theorem: orthogonal Let \(M\) be a matrix and \(x\) a column vector. If \[
Mx=0
\] then the vector \(x\) is orthogonal to the rows of \(M\).
Remark Remember that the set of all vectors that can be obtained by adding up scalar multiples of the columns of a matrix is called its \(\textit
We know that \(r\times k\) matrices can be used to represent linear transformations \(\Re^
\[
L \colon M^_
\]
\[
L(M)=(l^_
\]
This is the same as the rule we use to multiply matrices. In other words, \(L(M)=NM\) is a linear transformation.
Let \(M=(m^_)\) be a matrix. The entries \(m_^\) are called \(\textit\), and the set \(\^\), \(m_^\), \(\ldots \>\) is called the \(\textit\). Any \(r\times r\) matrix is called a \(\textit\). A square matrix that is zero for all non-diagonal entries is called a diagonal matrix. An example of a square diagonal matrix is
$$\begin
2 & 0 & 0\\
0 & 3 & 0\\
0 & 0 & 0\\
\end\, .\] The \(r\times r\) diagonal matrix with all diagonal entries equal to \(1\) is called the \(\textit\), \(I_\), or just \(I\). An identity matrix looks like \[ I=
\begin
1 & 0 & 0 & \cdots & 0 \\
0 & 1 & 0 & \cdots & 0 \\
0 & 0 & 1 & \cdots & 0 \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
0 & 0 & 0 & \cdots & 1
\end.
\] The identity matrix is special because $$I_M=MI_=M$$ for all \(M\) of size \(r\times k\).
Definition The \(\textit
\[
M^ = (\hat_^)
\]
with \(\hat_^ = m_^\).
Theorem: Transpose and Multiplication
Let \(M, N\) be matrices such that \(MN\) makes sense. Then