In-Class Work, Thursday December 2
The singular value decomposition
Math 221 Linear Algebra, Fall 2021
December 2, 2021

T. Ratliff, Wheaton College
ratliff_thomas@wheatoncollege.edu

Mathematica’s SVD syntax

Let’s define the matrix A

a={{1,-3,0,-1,3,-3,0},{3,-3,2,-2,2,-1,-2},{-3,3,3,2,1,0,-2},{0,-2,-3,2,2,3,3}};
a//MatrixForm

This is Mathematica’s syntax for finding the singular value decomposition
	FYI, the quickest way to get σ is to type ESC s ESC (that’s 3 keystrokes)

{u, σ, v} = SingularValueDecomposition[a];
u//MatrixForm
σ //MatrixForm
v //MatrixForm

Huh. That’s not very enlightening. 
Let’s look at the decimal approximations instead

{u, σ, v} = N[SingularValueDecomposition[a]];
u//MatrixForm
σ //MatrixForm
v //MatrixForm

That’s much better. 
Here’s one more bit of Mathematica syntax that will be useful:
	You can get the first row of the matrix u by typing u[[1]] (that’s two sets of square brackets)
Since a matrix is just a list of the rows, u[[1]] is giving the first element in the list.

u[[1]]