I need to investigate how the condition number of the Hilbert matrix grows with the size $N$. The Matlab command is cond(hilb(N),2):
- Compute the condition number of the Hilbert matrices $H_N \in {\Bbb R}^{N \times N}$, for all $N \in \{ 1, 2, \dots, 50 \}$
- Using Matlab to calculate the log of condition number of $H_N$ versus $N$. (The blue 'x')
- Compare this with the anticipated theoretical growth (The red line) of $$O\left(\frac{(1+\sqrt{2})^{4N}}{\sqrt{N}}\right) $$
I got a plot like this:
When $N = 13$, the Condition Number reaches the maximum. The Condition Number does not continue to grow when $N>13$. Why does the Condition Number stop growing after $N=13$?
% generate Hilbert matrices and compute cond number with 2-norm
N=50; % maximum size of a matrix
condofH = []; % conditional number of Hilbert Matrix
N_it= zeros(1,N);
% compute the cond number of Hn
for n = 1:N
Hn = hilb(n);
N_it(n)=n;
condofH = [condofH cond(Hn,2)];
end
% at this point we have a vector condofH that contains the condition
% number of the Hilber matrices from 1x1 to 50x50.
% plot on the same graph the theoretical growth line.
% Theoretical growth of condofH
x = 1:50;
y = (1+sqrt(2)).^(4*x)./(sqrt(x));
% plot
plot(N_it, log(y));
plot(N_it, log(condofH),'x', N_it,log(y));
% plot labels
plot(N_it, log(condofH),'x', N_it,log(y))
title('Conditional Number growth of Hilbert Matrix: Theoretical vs Matlab')
xlabel('N', 'fontsize', 16)
ylabel('log(cond(Hn))','fontsize', 16)
lgd = legend ('Location', 'northwest')
legend('MatLab', 'Theoretical')
legend('show')
