N=[10 100 500 1000 2000];
for ith=1:10
for nth=1:5
tt(nth,ith) = cond(rand(N(nth)));
end
end
mean(tt')
1.6747e+02 1.5101e+04 3.6118e+04 3.1278e+05 5.6422e+05
Ah Marco, well done. It is the off diagonals that are noisy.
B= A*inv(A); % this should be the identity matrix
[~,U] = lu(B);
for ith=1:2200 %focus on the off diagonals
B(ith,ith)=0;
U(ith,ith)=0;
end
plot(max(B)) % but the off diagonals are not zero, rather it is noise on the order of 1e-12
plot(max(B-B')) % alternatively asking if it is Hermitian and no - the noise again.
plot(max(U)) % noisy still.
Now for a simple 3 by 3
C = [ a b c; d e f; g h i];
det(C) = aei + bfg + cdh - ceg - bdi - afh; the last terms contain a 1 in the product from the diagonal
Combining terms:
det(C) = 1 + ((N-1)*O(1e-12^N)) - (N*O(1e-12^(N-1)))