                               Homework 3 
                          MA/CS 375, Spring 2002
                             Due March 25 

----------------------------------------------------------------------------
[i.] 6.2.4
[ii.] 6.3.4
[iii.] 6.3.6
[iv.] 6.3.7
[v.] 6.4.3
-------------------------------------------------------------DISCUSSION
% Problem 1 <6.2.4 >
%------------------
% Write a fuction
%      function x = TriCorner(d,e,f,alpha,beta,b)
%  that solves the "Tridiagonal matrix with corners"
%   
%       T* x = b
% with
%      T = W + a*en*e1' + b e1*en'
%
% where W is tridiagonal, using the formula 
%
%      x = z - Y * / 1+y_11    y_12 \^-1  /z_1\
%                  \  y_n1    1+y_n2/   * \z_n/
% where
%      z = W^-1 * b , Y = W^-1 [a*en b*e1]
%
%  Obviously, what is meant here, is not to compute W^-1 explicitly,
%  but rather "functionally". For example, z satisfies  W*z = b,
%  and is found easily once we obtain the LU factorization of W, and 
% similarly for W^-1 * en and W^-1 * e1.
% ------------------------------------------------
%   Explanation of the formula
% ------------------------------------------------
% The underlying idea (see "Numerical Recipes"), is the identity
% (called the "Sherman-Morisson-Woodburry" (SMW) formula):
%
%  (A + U*V)^-1 = 
%     A^-1 - [A^-1*U*(I+V'*A^-1*U)^-1*V'*A^-1]
%
% where A is nXn, U is nXk and V is kXn. When k is small compared
% to n, then this is an economical way for solving the problem, once
% an LU factorization for A is known. In the present problem, A is an
% nXn tridiagonal matrix, with cheap LU-factorization, so that a 
% "rank-2" modification can also be done relatively easily.
% ------------------------------------------------
% Here, A = W, a tridiagonal matrix
% Also, a*en*e1'+b*e1*en' = /0 b\ * /1 0 ... 0 0\ ( =: V' (2Xn))
%                           |0 0|   \0 0 ... 0 1/
%                           |. .|
%                           |0 0| (=: U (nX2)}
%                           \a 0/
% then, Y satisfies:
%     W*Y = U => Y = W^-1 * U 
% while
%     V'*Y = /y_11  y_12\
%            \y_n1  y_n2/
% and, finally,
%     V'*W^-1*b = V'*z = /z_1\
%                        \z_n/
%     
% ------------------------------------------------
% You are required to use the scripts:
%    TriDiLU.m
%    LBiDiSol.m
%    UBiDiSol.m
% ------------------------------------------------
% Note that the only real work here is the solution of the tridiagonal
% system
%                   W * z = b
% ------------------------------------------------
----------------------------------------------------------------------------
------------------------------------------------------------------------
INSTRUCTIONS:
   The following format is required of all work turned in:
(0) Be as brief as you can, but give all information required to
    resolve a question.
(1) Team names must appear on top left hand corner ON ALL PAGES
    turned in.
(2) Staple your papers together.
(3) All work must be typed (say in Word or Latex); you may handwrite
    math symbols if you do not have access to appropropriate software.
(4) Your reports must be structured as follows:
Problem # (each beginning on new page):
(  i) Problem statement
( ii) Theoretical analysis of question: if an algorithm must be written
      to solve the problem, give the mathematical/theoretical outline
      here and describe the method of solution.
(iii) Results: a coherent presentation of results. Include a minimum of
      numerical/graphical info. that is needed to answer the question.
      One graph, properly labeled, is preferable to lists of numbers.
( iv) Discussion: what you did, how your work answered the question.
(  v) Printouts of scripts and results.
------------------------------------------------------------------------ 
