Recent Forum Posts
From categories:
page 1123...next »

The solutions to the review guide are given below in .pdf format. Please comment if you find any typos in order to help your classmates. Also, for a few of the computation problems, I did not work out the answers and have recommended that you use Sage.

Exam 3 Review Guide Solutions

Review Problems (Final Exam) by profedgarprofedgar, 09 Dec 2011 21:38

You can always create really large pattern-filled matrices using two for loops.

That was the problem, I generally don't define my matrix using matrix(QQ, [[],[]]) so that was what was causing the problem. It's all working now. Thanks!

Re: Sage Project 6 by joshuanelsnjoshuanelsn, 02 Dec 2011 07:24

Hi Josh,

I am still confused how you are getting "Integer Ring" results. Make sure you define everything, matrices and spans, over QQ. See if you still have the problem. If you continue to have the problem, bring the computer by and we can take a look at it together to see what's going on.

Re: Sage Project 6 by profedgarprofedgar, 02 Dec 2011 07:09

When I use:

C=span([A.column(0),A.column(1)])
Free module of degree 5 and rank 2 over Integer Ring
Echelon basis matrix:
[ 1 1 -1 -1 1]
[ 0 6 10 4 16]

Which corresponds with the column_space result

A.column_space()
Free module of degree 5 and rank 2 over Integer Ring
Echelon basis matrix:
[ 1 1 -1 -1 1]
[ 0 6 10 4 16]

but when I do:

R=span([B.row(0),B.row(1)])

Rowspace(A):
Vector space of degree 6 and dimension 2 over Rational Field
Basis matrix:
[ 1 0 -1 -2 -3 -4]
[ 0 1 2 3 4 5]

or

span(QQ,[B.row(0),B.row(1)])
Vector space of degree 6 and dimension 2 over Rational Field
Basis matrix:
[ 1 0 -1 -2 -3 -4]
[ 0 1 2 3 4 5]

these both dont correspond to

Free module of degree 6 and rank 2 over Integer Ring
Echelon basis matrix:
[ 1 0 -1 -2 -3 -4]
[ 0 2 4 6 8 10]

where B=A.rref()

Re: Sage Project 6 by joshuanelsnjoshuanelsn, 02 Dec 2011 05:20

Hi Josh,

Did you define your matrix over QQ? The difference I am seeing is that one of the spaces is over the rational field (QQ) and the other is over the integer ring (ZZ). This is a "type" problem and should be fixed as long as you do everything over QQ.

Did that help?

Re: Sage Project 6 by profedgarprofedgar, 02 Dec 2011 02:29

In the project 6 video to compare the rowspace that you came up with and the rowspace sage comes up with you use the equality R==RR where R is a span of the non zero rows of the reduced row echelon form and RR is a result of the sage function row_space() on the same matrix. Is this how you want us to check our answers in #2?

When using the Matrix A in Problem 1, I am getting the result:

Vector space of degree 6 and dimension 2 over Rational Field
Basis matrix:
[ 1  0 -1 -2 -3 -4]
[ 0  1  2  3  4  5]

and when using sages row_space function I am getting:

Free module of degree 6 and rank 2 over Integer Ring
Echelon basis matrix:
[ 1  0 -1 -2 -3 -4]
[ 0  2  4  6  8 10]

These are not the same bases, but I am not sure what I am doing wrong, or if what I am doing is an incorrect comparison. How do I compare what I am doing to sage correctly.

Re: Sage Project 6 by joshuanelsnjoshuanelsn, 02 Dec 2011 02:04

For the final Sage project, please use the following matrix:

(1)
\begin{align} \left(\begin{array}{rrrrrrrrrr} 9 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 9 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 9 & 1 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 9 & 1 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 9 & 1 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 9 & 1 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 & 9 & 1 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 & 9 & 1 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 9 & 1 \\ 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 9 \end{array}\right) \end{align}

1. Find the determinant of this matrix. Is this matrix nonsingular?
2. Find the characteristic polynomial of this matrix. Use this polynomial to determine the eigenvalues.
3. Use Sage to find the eigenvalues and eigenvectors of this matrix.
4. Pick one eigenvector and demonstrated that it is in fact an eigenvector for the corresponding eigenvalue. (see the definition if necessary)
5. Find a matrix that has the 7 eigenvalues: 2, 3, 4, 5, 6, 7, 8
6. Optional: Use Sage to find the expanded formula for a generic $4\times 4$ matrix. How many terms are there in this formula. Do you have a guess as to how to generalize the determinant formula for $n\times n$ matrices.

Hint: The code below will generate the matrix given in the problem:

def CircMat(n,m):
    L=[]
    for i in range(n):
        L.append([])
        for j in range(n):
            if i==j:
                L[i].append(m)
            else:
                L[i].append(1)
    return matrix(QQ,L)

and

A=CircMat(10,9)

You can change the 10 to change the size of the matrix and you can change the 9 to create a different number down the diagonals.

Hi Josh,

The bases you have are actually different, but the subspace that they span are the same. To get sage to give true, ask for subspace equality (not basis equality).

So, for instance both {(1,0),(0,1)} and {(2,0),(0,2)} are bases for $\mathbb{R}^2$, but they are different bases.

Re: Sage Project 6 by profedgarprofedgar, 01 Dec 2011 22:38

When I am checking to see if the row space and the column space I found match the sage functions results for row space and column space, they are returning false. I checked the results and the values did not match, but were the same aside from a few elementary row operations.

For example: Sage is saying that the basis ([1,0,-1,-2,-3,-4],[0,1,2,3,4,5]) is not the same as the basis ([1,0,-1,-2,-3,-4],[0,2,4,6,8,10]).

It is my understanding that these two basis are actually the same since a single elementary row operation would make them equal. Is this correct and is there a way to make Sage do these function in a way that I get a consistent answer?

Re: Sage Project 6 by joshuanelsnjoshuanelsn, 01 Dec 2011 22:35

Please complete the following problems. You are welcome to use Sage to do find reduced row echelon forms as well as to check work. These problems are due Wednesday, December 7.

3.3: 2ef, 4c, 15 (proof doesn't need to be too formal; can be a matrix argument), 22
3.4: 1cd, 3be, 8d, 19 (please use Sage or calculator for 1 and 3)
5.1: 1a (using prop 1.1), 2
5.2: 1c, 5edh (do 1 by hand, use Sage for 5)
6.1: 1 (choose 3 that don't have *. Make at least 1 of them a 3 by 3. You may use Sage).

Homework Assignment 6 by profedgarprofedgar, 28 Nov 2011 20:41

Should be fixed and ready to go… you are on the ball.

Re: Sage Project 6 by profedgarprofedgar, 26 Nov 2011 23:13

I also see no matrix in problem 3.

Re: Sage Project 6 by Greg BishopGreg Bishop, 26 Nov 2011 23:02

Am I the only one who can't see the matrix in problem 1? All I see is "A=".

Re: Sage Project 6 by Greg BishopGreg Bishop, 26 Nov 2011 08:42

For this week's project please watch the 6th video about the Four Fundamental Subspaces and then complete the following questions.

1. For the matrix below, compute the row space, column space, nullspace and left nullspace using the theorem from the video. In other words compute these all using the appropriate span of vectors.

(1)
\begin{align} A=\begin{pmatrix} 1 & 2 & 3 & 4 & 5 & 6\\ 7 & 8 & 9 & 10 & 11 & 12\\ 9 & 8 & 7 & 6 & 5 & 4 \\ 3 & 2 & 1 & 0 & -1 & -2\\ 17 & 18 & 19 & 20 & 21 & 22 \end{pmatrix} \end{align}

2. Check your answers to the previous problem using Sage's built in functions to find the appropriate spaces.

3. Find a basis for the column space of the following matrix using the built in sage command and using the reduced row echelon form. Are the two bases the same?

(2)
\begin{align} B=\begin{pmatrix} 2 & 3 & 5 & 7 & 11\\ 13 & 17 & 19 & 23 & 29\\ 31 & 37 & 41 & 43 & 47\\ 53 & 59 & 61 & 67 & 71 \end{pmatrix} \end{align}

4. Come up with your own $5\times 5$ matrix, and do the following:
A) Use the theorem in the video to determine the four fundamental subspaces of your matrix.
B) Check that you are correct using Sage's built in functions to find the subspaces.
C) Find the rank of your matrix and then find the dimensions of all of the fundamental subspaces.

5. Come up with your own singular $4\times 4$ matrix. Find the dimensions of the four fundamental subspaces using any method you want.

6. Come up with your own $3\times 5$ matrix. Find the dimensions of the four fundamental subspaces using any method you want.

7. Do you have any guesses about relationships between the dimensions of the subspaces and the matrix?

8. Can you figure out which matrices have nullspace $N(A)=\{\mathbf{0}\}$?

9. Create a $2\times 7$ matrix with a column space of dimension 1.

The suggested problems on the exam review guide have solutions attached below.

These were done quickly, so there may be typos; if you find one, please let reply to let everyone know. Also, there was one problem that was fairly long that does not have answers. These were from 2.4 which is low priority, but if you have questions, please ask.

SOLUTIONS: download here.

Review Problems by profedgarprofedgar, 15 Nov 2011 04:41

For this Sage project, please watch the Project 5 video and complete the following tasks.

1. Use Sage to draw the graph for the following adjacency matrix:

(1)
\begin{align} A=\left(\begin{array}{rrrrrr} 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{array}\right) \end{align}

2. For $A$ given above, draw the graph associated to the matrix $A^2, A^3, A^4, A^5$ and $A^6$.

3. Make up your own graph on 4 or 5 vertices using an adjacency matrix, $C$. Have Sage draw your graph and then draw the graphs for $C^2, C^3, C^4$, etc.. Can you guess how graphs associated to matrix powers of the adjacency matrix are related to the original graph?

4. Draw your own graph on 4 vertices and figure out the adjacency matrix and the incidence matrix. Input the graph into Sage using the adjacency matrix and then the incidence matrix for your graph. Use Sage's features to determine if you created the matrices correctly (i.e. are the two graphs created the exact same?)

5. Take the following proposed incidence matrix and ask Sage to draw the graph associated to it. Explain why you get an error (in other words, can you use Sage's error to figure out why this is NOT an incidence matrix?) Determine a condition on the columns of a matrix to make it an incidence matrix of a graph.

(2)
\begin{align} B=\left(\begin{array}{rrrrr} 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & -1 & 1 \\ 1 & -1 & -1 & 0 & 0 \\ 0 & 1 & 0 & 0 & -1 \\ -1 & 0 & -1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \end{array}\right) \end{align}

6. What graph corresponds to the identity matrix as an adjacency matrix? What about the $0$ matrix?

7. Let $J$ be the $n\times n$ matrix given by all 1's, so $J_{i,j}=1$ for all $i,j$. Draw the graph with adjacency matrix $J-I_n$ (where $I_n$ is the identity matrix) for a few different $n$ values. Explain the graph in words.

8. Optional Explorations (because I may not know the answer completely or if there is an answer at all):

a. Is there any property that a graph will have that will force the adjacency matrix to be invertible (or nonsingular)?
b. Is there any property a graph will have that will force the adjacency matrix to be singular?
c. What does it mean for two rows to be exactly the same in an adjacency matrix.
d. Can you easily determine the rank of an incidence matrix? Are there any conditions that force the rank to be less than the number of rows or columns?
e. Do you have any questions to add?

Sage Project 5 by profedgarprofedgar, 04 Nov 2011 00:43

Homework 5 will be due Friday, November 11.

2.3: 1bcd, 2c, 6c, 7a, 11, 12a
2.4: 5b, (8-extra credit)
2.5: 1acfhi, 2cd, 3c, 6, 12
3.1: 1abce, 3, 6, 9b

SOLUTIONS: download here.

Homework Assignment 5 by profedgarprofedgar, 01 Nov 2011 22:49

In order to plot a square using parametric equations, try the following command:

P1=parametric_plot([-1,t], (t,-1,1))
P2=parametric_plot([1,t], (t,-1,1))
P3=parametric_plot([t,-1], (t,-1,1))
P4=parametric_plot([t,1], (t,-1,1))
P1+P2+P3+P4

in one box. As a side note, each plot above gives one side of the square. Notice that the first one gives x coordinate always -1 and the y coordinate ranges between -1 and 1, etc.

Re: Sage Project 4 by profedgarprofedgar, 26 Oct 2011 19:40
page 1123...next »