function ex04()
%% a.
a = 1/sqrt(2);
A = [0  1  0  0 -a -1  0  0  0;...
     0  0  1  0  a  0  0  0  0;...
     0  0  0  0  0  1  0 -1  0;...
     0  0  0  0  0  0  1  0  0;...
     0  0  0  0  0  0  0  1  a;...
     0  0  0  1  a  0  0  0 -a;...
     0  0  0  0  a  0  1  0  a; ...
     a  0  0 -1  0  0  0  0  0;
     a  0  1  0  0  0  0  0  0]
b = [0 15 0 20 0 0 0 0 0]'
f = A \ b
condA = cond(A)

%% b.
L = 1000;
s = 1/sqrt(L^2 + 1);
c = L/sqrt(L^2 + 1);
a = 1/sqrt(2);

A = [0  1  0  0 -c -1  0  0  0;...
     0  0  1  0  s  0  0  0  0;...
     0  0  0  0  0  1  0 -1  0;...
     0  0  0  0  0  0  1  0  0;...
     0  0  0  0  0  0  0  1  a;...
     0  0  0  1  c  0  0  0 -a;...
     0  0  0  0  s  0  1  0  a; ...
     a  0  0 -1  0  0  0  0  0;
     a  0  1  0  0  0  0  0  0]
b = [0 15 0 20 0 0 0 0 0]'
f = A \ b
condA = cond(A)