Skip to main content
Mathematics LibreTexts

4.1: Matrices

  • Page ID
    125043

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    Matrix

    Definition: Matrix

    A matrix is a rectangular array of objects, often numbers.

    Example \(\PageIndex{1}\)

    The rectangular array of numbers \(\left[ \begin{array}{c} \begin{array}{cc} 5 & -2 \\ 0 & 4 \\ -6 & 3 \end{array} \\ \ \end{array} \right]\) is a matrix having 3 rows and 2 columns.

    Dimension of a Matrix

    Matrix having \(m\) number of rows and \(n\) number of columns has dimension (size) \(m \times n\) (pronounced as "m by n") and is called an \(m \times n\) matrix.

    The matrix in Example \(\PageIndex{1}\) is a \(3\times 2\) matrix since it is composed of 3 rows and 2 columns. When specifying the dimension of a matrix, the number of rows is stated first and the number of columns second.

    Elements of a Matrix

    It is common to use an uppercase letter of the alphabet to name a matrix and the corresponding lowercase letter to name an element (entry or member) of the matrix. Subscripts are attached to the lowercase letter to specify its position in the matrix.

    The first number in subscript indicates the row in which the element resides and the second number the column.

    The subscript numbers appear adjacent to each other and typically without a comma separating them.

    We could name the matrix of Example . We specify the element \(-2\) in row 1, column 2, with the notation \(a_{12}\). The lowercase \(a\) is used to indicate that the element is from matrix \(A\) and the subscripts indicate we are observing the entry in row 1, column 2. The subscript is not the number 12, but rather the two individual numbers, 1 and 2.

    In general, the notation \(a_{i j}\) denotes the entry in row \(i\) and column \(j\).

    Some other elements of \(A\) are

    \(a_{11}=5,\) the number in row 1, column 1

    \(a_{31}=-6,\) the number in row 3, column 1

    \(a_{22}=4,\) the number in row 2, column 2

    In general, an \(m\mathrm{\times }n\) matrix has the form \(\left[ \begin{array}{c} \begin{array}{c} \begin{array}{cc} a_{\mathrm{11}} & a_{\mathrm{12}} \end{array} \mathrm{\ \ \ \ }\mathrm{\cdots }\mathrm{\ \ \ }a_{\mathrm{1}n} \\ \begin{array}{cc} a_{\mathrm{21}} & a_{\mathrm{22}} \end{array} \mathrm{\ \ \ \ }\mathrm{\cdots }\mathrm{\ \ \ }a_{\mathrm{2}n} \\ \begin{array}{cc} a_{\mathrm{31}} & a_{\mathrm{32}} \end{array} \mathrm{\ \ \ \ }\mathrm{\cdots }\mathrm{\ \ \ }a_{\mathrm{3}n} \end{array} \\ \mathrm{\vdots } \\ \begin{array}{cc} a_{m\mathrm{1}} & a_{m\mathrm{2}} \end{array} \mathrm{\ \ \ \ }\mathrm{\cdots }\mathrm{\ \ \ }a_{mn} \end{array} \right]\). For some number \(m\), the element \(a_{m\mathrm{2}}\) is the number in row \(m\), column 2.

    Your turn:

    In the matrix \(B\mathrm{=}\left[ \begin{array}{c} \begin{array}{ccc} 0 & \mathrm{-}\mathrm{4} & \mathrm{2} \\ \mathrm{1} & \mathrm{-}\mathrm{1} & \mathrm{5} \\ \mathrm{-}\mathrm{3} & \mathrm{3} & \mathrm{8} \end{array} \\ \mathrm{\ } \end{array} \right],\)

    1. Specify the size of \(B\).
    2. Find the value of \(b_{11}.\)
    3. Find the value of \(b_{13}.\)
    4. Find the value of \(b_{32}.\)

    ANS: (a) \(3\times 3\), (b) 0, (c) 2, (d) 3

    Equal Matrices

    Definition: Equal Matrices

    Two matrices \(A\) and \(B\) are said to be equal, written as \(A=B\), if they are the same size and all the corresponding entries are equal.

    In matrix notation, for all \(i\) and \(j\),\(\mathrm{\ }A\mathrm{=}B\) if \(a_{ij}\mathrm{=}b_{ij}.\) The notation \(a_{ij}\) names the element in row \(i\) and column \(j\) of matrix \(A\). Similarly, the notation \(b_{ij}\) names the element in row \(i\) and column \(j\) of matrix \(B\). The notation \(a_{ij}\mathrm{=}b_{ij}\) indicates that the element in row \(i\) and column \(j\) of matrix \(A\) is the same as the element in row \(i\) and column \(j\) of matrix \(B.\)

    Square Matrices

    Definition: Square Matrices

    A matrix is called square if it has the same number of columns as rows.

    Example \(\PageIndex{2}\)

    The \(2\times 2\ \)matrices \(A\) and \(B\) are both equal and square.

    \(A=\left[ \begin{array}{cc} 3 & 4 \\ 2 & 1 \end{array} \right]\) and \(B=\left[ \begin{array}{cc} 3 & 4 \\ 2 & 1 \end{array} \right]\)

    Main Diagonal of a Square Matrix

    Consider a square matrix, say \[A=\left[\begin{array}{ccc}
    2 & 1 & 0 \\
    3 & 4 & -5 \\
    -1 & 6 & 7
    \end{array}\right] \nonumber \]

    Imagine a line passing from the top left element to the bottom right element as in the picture.

    \[\left.A=\mid \begin{array}{ccc}
    8 & 1 & 0 \\
    3 & 4 & -5 \\
    -1 & 6 & 7
    \end{array}\right] \nonumber \]

    This diagonal set of elements from the top left element to the bottom right is called the main diagonal of the matrix.

    Diagonal and Non-Diagonal Elements of a Matrix

    The elements lying on the main diagonal of matrix \(A\) are called the diagonal elements of matrix \(A\). The elements 2, 4, and 7 are the diagonal elements of matrix \(A\). The elements lying off the main diagonal of matrix \(A\) are called the non-diagonal or off-diagonal elements of matrix \(A\). The elements 1, 0, 3, -5, -1, and 6 are the non-diagonal elements of matrix \(A\).

    The Identity Matrix

    Definition: Identity Matrix

    An Identity matrix is a square matrix that has only 1’s on its main diagonal and 0’s everywhere else.

    A matrix in which every diagonal element is 1 and every non-diagonal element is 0 is an identity matrix. Identity matrices are typically named with the uppercase letter \(I.\) It is not uncommon to write the size of the matrix as a subscript on the \(I.\)

    Example \(\PageIndex{3}\)

    The square matrix \(I=\left[ \begin{array}{ccc} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{array} \right]\) is the \(3\times 3\). We could write \(I_{3\times 3}\) to indicate the \(3\times 3\) identity matrix.

    The Zero Matrix

    Definition: Zero Matrix

    The zero matrix is a matrix, in which every element is 0.

    Zero matrices are commonly named with a 0.

    Example \(\PageIndex{4}\)

    The matrix \(0=\left[ \begin{array}{cc} 0 & 0 \\ 0 & 0 \\ 0 & 0 \end{array} \right]\) is a zero matrix.

    The Transpose of a Matrix

    Consider some \(m\times n\) matrix \(A.\ \)For example, suppose \(A\) is the \(2\times 3\) matrix \(A=\left[ \begin{array}{ccc} 2 & 3 & 4 \\ 5 & 6 & 7 \end{array} \right]\).Form a new matrix, call it \(A\)-transpose and denote it by \(A^T\), by making

    • The first row of \(A\) the first column of \(A^T\),
    • The second row of \(A\) the second column of \(A^T\).

    Then \(A^T=\left[ \begin{array}{cc} 2 & 5 \\ 3 & 6 \\ 4 & 7 \end{array} \right]\) is the transpose of \(A=\ \left[ \begin{array}{ccc} 2 & 3 & 4 \\ 5 & 6 & 7 \end{array} \right]\).

    Definition: Transpose of a Matrix

    The rows of a matrix are the columns of its transpose. If the matrix \(A\) is size \(m \times n\), then dimension of \(A^T\) is \(n \times m\).

    Row Matrices and Column Matrices

    Definition: Row Matrix

    A row matrix is a matrix with only one row and any number of columns.

    The matrix \(R=\left[ \begin{array}{ccc} 3 & 4 & 5 \end{array} \right]\) is a row matrix with 3 columns. It is a \(1\times 3\) matrix.

    Definition: Column Matrix

    A column matrix is a matrix with only one column and any number of rows.

    The matrix \(C=\left[ \begin{array}{c} 6 \\ 7 \end{array} \right]\) is a column matrix with 2 rows. It is a \(2\times 1\) matrix.

    Vectors as Matrices

    When we first described vectors, we expressed them using the bracket notation. For example, we could write a vector as \(\left\langle 2,\ 4,\ 6\right\rangle\). We can just as easily describe this vector using a row matrix \(\left[ \begin{array}{ccc} 2 & 4 & 6 \end{array} \right]\ \ \)or column matrix \(\left[ \begin{array}{c} 2 \\ 4 \\ 6 \end{array} \right].\)

    Try These

    Exercise \(\PageIndex{1}\)

    Specify the dimension of each matrix.

    1. \(S=\left[\begin{array}{ccc}
      0 & 2 & 5 \\
      -6 & -3 & 2 \\
      1 & 9 & 2 \\
      8 & -1 & 4
      \end{array}\right]\)
    2. \(T=\left[\begin{array}{lll}
      5 & 6 & -3 \\
      0 & 0 & -3
      \end{array}\right]\)
    3. \(Q=\left[\begin{array}{lll}
      1 & 0 & -1
      \end{array}\right]\)
    Answer
    1. \(4\times 3\)
    2. \(2\times 3\)
    3. \(1\times 3\)
    Exercise \(\PageIndex{2}\)

    True or False: The transpose of a square matrix is also a square matrix.

    Answer

    True

    Exercise \(\PageIndex{3}\)

    In the matrix \(S=\left[\begin{array}{ccc}
    0 & 2 & 5 \\
    -6 & -3 & 2 \\
    1 & 9 & 2 \\
    8 & -1 & 4
    \end{array}\right]\)

    1. Find the value of \(S_{13}\).
    2. Find the value of \(S_{23}\).
    3. Find the value of \(S_{31}\).
    4. Find the value of \(S_{43}\).
    Answer
    1. 5
    2. 2
    3. 1
    4. 4
    Exercise \(\PageIndex{4}\)

    Construct and name the transpose of \(S=\left[\begin{array}{ccc}
    0 & 2 & 5 \\
    -6 & -3 & 2 \\
    1 & 9 & 2 \\
    8 & -1 & 4
    \end{array}\right]\)

    Answer

    \(S^T=\left[ \begin{array}{ccc} 0 & -6 & 1 \\ 2 & -3 & 9 \\ 5 & 2 & 2 \end{array} \ \ \ \ \begin{array}{c} 8 \\ -1 \\ 4 \end{array} \right]\)

    Exercise \(\PageIndex{5}\)

    Construct \(I_{4 \times 4}\).

    Answer
    Exercise \(\PageIndex{6}\)

    Construct the transpose of \(I_{3 \times 3}\).

    Answer

    \(I^T_{3\times 3}=I_{3\times 3}\)

    Exercise \(\PageIndex{7}\)

    Write the column matrix \(\left[\begin{array}{l}
    4 \\
    3 \\
    2
    \end{array}\right]\) using vector bracket notation, < >.

    Answer

    \(\mathrm{<}\)4,3,2\(\mathrm{>}\)

    Exercise \(\PageIndex{8}\)

    Construct a 2 × 2 matrix in which the diagonal elements are 5 and 6 and the non-diagonal elements are 0 and 2.

    Answer

    \(\left[ \begin{array}{cc} 5 & 0 \\ 2 & 6 \end{array} \right]\) or \(\left[ \begin{array}{cc} 5 & 2 \\ 0 & 6 \end{array} \right]\)


    This page titled 4.1: Matrices is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Denny Burzynski (Downey Unified School District) .

    • Was this article helpful?