Math 2275 - Linear Algebra II
(Winter 2012)

In Linear Algebra II (Math 2275) picks up from where you left off in Linear Algebra I (Math 2255). We will learn about: eigenvalues and eigenvectors, orthogonality and least squares, symmetric matrices and quadratic forms, and if time, the geometry of vector spaces. We will also try to incorporate some software into the class.




News (Last Updated April 15, 2012)

Below is a summary of what we did in class, plus any relevant news and/or information.

Videos/Online Resources

The Khan Academy has a number of great videos on linear algebra and the topics we will cover this semester. These videos will complement the material in class.


There are also some simple online calculators that allow you to do basic calculations. See

OCTAVE

As part of this course, I would like to introduce you to computer algebra systems and how they can be used in mathematics. In particular, we will look at the program OCTAVE.

To download Octave, go to the


Once you have installed Octave, you should try some of the online tutorials:

Finally, here is another, more comphrensive tutorial:

SAMPLE CODE

If I use any code in class, you will be able to find it here.
#######################################################################
## Jan 26 Examples
## Math 2275
######################################################################

## Example from class
## attractor
clear
A = [.8 0; 0 0.64]
b = [1; 1] # initial vector
P1 = [b]
for i=1:25 b = A*b; P1 = [P1, b]; end;
c = [-1;1] # second initial vector
P2 = [c]; 
for i=1:25 c = A*c; P2 = [P2, c]; end;
d = [2;-3] # thider initial vector
P3 = [d]; 
for i=1:25 d = A*d; P3 = [P3, d]; end;
x1 = P1(1,:);
y1 = P1(2,:);
x2 = P2(1,:);
y2 = P2(2,:);
x3 = P3(1,:);
y3 = P3(2,:);
plot(x1,y1,"*",x2,y2,"*",x3,y3,"*")

## make a loop to do lots of points at once
P = [];
for i=1:30 
  # pick a random vecotr
  b = [100*(-1)^(ceil(10*rand()))*rand();100*(-1)^(ceil(10*rand()))*rand()]; 
  P = [P b];
  # for each vector, find trajector
for i=1:30 b = A*b; P = [P, b]; end;  # 4 iterations only
end;
x = P(1,:);
y = P(2,:);
# plot all trajectories
plot(x,y,"*")

########################################################################

## Example of repellor
##
## Example from class
clear
A = [1.2 0; 0 1.4]
b = [1; 1] # initial vector
P1 = [b]
for i=1:25 b = A*b; P1 = [P1, b]; end;
c = [-1;1] # second initial vector
P2 = [c]; 
for i=1:25 c = A*c; P2 = [P2, c]; end;
d = [2;-3] # third initial vector
P3 = [d]; 
for i=1:25 d = A*d; P3 = [P3, d]; end;
e = [1; -.01] # initial vector
P4 = [e]
for i=1:25 e = A*e; P4 = [P4, e]; end;
x1 = P1(1,:);
y1 = P1(2,:);
x2 = P2(1,:);
y2 = P2(2,:);
x3 = P3(1,:);
y3 = P3(2,:);
x4 = P4(1,:);
y4 = P4(2,:);
plot(x1,y1,"*",x2,y2,"*",x3,y3,"*",x4,y4,"*")


P = [];
for i=1:30 
  b = [100*(-1)^(ceil(10*rand()))*rand();100*(-1)^(ceil(10*rand()))*rand()]; # pick random vector
  P = [P b];
  for i=1:30 b = A*b; P = [P, b]; end;  # 4 iterations only
end;
x = P(1,:);
y = P(2,:);
plot(x,y,"*")

###########################################################################

### Example of Sadle Point
### Exercise 9 from Section 5.6
clear
A = [1.7 -.3; -1.2 .8]
eig(A)
P = [];
for i=1:400 
  b = [100*(-1)^(ceil(10*rand()))*rand();100*(-1)^(ceil(10*rand()))*rand()]; # pick random vector
  P = [P b];
  for i=1:3 b = A*b; P = [P, b]; end;  # 3 iterations only
end;
x = P(1,:);
y = P(2,:);
plot(x,y,"*")


# Basic Octave input
2+2
3-4
139/3
14*5.36
cos(pi*4)
cos(4)

# Inputting a matrix and solving a sytem of linear equations

# Example (Example 3, page 8)
m = [0 1 -4; 2 -3 2; 5 -8 7]
b = [8; 1; 1]
rref(m)
m\b
m*ans


# Example (Example 4, page 18)
A = [1 6 2 -5 -2; 0 0 2 -8 -1; 0 0 0 0 1]
b = [-4; 3; 7]
A\b
A*ans

# Example (Example 6, page 97)
A = [2 -5 0; -1 3 -4; 6 -8 -7; -3 0 9]
B = [4 -6; 7 1; 3 2]
A*B

transpose(A)

# Example (Example 7, page 108)

A = [0 1 2; 1 0 3; 4 -3 8]
inv(A)
A * ans

# Example (Exampe 2, page 126)

A = [2 4 -1 5 -2; -4 -5 3 -8 1; 2 -5 -4 1 8;-6 0 7 -3 1]
[l,u,p] = lu(A)  
# gives you something different!

# Example (Example 3, page 155)
A = [2 5 -3 -4 8; 4 7 -4 -3 9; 6 9 -5 2 4; 0 -9 6 5 -6]
rank(A)

# Example (Example 3, page 166)
A = [3 -7 -8 9 -6;0 2 -5 6 3; 0 0 1 5 0; 0 0 2 4 -1; 0 0 0 -2 0]
det(A)

# Example (Example 6, page 285)
A = [5 0 0 0; 0 5 0 0; 1 4 -3 0 ; -1 -2 0 -3]
eig(A)
[a,b]=eig(A)

# Some plotting

# Example (Example 1, pg 295)

A = [0 -1;1 0]  # Matrix
b = [2; 0]      # Intial Vector
P = [b]
for i=1:20 b = A*b; P = [P, b]; end; # compute Ax_{i} = x_{i+1} for some values
x = P(1,:) # x coordinates
y = P(2,:) # y coordinates
plot(x,y)  # plot x vs y

A = [0 -1;1 0]
b = [3;4]
P = [b]
for i=1:20 b = A*b; P = [P, b]; end;
x = P(1,:)
y = P(2,:)
plot(x,y)


# Example (Example 3, pg 297)

A = [.5 -.6;.75 1.1]
b = [2; 0]
P = [b]
for i=1:20 b = A*b; P = [P, b]; end;
x = P(1,:);
y = P(2,:);
plot(x,y,"*")

# Example
clear

A = [.8 .5; -.1 1]
b = [.13; -.23]
P = [b]
for i=1:100 b = A*b; P = [P, b]; end;
x = P(1,:);
y = P(2,:);
plot(x,y,"*")

# Example from class
clear
A = [1 -2; 1 3;]
[a,b]=eig(A)
b = [1; 1]
P = [b]
for i=1:200 b = [1/sqrt(5) 0; 0 1/sqrt(5)]*A*b; P = [P, b]; end; ### I added a correcting factor!
### the matrix A streches things -- I got rid of the streching! 
x = P(1,:);
y = P(2,:);
plot(x,y,"*")

### allow some streching
clear
A = [1 -2; 1 3;]
[a,b]=eig(A)
b = [1; 1]
P = [b]
for i=1:200 b = [1/sqrt(5)+0.01 0; 0 1/sqrt(5)+0.001]*A*b; P = [P, b]; end; 
### I added a correcting factor!
### the matrix A streches things -- I got rid of the streching! 
x = P(1,:);
y = P(2,:);
plot(x,y,"*")



X = [1 3*cos(.88); 1 2.3*cos(1.1); 1 1.65*cos(1.42); 1 1.25*cos(1.77); 1 1.01*cos(2.14)]
Xt = transpose(X)
y = [3.00; 2.30; 1.65; 1.25; 1.01]
A = Xt*X
b = Xt*y
A\b
1.45/(1-0.811*cos(4.6))

Course Information

Instructor: Adam Van Tuyl

Office: RB 2015
Office Hours: T-Th 10:15-11:30
Email: avantuyl AT lakeheadu.ca

Place and Time:

Class: RB 2047 TTh 8:30-10:00

Final Exam:

April 13 from 9AM-12PM in RC 0005

Textbook:

Linear Algebra and its applications (4th Edition)
by David C. Lay


Homework Soutions

All the solutions to the homework and tests are posted electronically on

eRES, the electronic reserves

of Lakehead's library. The solutions are PDF files.


Homework Assignments

Homework is given out every Thursday, and will be due, at the beginning of class, the following Thursday. Assignments must conform to the guidelines in the course outline. Assignments are posted below.

Assignment 1 (Due: Jan. 19)

Sec. 5.1 -- 6, 8, 12, 18, 22ab
Sec. 5.2 -- 8, 10, 18, 22, 24
Sec. 5.3 -- 2,4


Assignment 2 (Due: Jan. 26)

Sec. 5.3 -- 8, 14, 20, 22, 24, 28
Sec. 5.4 -- 2, 4, 8, 12, 16, 22


Assignment 3 (Due: Feb. 2)

Sec. 5.5 -- 4, 10, 16, 22
Sec. 5.6 -- 2, 8, 12, 16
Sec. 5.8 -- 2, 6, 8


Assignment 4 (Due: Feb. 16)

Sec. 6.1 -- 6, 12, 18, 20, 28
Sec. 6.2 -- 2, 10, 14, 20 ,24, 26, 32


Assignment 5 (Due: March 1)

Sec. 6.3 -- 2, 6, 8, 12, 18, 22
Sec. 6.4 -- 4, 8 , 10, 14, 18


Assignment 6 (Due: March 8)

Sec. 6.5 -- 4, 8, 12, 16, 18
Sec. 6.6 -- 2, 8 (do not need to graph), 12
Sec. 6.7 -- 4, 6, 8, 20


Assignment 7 (Due: March 22)

Sec. 7.1 -- 10, 14, 22, 26, 30
Sec. 7.2 -- 2, 6, 8, 22abc


Assignment 8 (Due: March 29)

Sec. 7.2 -- 22de, 23, 24
Sec. 7.3 -- 2, 4, 8, 10
On a separate sheet, make one exam appropriate question with answer.


Assignment 9 (Due: April 3) [NOTE DATE!]

Sec. 7.4 -- 4, 6, 10, 16, Bonus 24


Handouts

All class handouts are available as PDF files.

Course Information
Course handout from first day of class

Midterm 1 Info Sheet
Review Sheet for first midterm

Midterm 2 Info Sheet
Review Sheet for second midterm

Final Exam Info Sheet
Review Sheet for Final Exam


Challenge Assignment

I will be giving out extra credit problems to work on that will allow you to learn the material in greater depth.


Challenge 1
Due Feb. 2, 2012

Challenge 2
Due March 8, 2012


Grading Scheme

Your final mark is broken down as:


Homework = 10%
2 Midterms = 50% (25% each)
Final Exam = 40%


Important Dates

Jan. 6, 2012 - First Day of Classes
Feb. 9, 2012 - Midterm 1
Feb. 20-24, 2012 - Reading Break
March 7, 2012 - Last Day to Drop
March 15, 2012 - Midterm 2
April 5, 2012 - Last Day of Classes
April 10-20, 2012 - Exams

Links

Lakehead University

LU Math Department

Adam's Home Page

Student Code of Conduct