%Problem 5
clear all;
n= 10000;
A=sparse([],[],[],n,n,3*n-4);
b=zeros(n,1);

A(1,1)=1;
A(n,n)=1;
b(1,1)=1;

for i=2:n-1
    A(i,i-1)=1;
    A(i,i)=-2;
    A(i, i+1)=1;
end

%Determine how long it takes to solve Ax=b
tic
x=A\b;
toc