% data for Exercise Set 3.2

ex = input('Exercise number (1-8, 23, 25-40)? ');

if ex==1
   A = [3 -8;-1 3] 
   disp('In Exercises 1-4, you should write out the inverse by hand.')
   disp('After that, you can use the command  inv(A)  to check your work.')
elseif ex==2
   A = [-4 -5;5 6] 
elseif ex==3
   A = [3 -7;-6 13] 
elseif ex==4
   A = [7 9;-6 -8] 
elseif ex==5
   A = [3 -8;-1 3], b = [5;2] 
elseif ex==6
   A = [3 -7;-6 13], b = [-4;1] 
elseif ex==7
   A = [1 2;3 8], b1 = [5;7], b2 = [-2;-2], b3 = [3;5], b4 = [1;7] 
   disp('The point of Exercises 7 and 8 is to compare the time needed for part (a)')
   disp('  with the time needed for part (b).  So these exercises should be done by')
   disp('  by hand.  You can use  inv(A)  to check your work.')
elseif ex==8
   A = [5 13;3 8], b1= [1;-1], b2 = [-2;1], b3 = [4;2], b4 = [1;1] 
elseif ex==23
   A = [1 0 0 0;2 1 0 0;3 2 1 0;4 3 2 1], I = eye(4) 
elseif ex==25
   E = [1 0 0 0;0 1 0 0;0 0 5 0;0 0 0 1], A = [1 0 0 0;2 1 0 0;3 2 1 0;4 3 2 1] 
elseif ex==26
   E = [1 0 0 0;0 1 0 0;0 0 5 0;0 0 0 1] 
elseif ex==27
   E = [1 0 0 0;0 1 0 0;0 0 1 0;0 -3 0 1], A = [1 0 0 0;2 1 0 0;3 2 1 0;4 3 2 1] 
elseif ex==28
   E = [1 0 0 0;0 1 0 0;0 0 1 0;0 -3 0 1] 
elseif ex==29
   A = [1 2;5 9]
   disp('The Study Guide explains how to implement the algorithm in the text.')
elseif ex==30 
   A = [-3 6;-1 3] 
   disp('The Study Guide explains how to implement the algorithm in the text.')
elseif ex==31 
   A = [1 0 5;1 1 0;3 2 6] 
elseif ex==32 
   A = [1 4 -3;-2 -7 6;1 7 -2] 
elseif ex==33 
   A = [1 3 -1;0 1 2;-1 0 8] 
elseif ex==34 
   A = [1 5 0;-2 -7 6;1 3 -4] 
elseif ex==35
   A = [-1 -5 -7;2 5 6;1 3 4] 
elseif ex==36
   A = [-1 -5 -7;2 5 6;1 3 4] 
elseif ex==37
   D = [.005 .002 .001;.002 .004 .002;.001 .002 .005], f = [20;50;10] 
elseif ex==38
   D = [.005 .002 .001;.002 .004 .002;.001 .002 .005], y = [.08;0;0] 
elseif ex==39
   A = [2 5;-1 -3;2 4], C = [1 3 1;1 0 -1]
elseif ex==40
   A = [1/3 -2/3 2/3;2/3 2/3 1/3]
   disp('The entries of A were entered as fractions.  Check this by computing 3*A.') 
   disp('The transpose of A is created by a single quote after the A.')
else
   disp('No data for this exercise in Section 3.2.') 
end
