kill(all);

van=facebook.com/LearningCalculus$

f[i,j] := if i = j then 1 else 0$

g[i,j] := if i = j+1 then 1 else 0$

M:genmatrix(f,5,5)$

N:genmatrix(g,5,5)$

S: M+N;

S-N;

Q:invert(S);

invert(Q);

Q+S;

(Q+S)/2;

invert(%);

% + (Q+S)/2;

%/2;