Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

📚 The CoCalc Library - books, templates and other resources

132934 views
License: OTHER
Kernel:
%%html <link href="https://pretextbook.org/beta/mathbook-content.css" rel="stylesheet" type="text/css" /> <link href="https://aimath.org/mathbook/mathbook-add-on.css" rel="stylesheet" type="text/css" /> <style>.subtitle {font-size:medium; display:block}</style> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,600italic" rel="stylesheet" type="text/css" /> <link href="https://fonts.googleapis.com/css?family=Inconsolata:400,700&subset=latin,latin-ext" rel="stylesheet" type="text/css" /><!-- Hide this cell. --> <script> var cell = $(".container .cell").eq(0), ia = cell.find(".input_area") if (cell.find(".toggle-button").length == 0) { ia.after( $('<button class="toggle-button">Toggle hidden code</button>').click( function (){ ia.toggle() } ) ) ia.hide() } </script>

Important: to view this notebook properly you will need to execute the cell above, which assumes you have an Internet connection. It should already be selected, or place your cursor anywhere above to select. Then press the "Run" button in the menu bar above (the right-pointing arrowhead), or press Shift-Enter on your keyboard.

ParseError: KaTeX parse error: \newcommand{\lt} attempting to redefine \lt; use \renewcommand

Sage and Linear Algebra Worksheet: FCLA Section RREF

Robert Beezer
Department of Mathematics and Computer Science
University of Puget Sound
Fall 2019

To specify a matrix, first specify that your entries are rational numbers, QQ in Sage parlance. This is extremely important, though an explanation is best saved for later. Then the number of rows and columns. Follow this with a list of rows for the matrix, where each row is another list. We use square brackets, [, ] to organize lists. To actually see A we just write it as the last line.

A = matrix(QQ, 3, 4, [[-1, 1, 1, 1], [ 2, -1, -2, -3], [-2, 2, 1, -1]]) A

Then use the .rref() method to compute the reduced row-echelon form.

Demonstration 1.

Use a new cell, enter A.rref(), and execute the cell.

Here is a larger example.

B = matrix(QQ, [[ 0, 0, -1, 3, 3, -1, 2, -1], [ 1, -5, 0, -4, 5, -2, 4, 4], [-1, 5, -1, 7, -2, 2, -5, -7], [-1, 5, 1, 1, -8, 3, -6, -3]]) B
Demonstration 2.

As above, use a new cell to compute the reduced row-echelon form of B.

This work is Copyright 2016–2019 by Robert A. Beezer. It is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.