function table=problem4(nn)

%Programming Problem 4 
% Input nn=10:10:100 list of dimensions
% Outpuf table with errors

table = [];

for n=nn
    
a=matrixhw1(n);
      
  x = (1:n)';
  b = a*x;
  [x1, aa, P] = gepp(a,b);
  
%error 
e=norm(x-x1)/norm(x);
table=[table; n e];
end


function a=matrixhw1(n)
a=[];
for i=1:n
    for j=1:n
        a(i,j)=1/(i+j)^2;
    end
    a(i,i)=1;
end
