HMC Math 73: Linear Algebra (Fall, 1999)
Homework

### Assignment #11 (due Fri. 12/10):

3.3: 3, 13, 27
4.7: 11, 13, 23, T2, ML4
6.1: 3, 19, T2
6.2: 3, 14, T2, ML3
On Wednesday, we discussed using Iterated Function Systems (IFSs) to draw fractals like Sierpinski's Triangle and Koch's Snowflake. Now you're going to write a MATLAB function to draw these fractals from the IFS functions. Here are some files you'll need.
11A: Write a MATLAB m-file to define a new function frac(C,k) that takes the matrix/vector data of an IFS in a matrix C and generates the image (with k points plotted) of the corresponding fractal. frac.m contains an outline and some code, as well as lots of notes and hints.
11B: Test your frac(C,k) function on the data variables Sier and Koch. You can load these variables into the workspace by executing the m-file hw11.m.
11C: Now try your frac(C,k) function on the data variables Frac1, Frac2 and Frac3, also in frac.m.
11D: Here are drawings of two more fractals... Frac4 and Frac5. Try to determine the IFS that generates them. That is, find a 2n-by-3 IFS matrix C for each so that frac(C,k) generates the fractal shown. Use your frac(C,k) function to test your guess.
11E: Now make your own... draw some squares and/or parallelagrams in the unit square that you think might make an interesting fractal. Compute the IFS data matrix C for it, then have frac(C,k) draw it. I don't care if it's pretty... as long as it's original. (I do want at least 3 functions in your IFS; that is, C should be at least 6x3.)
Fun: Here's some more IFS data I've made... fun.m. If you're enjoying playing with your new toy, these are a few IFS data sets that generate interesting results.

### Assignment #10 (due Fri. 12/03):

5.1: 23, 25, T11, T12
5.2: 5, 9, 17, T2, T4, T8, ML1c
BONUS: Find the Jordan Canonical form of the following matrices...
```                                     3   -4   -3   -3    0   -4   -6
-1   -4   -3    0   -3           0    3   -4   -6    3   -3    8
0   -1    1   -1   -2           0    0    3    0    4    0   -4
A =  0    0    2    0   -3      B =  0    0    0    3   -4   -2    1
0    0    0    2   -2           0    0    0    0    3    0    0
0    0    0    0    2           0    0    0    0    0    3    0
0    0    0    0    0    0    3
```
Do not use the MATLAB command 'jordan(A)' or anything similar. Instead, use the method described at the end of class on Monday... use
rank( (A-x*eye(n))^k )
where A is the square matrix, x is an eigenvalue of A, n is the dimension of A, and k is a matrix exponent at least 1. Instead of entering these matrices manually, you may download this hw10.m file into your MATLAB directory and then type 'hw10' at the MATLAB prompt. This will enter these matrices into the work space for you. I realize I didn't spend much time discussing this method, so feel free to see me for further details or clarification ('course, you should always feel free to see me for any help of any sort, but I thought I'd mention it anyway).

### Assignment #9 (due Wed. 11/24):

5.1: 7, 9, 17, T1, T2, T4, T6, T10, ML2ab, ML4
For ML4c, type "help eig", and use the eig(A) function to find A's eigenvectors.
(If you type "[P,D]=eig(A)", then P is the matrix you want, as long as its nonsingular)

### 2nd Midterm: Monday, Nov. 15

(No homework due Wed. 11/17)

### Assignment #8 (due Wed. 11/10):

4.8: 1, 3, 7, 15, 21, T4, T5, T6
4.9: 1, 3, 6, 9, T5, ML3
8A: Write an m-file to define a new MATLAB function "gs(A)" that applies the Gram-Schmidt process to the columns of a matrix A. All the following work should be done in MATLAB.
Further instructions (necessary)
Excessive hints (optional)
gs.m (rough m-file template... recommneded)
```       |  1  2  3  0  |
A = |  3  0 -3  2  |
| -2  1  4 -1  |
```
(i) Apply your gs function to A. Let B=gs(A).
(ii) Verify that B's columns are orthonomal by computing B'*B. What should the result be, and why?
(iii) Verify that B's columns span the column space of A by solving Bx=v for each column v of A (use rref([B A(:,j)]) for each column j). Briefly explain the zero values in each such solution.
(iv) Use MATLAB, and specifically your gs function, to do Problem 4.9.10.
8B: Prove that if U is a square matrix with orthonormal columns, then the rows of U are also orthonormal. (Hint: what is the inverse of U?)

### Assignment #7 (due Wed. 11/3):

4.4: 3, 7, 11, 18, 22, T5, T6, T11, T13, ML1, ML7
4.5: 5, T4, ML1
4.6: 33, T4, T10, ML4b, ML5b
7A: Let A be the 4x4 matrix given in Exercise 4.6.7.
(All the following instructions refer to Section 4.6;
The only real computations you should do are in (i)...
you may, as always, use MATLAB for rref)
(i) Find the rref of A and its transpose.
(ii) Apply the instructions for #5&6 to this matrix.
(iii) Apply the instructions for #7&8 to this matrix.
(iv) Apply the instructions for #9&10 to this matrix.
(v) Apply the instructions for #11-15 to this matrix.

### Assignment #6 (due Wed. 10/27):

4.2: 21, 22, T6, T7, T12, ML6
4.3: 2, 4, 6, 10, T2, T4, ML1, ML2

### Assignment #5 (due Fri. 10/22):

4.1: 2, 3, 11, 12, 16, 17, T1, T3, T5, T6, ML2
4.2: 2, 6, 10, 12, 14, 17, T1, T2, T5, T8, ML3, ML7

### 1st Midterm: Friday, Oct. 8

(No homework due Wed. 10/13)

### Assignment #4 (due Wed. 10/06):

2.1: 2, 6ab, 9, 18, 19b, 21, T3, T13, ML3a
2.2: 4, 14ab, 16b, T2
8.3: 1, 9, 11
You may use MATLAB for all of the following...
```    | 0  0 .75  0 |        | 0 1 0 |
A = | 0  0 .05 .1 |    B = | 0 0 1 |
| 1  0 .2  .5 |        | 1 0 0 |
| 0  1  0  .4 |

| .2  0 .6  0 |        | .2  0 .5  0  0  0 |
C = |  0 .4 .2 .5 |        |  0  0  0  0  1  0 |
| .7  0 .2  0 |    D = | .4  0 .4  0  0 .7 |
| .1 .6  0 .5 |        |  0  0 .1  1  0 .3 |
| .1  1  0  0  0  0 |
| .3  0  0  0  0  0 |
```
4A: For each of the above transition matrices A, B, C, D,
(i) Draw the transition graph for the corresponding Markov chain.
(ii) Compute the limit of powers of each matrix as the exponent gets large, or note when a single limit is not approached.
(iii) Describe the long-term behavior of each system. Does the initial state of the system affect the long-term behavior?
4B: Recall the "double-till-you-win" gambling model from class on Monday. Use MATLAB to generate the transition matrix A for the model if you start with \$1023, and the probability of winning a single game is 0.495. Let p(t) be the probability that you're bankrupt (have lost 10 in a row) after t (or fewer) bets.
(i) Describe p(t) in terms of A.
(ii) What is the first (lowest) value of t for which p(t)>0.5?
(iii) As it happens, it will take an average of about 2067 total bets to win an additional \$1023 in this fashion (if you don't go bust first). What is p(2067)? Compare this with your odds of doubling your money if you bet all \$1023 on a single game.
MATLAB Hints and tips for 4A and 4B
hw4.m (pre-constructed matrices for MATLAB)

### Assignment #3 (due Wed. 9/29):

1.6: 2, 6, 16, 19, 22, 24, 25, 26, T4, T8, T9, ML3, ML4
Note: For #ML4, try "inv(A)" and "A^(-1)" instead of "rref([A eye(size(A))])"
8.1: 2, 4, 9, 14, ML3

### Assignment #2 (due Wed. 9/22):

1.4: 2, 7, 10, 11, 14, T6, T8, T23, T24, T27, T28, ML3, ML7
1.5: 6, 9, 14, 32, T5, T9, ML3, ML6, ML12
Note: My copy of MATLAB doesn't have a reduce command,
so you may try the rref command instead.

Instructions for non-Mudders who need KATO accounts