%html
Linear Algebra
Vectors
To create a vector in Sage, use the vector command.
Exercise: Create the vector .
%html
Note: vectors in Sage are row vectors! |
Exercise: Create the vector .
%html
Exercise: Find the dot product of x and y.
%html
[The above problems are essentially the first problem on Exercise Set 1 of William Stein's Math 480b.]
Matrices
Exercise: Use the matrix command to create the following matrix over the rational numbers (hint: in Sage, QQ denotes the field of rational numbers).
$$\left(\begin{array}{rrrrrr}
3 & 2 & 2 & 1 & 1 & 0 \\
2 & 3 & 1 & 0 & 2 & 1 \\
2 & 1 & 3 & 2 & 0 & 1 \\
1 & 0 & 2 & 3 & 1 & 2 \\
1 & 2 & 0 & 1 & 3 & 2 \\
0 & 1 & 1 & 2 & 2 & 3
\end{array}\right)$$
- Find the echelon form of the above matrix.
- Find the right kernel of the matrix.
- Find the eigenvalues of the matrix.
- Find the left eigenvectors of the matrix.
- Find the right eigenspaces of the matrix.
%html
Exercise: For what values of is the determinant of the following matrix ?
$$\left(\begin{array}{rrr}
1 & 1 & -1 \\
2 & 3 & k \\
1 & k & 3
\end{array}\right)$$
[K. R. Matthews, Elementary Linear Algebra, Chapter 4, Problem 8]
%html
Exercise: Prove that the determinant of the following matrix is .
$$\left(\begin{array}{rrr}
{n}^{2} & {\left( n + 1 \right)}^{2} & {\left( n + 2
\right)}^{2} \\
{\left( n + 1 \right)}^{2} & {\left( n + 2 \right)}^{2} &
{\left( n + 3 \right)}^{2} \\
{\left( n + 2 \right)}^{2} & {\left( n + 3 \right)}^{2} & {\left( n + 4 \right)}^{2}\end{array}\right)$$
[K. R. Matthews, Elementary Linear Algebra, Chapter 4, Problem 3]
%html
Exercise: Prove that if , then the line through the points and is given by the following equation.
$$\det\left(\begin{array}{rrr}
x & y & 1 \\
a & b & 1 \\
c & d & 1
\end{array}\right) = 0.$$
%html
Exercise: Find the determinant of the following matrices.
$$\left(\begin{array}{r}1
\end{array}\right),
\left(\begin{array}{rr}
1 & 1 \\
r & 1
\end{array}\right),
\left(\begin{array}{rrr}
1 & 1 & 1 \\
r & 1 & 1 \\
r & r & 1
\end{array}\right),
\left(\begin{array}{rrrr}
1 & 1 & 1 & 1 \\
r & 1 & 1 & 1 \\
r & r & 1 & 1 \\
r & r & r & 1
\end{array}\right),
\left(\begin{array}{rrrrr}
1 & 1 & 1 & 1 & 1 \\
r & 1 & 1 & 1 & 1 \\
r & r & 1 & 1 & 1 \\
r & r & r & 1 & 1 \\
r & r & r & r & 1
\end{array}\right)$$
Make a conjecture about the determinant of an arbitrary matrix in this sequence. Can you prove it your conjecture?
[Adapted from: K. R. Matthews, Elementary Linear Algebra, Chapter 4, Problem 19]
%html
Exercise: What is the largest determinant possible for a matrix whose entries are (each occurring exactly once, in any order). How many matrices achieve this maximum?
(Hint: You might find the command Permutations useful. The following code will construct all the lists that have the entries , each appearing exactly once.)
for P in Permutations(4):
L = list(P)
print L