• Home
  • Readings
  • Github
  • MIES
  • TmVal
  • About
Gene Dan's Blog

No. 104: 70 Days of Linear Algebra (Day 2)

5 June, 2014 7:39 AM / Leave a Comment / Gene Dan

Section: 1.2 – Row Reduction and Echelon Forms
Status: On target

Today I’ll demonstrate a couple of algorithms performed on a 3×4 matrix (we’ll call it A) performed in SAGE. SAGE is an open source computer algebra system intended as an alternative to proprietary systems such as Mathematica, MATLAB, etc. I’ve written about SAGE a few times, here, here and here. To begin, we’ll define A as follows:

\[A=\left[\begin{array}{rrrr} 1 & -2 & 1 & 0 \\ 0 & 2 & -8 & 8 \\ -4 & 5 & 9 & -9 \end{array} \right] \]

To define this matrix in SAGE (actually I think a more modern name would just be “sage”), we can open up the Linux terminal and use Python commands to assign the matrix object to the variable A:

ubuntu@ubuntu-desktop: ~-sage-6.2-x86_64-Linux_226

Those who are familiar with the Python programming language will know that the dir() function returns a list of methods that can act upon an object. Methods are functions that are defined within classes that can act upon instances of those classes. Here, we can use dir() to determine what methods are available to us through sage:ubuntu@ubuntu-desktop: ~-sage-6.2-x86_64-Linux_227

For new users, the variety of methods can be bewildering and somewhat intimidating – but if you look closely you’ll find a method called ‘echelon_form’, which is exactly what we’d guess – a function that returns the row echelon form of our matrix A. Before proceeding, we can type help(A.echelon_form) which confirms that the method does indeed perform the algorithm that most students learn within the first week of their Linear Algebra course (except much faster!):

ubuntu@ubuntu-desktop: ~-sage-6.2-x86_64-Linux_228

Now, typing in A.echelon_form() returns the echelon form of A. The method rref stands for reduced row echelon form, which produces the solution to A’s equivalent linear system:

ubuntu@ubuntu-desktop: ~-sage-6.2-x86_64-Linux_229

As you can see, the solution is the point (29, 16, 3).

Posted in: Logs, Mathematics

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Post Navigation

← Previous Post
Next Post →

Archives

  • September 2023
  • February 2023
  • January 2023
  • October 2022
  • March 2022
  • February 2022
  • December 2021
  • July 2020
  • June 2020
  • May 2020
  • May 2019
  • April 2019
  • November 2018
  • September 2018
  • August 2018
  • December 2017
  • July 2017
  • March 2017
  • November 2016
  • December 2014
  • November 2014
  • October 2014
  • August 2014
  • July 2014
  • June 2014
  • February 2014
  • December 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • March 2013
  • January 2013
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • January 2011
  • December 2010
  • October 2010
  • September 2010
  • August 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • September 2009
  • August 2009
  • May 2009
  • December 2008

Categories

  • Actuarial
  • Cycling
  • Logs
  • Mathematics
  • MIES
  • Music
  • Uncategorized

Links

Cyclingnews
Jason Lee
Knitted Together
Megan Turley
Shama Cycles
Shama Cycles Blog
South Central Collegiate Cycling Conference
Texas Bicycle Racing Association
Texbiker.net
Tiffany Chan
USA Cycling
VeloNews

Texas Cycling

Cameron Lindsay
Jacob Dodson
Ken Day
Texas Cycling
Texas Cycling Blog
Whitney Schultz
© Copyright 2025 - Gene Dan's Blog
Infinity Theme by DesignCoral / WordPress