Skip to main content
Mathematics LibreTexts

Matrices

  • Page ID
    40860
  • \( \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}}\)

    1. Definition of a Matrix

    Definition: Matrix

    An \(m\) by \(n\) matrix is an array of numbers with \(m\) rows and \(n\) columns.

    Example 1

    \[\begin{pmatrix} 4&5\\0&15\\-9&3 \end{pmatrix}\nonumber \]

    is a 3 by 2 matrix.

    Example 2

    Consider the system of equations

    \[\begin{align} &2x &-y &&+3z&=5 \\ &x & &&+4z&=3 \\ &5x &-7y &&+3z&=7 \end{align}\nonumber \]

    Then the matrix

    \[\begin{pmatrix}\begin{array}{ccc|c}2&-1&3&5 \\1&0&4&3\\ 5&-7&3&7\end{array}\end{pmatrix}\nonumber \]

    is called the augmented matrix associated to the system of equations. Two matrices are called equal if all of their entries are the same. Two matrices are called row equivalent is one can be transformed using a sequence of the three operations that we discussed earlier.

    1. Interchanging two rows.
    2. Multiplying a row by a nonzero constant.
    3. Replacing a row with the row + a constant multiple of another row.

    2. Solving Linear Systems Using Matrices

    We can solve a linear system by writing down its augmented matrix and performing the row operations that we did last time.

    Example 3

    Solve

    \[\begin{align} &2x &-y &&+z&=3 \\ &x&+y&&+z&=2 \\ & &y&&-z&=-1 \end{align}\nonumber \]

    Solution

    We write the associated augmented matrix:

    \[\begin{pmatrix}\begin{array}{ccc|c}2&-1&1&3 \\1&1&1&2 \\ 0&1&-1&-1\end{array}\end{pmatrix}\nonumber \]

    Now begin solving by performing row operations:

    \[ R_1 \leftrightarrow R_2 \nonumber \]

    \[\begin{pmatrix}\begin{array}{ccc|c}1&1&1&2 \\2&-1&1&3\\ 0&1&-1&-1\end{array}\end{pmatrix}\nonumber \]

    \[R_1 \leftrightarrow R-2\nonumber \]

    \[\begin{pmatrix}\begin{array}{ccc|c}1&1&1&2 \\0&3&-1&-1\\ 0&1&-1&-1\end{array}\end{pmatrix}\nonumber \]

    \[R_2 \leftrightarrow R_3\nonumber \]

    \[\begin{pmatrix}\begin{array}{ccc|c}1&1&1&2 \\0&1&-1&-1\\ 0&3&-1&-1\end{array}\end{pmatrix} \nonumber \]

    \[R_1 - R_2 \rightarrow R_1, \;\; R_3 + 3R_2 \rightarrow R_3\nonumber \]

    \[\begin{pmatrix}\begin{array}{ccc|c}1&1&1&2 \\0&1&-1&-1\\ 0&3&-1&-1\end{array}\end{pmatrix}\nonumber \]

    \[ R_1 - R_2 \rightarrow R_1, \;\; R_3 + 3R_2 \rightarrow R_3 \nonumber \]

    \[\begin{pmatrix}\begin{array}{ccc|c}1&0&2&3 \\0&1&-1&-1\\ 0&0&-4&-4\end{array}\end{pmatrix}\nonumber \]

    \[R_3 \rightarrow -\dfrac{1}{4} R_3\nonumber \]

    \[\begin{pmatrix}\begin{array}{ccc|c}1&0&2&3 \\0&1&-1&-1\\ 0&0&1&1\end{array}\end{pmatrix}\nonumber \]

    \[R_1 - 2R_3 \rightarrow R_1, \;\; R_2 + R_3 \rightarrow R_2\nonumber \]

    \[\begin{pmatrix}\begin{array}{ccc|c}1&0&0&1 \\0&1&1&0\\ 0&0&1&1\end{array}\end{pmatrix}\nonumber \]

    \[R_1 - 2R_3 - \rightarrow +R_1, \;\;R_2 + R_3 \rightarrow R_2\nonumber \]

    \[\begin{pmatrix}\begin{array}{ccc|c}1&0&0&1 \\0&1&0&0\\ 0&0&1&1\end{array}\end{pmatrix}\nonumber \]

    We can now put the matrix back in equation form:

    \[x = 1, y = 0 \text{ and } z = 1\nonumber \]

    Note

    If we had seen a bottom row that was of the form \(0 \; 0 \; 0 \; a\) where \(a\) is a nonzero constant, then there would be no solution. If \(a\) had been 0 there would be infinitely many solutions.

    3. Addition and Scalar Multiplication of Matrices

    We can only add matrices that are of the same dimensions, that is if

    \[A=\begin{pmatrix} 1&2\\3&4 \end{pmatrix}, \;\;\; B=\begin{pmatrix} 2&3\\4&1\\5&9 \end{pmatrix}, \;\;\; C=\begin{pmatrix} 1&3\\7&2 \end{pmatrix}\nonumber \]

    then only \(A + C\) makes sense. We write

    \[A+C=\begin{pmatrix} 1+1&2+3\\3+7&4+2\end{pmatrix}=\begin{pmatrix} 2&5\\10&6\end{pmatrix} \nonumber \]

    For any matrix, we can multiply a matrix by a real number as in the following example (Same \(B\) as above):

    \[5B=\begin{pmatrix} 10&15\\20&5\\25&45 \end{pmatrix}\nonumber \]

    We define the zero matrix to be the matrix with only zeros for entries. For example, the 2 by 2 zero matrix is

    \[ \begin{pmatrix} 0&0\\0&0 \end{pmatrix}\nonumber \]

    4. Multiplication of Matrices

    To multiply matrices, unfortunately the definition is not the obvious one. We can only multiply matrices where the number of columns of the first matrix is the same as the number of rows of the second matrix. The best way to learn how to multiply matrices is by example:

    \[\text{Let}\; A=\begin{pmatrix} 3&5&2\\0&1&-2 \end{pmatrix}, \;\; \text{and}\; B=\begin{pmatrix} 7&-3\\-2&1\\0&5 \end{pmatrix}\nonumber \]

    \[\text{then}\;AB=\begin{pmatrix} 3(7)+4(-2)+2(0)&3(-3)+4(1)+2(5)\\0(7)+1(-2)+-2(5) &0(-3)+1(1)+-2(5) \end{pmatrix}=\begin{pmatrix} 13&5\\-12&-9 \end{pmatrix}\nonumber \]

    Exercise

    \[\text{Let}\;A=\begin{pmatrix} 1&2\\3&4 \end{pmatrix}, \;\;\; B=\begin{pmatrix} 4&2&1\\-2&0&0\\1&6&-1 \end{pmatrix}, \;\;\; C=\begin{pmatrix} 1&0\\2&1\\4&5 \end{pmatrix}, \;\;\; D=\begin{pmatrix} 3&4&0\\5&0&0\end{pmatrix},\;\;\; B=\begin{pmatrix} 3&4&2\\1&5&0\\1&-1&2\end{pmatrix}\nonumber \]

    Evaluate each one that makes sense:

    1) \(A + B\) 2) \(4C\) 3) \(AB\) 4) \(CD\) 5) \(DC\) 6) \(B + E\) 7) \(A^3\)

    5. Applications of Matrices

    Application 1

    A) Tables and chairs are made in the Mexico plant, the Brazil plant, and the US plant. The matrix below represents the quantity made per day.

      \(A:\)
    Quantity
      Mexico Brazil US
    Tables 15 10 50
    Chairs 30 12 75

    Labor and material cost for 1997 are represented in the following matrix.

      \(B =\)
      Labor Material
    Mexico 15 20
    Brazil 12 10
    US 30 5

    In 1997, the costs have increases to

      \(C =\)
      Labor Material
    Mexico 17 25
    Brazil 15 15
    US 45 10

    Find the following and describe what they mean:

    1) \(AB\) 2) \(C - B\) 3) \(AC\) 4) \(A(C - B)\) 5) \(365AC\)

    Application 2

    Suppose that you have two jobs, each contribute to two different mutual funds for retirement. The first fund pays 5% interest and the second pays 8% interest. Initially $5,000 is put into the funds and after one year there will be $5,300. If the first fund got half of the money from the first job and one third of the money from the second job, how much did each job contribute?

    Hint: Multiplication of matrices is the same as composition of functions

    Larry Green (Lake Tahoe Community College)

    • Integrated by Justin Marshall.


    This page titled Matrices is shared under a not declared license and was authored, remixed, and/or curated by Larry Green.

    • Was this article helpful?