**HMC Math 73: Linear Algebra (Spring, 1999)**

Homework

### Assignment #12 (due Wed. 5/5):

**5.1:** 4, 8, 20, T1, T2, T4, T6, T10, ML2ab, ML4b

### Assignment #11 (due Fri. 4/30):

**6.3:** 8, 14, 18, T5, T7
Monday and 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 Mon. 4/19):

**4.9:** 2, 6, 8, T3, ML2

**6.1:** 3, 8, 11, 12, 18, T5, T9, ML1a

**6.2:** 3, 4, 14, 18, T1, T2, T6, T11

### Problem #9A (due Mon. 4/12):

Since almost nobody seems to have completed this, you can try again over the weekend. The score will be counted as part of Assignment #9.

**9A:** 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

Even more hints (new)

gs.m (m-file template)

| 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.

### 2nd Midterm: Wednesday, April 7

### Assignment #9 (due Mon. 4/5):

**4.7:** 2, 8, 13, 23, T2, ML1, ML4

**4.8:** 2, 4, 8, 14, 18, T4, T5, T8

**9B:** 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 #8 (due Mon. 3/29):

**4.4:** 2, 6, 11, 18, T3, T6, T11, T12, ML1, ML8, ML10

**4.5:** 6, T4, ML2a

**4.6:** 18, 32, T4, T10, ML4b, ML5a

**8A:** 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)**)

**(i)** Find the rref of A and its transpose (you may use MATLAB).

**(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 #7 (due Wed. 3/24):

**4.2:** 22, T4, T5, T12, ML4, ML7

**4.3:** 2, 6, 10, T2, T6, T10, ML1, ML2

### Assignment #6 (due Mon. 3/8):

**2.1:** 8, 16, 19, T3, T7

**2.2:** 4, 14ab, T2

**4.1:** 2, 3, 12, 17, T3, T5, T6, ML2

**4.2:** 2, 6, 12, 17, T2, T6

### 1st Midterm: Wednesday, Feb. 24

(No homework due Mon. 3/1)

### Assignment #5 (due Mon. 2/22):

**2.1:** 2, 6abc, 11, 13, ML3

**3.2:** 12ab, 14, 17, 20, 24, 25, 28ab,
T5, T10, T14

**3.3:** 4, 14, 18, 22, 24, 26

**5A**: Write a MATLAB m-file to define a new function "det3(A)" to calculate determinants of 3x3 matrices using formula (3) on page 93. Use your new function to find the determinants of the matrices in Problems 2.1.15a and 2.1.15c.

Type "help function" to learn how to use m-files to define new functions. If you want to get fancy, you can explore "if", "size", and "strings" help topics to make your function verify that the argument is a 3x3 matrix, and return an error message if it's not. However, the main point of this exercise is to try to get you to figure out how to create and use your own m-files. If you had trouble with the m-file on last week's hw, you may want to try the instructions below. Submit your m-file ("det3.m") along with your MATLAB diary for this assignment.

Easy instructions for using MATLAB and m-files on Kato

### Assignment #4 (due Mon. 2/15):

**1.6:** 6, 14, 16, 20, 22, 25, 26,
T1, T8, T9, ML3, ML4

Note: For #ML4, try "inv(A)" and "A^(-1)" instead of "rref([A eye(size(A))])"

**8.3:** 1, 7, 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 Wednesday. 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.

Instructions for e-mailing MATLAB problems to the grader

Hints and tips for MATLAB problems

hw4.m (pre-constructed matrices for MATLAB)

### Assignment #3 (due Mon. 2/8):

**1.4:** 2, 3, 7, 10, 11,
T6, T8, T23, T24, T27, T28,
ML3, ML7

**1.5:** 6, 9, 14, 32,
T1, T5, ML3, ML6, ML12, ML13

Note: My copy of MATLAB doesn't have a **reduce** command,

so you may try the **rref** command instead.

### Assignment #2 (due Mon. 2/1):

**1.2:** 6, T3, ML1, ML2

**1.3:** 2, 4, 6, 9, 12, 16, 28, 30, T1, T4, T7, T8b, T13, ML1ade, ML5a

Instructions for MATLAB problems

### Assignment #1 (due Mon. 1/25):

**1.1:** 1, 2, 8, 15, 18, 20, 22, 24, T4

**1.2:** 2, 4

**Return to: Math 73 Main Page
* Greg Levin's Page
* Department of Mathematics**

Email: *levin@hmc.edu*