Processing math: 100%
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

11.4: Elementary Matrices

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

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

from urllib.request import urlretrieve
urlretrieve('https://raw.githubusercontent.com/colbrydi/jupytercheck/master/answercheck.py', 
            'answercheck.py');
from urllib.request import urlretrieve
urlretrieve('https://raw.githubusercontent.com/colbrydi/jupytercheck/master/answercheck.py', 
            'answercheck.py');

NOTE: A detailed description of elementary matrices can be found here in the Beezer text Subsection EM 340-345 if you find the following confusing.

There exist a cool set of matrices that can be used to implement Elementary Row Operations. Recall our elementary row operations include:

  1. Swap two rows
  2. Multiply a row by a constant (c)
  3. Multiply a row by a constant (c) and add it to another row.

You can create these elementary matrices by applying the desired elementary row operations to the identity matrix.

If you multiply your matrix from the left using the elementary matrix, you will get the desired operation.

For example, here is the elementary row operation to swap the first and second rows of a 3×3 matrix:

E12=[010100001]

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

import numpy as np
import sympy as sym
sym.init_printing(use_unicode=True)
A = np.matrix([[3, -3,9], [2, -2, 7], [-1, 2, -4]])
sym.Matrix(A)
# 'Run' this cell to see the output
import numpy as np
import sympy as sym
sym.init_printing(use_unicode=True)
A = np.matrix([[3, -3,9], [2, -2, 7], [-1, 2, -4]])
sym.Matrix(A)
# 'Run' this cell to see the output

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

E1 = np.matrix([[0,1,0], [1,0,0], [0,0,1]])
sym.Matrix(E1)
# 'Run' this cell to see the output
E1 = np.matrix([[0,1,0], [1,0,0], [0,0,1]])
sym.Matrix(E1)
# 'Run' this cell to see the output

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

A1 = E1*A
sym.Matrix(A1)
# 'Run' this cell to see the output
A1 = E1*A
sym.Matrix(A1)
# 'Run' this cell to see the output
Do This

Give a 3×3 elementary matrix named E2 that swaps row 3 with row 1 and apply it to the A Matrix. Replace the matrix A with the new matrix.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

# Put your answer here.  
# Put your answer here.  

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

from answercheck import checkanswer

checkanswer.matrix(E2,'2c2d2e407389eabeb6d90894565c830f');
from answercheck import checkanswer

checkanswer.matrix(E2,'2c2d2e407389eabeb6d90894565c830f');
Do This

Give a 3×3 elementary matrix named E3 that multiplies the first row by c=3 and adds it to the third row. Apply the elementary matrix to the A matrix. Replace the matrix A with the new matrix.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

# Put your answer here.
# Put your answer here.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

from answercheck import checkanswer

checkanswer.matrix(E3,'55ae1f9eb21df00c59dad623b9471506');
from answercheck import checkanswer

checkanswer.matrix(E3,'55ae1f9eb21df00c59dad623b9471506');
Do This

Give a 3×3 elementary matrix named E4 that multiplies the second row by a constant c=1/2 applies this to matrix A.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

# Put your answer here.  
# Put your answer here.  

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

from answercheck import checkanswer

checkanswer.matrix(E4,'3a5256840ef907a1b73ebba4471ac26d');
from answercheck import checkanswer

checkanswer.matrix(E4,'3a5256840ef907a1b73ebba4471ac26d');

If the above are correct then we can combine the three operators on the original matrix A as follows.

Login with LibreOne to run this code cell interactively.

If you have already signed in, please refresh the page.

A = np.matrix([[3, -3,9], [2, -2, 7], [-1, 2, -4]])

sym.Matrix(E4*E3*E2*A)
A = np.matrix([[3, -3,9], [2, -2, 7], [-1, 2, -4]])

sym.Matrix(E4*E3*E2*A)

This page titled 11.4: Elementary Matrices is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Dirk Colbry via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?