% P4
  disp(' ')
  disp('*************************************')
  disp(' ')
  disp(' Problem 4')
  disp(' ')
  
  randn('seed',0)
 
% First Example
  m = 100;
  n = 10;
  A = randn(m,n);
  k = WeakColumn(A);
  sigma = svd(A);
  idx = [1:k-1 k+1:n];
  kResid = norm( A(:,idx)*(A(:,idx)\A(:,k)) - A(:,k));
  bound = sigma(n)*sqrt(n);
  disp(sprintf('Eg1: k = %1d  kResid = %15.12f   bound = %15.12f',k,kResid,bound))
  
% Second Example
  m = 100;
  n = 10;
  [U,R] = qr(randn(m,m));
  [V,R] = qr(randn(n,n));
  S = diag([ 1:(n-2) .000001 .00000001]);
  A = U(:,1:n)*S*V';
  k = WeakColumn(A);
  sigma = svd(A);
  idx = [1:k-1 k+1:n];
  kResid = norm( A(:,idx)*(A(:,idx)\A(:,k)) - A(:,k));
  bound = sigma(n)*sqrt(n);
  disp(sprintf('Eg2: k = %1d  kResid = %15.12f   bound = %15.12f',k,kResid,bound))

