function Show121Props()
clc
n = 6;
Tn = T(n)
Sn = S(n)
disp('The Inverse of Sn is (2/(n+1))*Sn')
disp(' ' )
disp((2/(n+1))*Sn)
fprintf('|| (2/(n+1))*Sn*Sn - I || = %6.3e\n\n',norm((2/(n+1))*Sn*Sn - eye(n,n)))
disp('The diagonal matrix of Tn''s eigenvalues...')
Dn = diag(d(n))
fprintf('|| (2/(n+1))*Sn*Tn*Sn - Dn || = %6.3e\n',norm((2/(n+1))*Sn*Tn*Sn - Dn))

function Tn = T(n)
% The nxn second-order differnce matrix
Tn = 2*eye(n,n) + diag(-ones(n-1,1),-1) + diag(-ones(n-1,1),1);

function Sn = S(n)
% Sn is the nxn sine transform matrix
Sn = zeros(n,n);
for k=1:n
for j=1:n
Sn(k,j) = sin(k*j*pi/(n+1));
end
end

function dn = d(n)
% A column n-vector with the property that inv(S(n))*T(n)*S(n) = diag(dn)
dn = 4*sin((1:n)'*pi/(2*n+2)).^2;