%eks 10.3

n=4;
h=1/n;
y=zeros(n+1,1);
y(1)=1;

for i = 1:n
    y(i+1)=(2-h)*y(i)/(2+h);
end

disp(y(end)-exp(-1))