Your Name Goes Here

Replace this with the Honor Code. Now is a very good time to reread the syllabus.

Contents

Hello again, scientist! I'll do all my writing in italics, and problems for you will be in bold. Comment your code, and explain your ideas in plaintext. As a general rule, I expect you to do at least as much writing as I do. Code should be part of your solution, but I expect variables to be clear and explanation to involve complete sentences. Cite your sources; if you work with someone in the class on a problem, that's an extremely important source. Don't work alone.

Problem 10.03.01.

The exact calculation of determinants is a numerical nightmare. The cofactor expansion algorithm for an n-by-n matrix requires n! multiplications and there's not really any way to cheat. Worse, every time you multiply numbers you propagate error. Consider the following.

A = [3301 4423; 2133 2858];
det(A)
ans =

   -1.0000

What is the exact value of det(A)? det(A^2)? det(A^3)? det(A^n)? Explain. Don't use MATLAB to find these values, you're about to be disappointed by it.

Go ahead, ask MATLAB what det(A^3) is. Uncomment this.

% det(A^3)

Wow that is really terrible. That is not even sort of close. Let's force MATLAB to do it exactly by using symbolic matrices. Uncomment this.

% B = sym(A)
% det(B^3)

It's 2018, right? We have powerful computers. Why worry about decimal precision and stuff when you can just do everything symbolically? Let's find out.

clear all
syms a s d f g h j k l;
C = [a s d; f g h; j k l]
 
C =
 
[ a, s, d]
[ f, g, h]
[ j, k, l]
 

Once you're ready, uncomment this. Explain the output. Note that it may take much longer to run the first time you publish this than any time afterwards, because MATLAB keeps calculations in memory. Make a note of how long it takes the first time you run the code.

% tic
% simplify(det(C^10)-det(C)^10)
% toc

Your computer is probably devoting about a teraflop = 10^12 calculations to MATLAB each second. Roughly how many calculations did you just force MATLAB to do?

Each time you multiply by C, you force MATLAB to do another column's worth of work, which increases the amount of stuff to do by a factor of about 3. Don't uncomment the following code.

% tic
% simplify(det(C^20)-det(C)^20)
% toc

If you were bad at reading directions and did uncomment the code, roughly how many days would the calculation take?