%
% Exercise 8 from Sec.5.3
%
A = [5 1; 0 5]
eig(A)
rref([(A - 5 * eye(2)) zeros(2,1)])
[P,D] = eig(A)
rank(P)
det(P)

%
% Exercise 12 from Sec.5.3
%
A = [4 2 2; 2 4 2; 2 2 4]
eig(A)
rref([(A - 2 * eye(3)) zeros(3,1)])
rref([(A - 8 * eye(3)) zeros(3,1)])
[P,D] = eig(A)
rank(P)
det(P)
