Condition Numbers

Read this first: Relation between vector norms, eigenvalues and condition numbers

Matrices with large condition numbers can be seen as nearly singular matrices. The MATLAB experiment below illustrates the relation with eigenvalues.

>> % We can see condition number as the ratio of the largest
>> % and smallest eigenvalue and use this to make matrices of
>> % with any condition number we want.
>> Q = orth(rand(5));   % eigenvectors
>> D = diag(rand(1,5))  % eigenvalues

D =

    0.2028         0         0         0         0
         0    0.1987         0         0         0
         0         0    0.6038         0         0
         0         0         0    0.2722         0
         0         0         0         0    0.1988

>> D(1,1) = eps

D =

    0.0000         0         0         0         0
         0    0.1987         0         0         0
         0         0    0.6038         0         0
         0         0         0    0.2722         0
         0         0         0         0    0.1988

>> A = Q*D*Q'

A =

    0.1750   -0.0652   -0.0282   -0.0421   -0.0440
   -0.0652    0.2421   -0.0782    0.0439   -0.1332
   -0.0282   -0.0782    0.1664   -0.0571   -0.0340
   -0.0421    0.0439   -0.0571    0.2783   -0.1948
   -0.0440   -0.1332   -0.0340   -0.1948    0.4117

>> cond(A)

ans =

   3.2068e+15

>> % This condition number is about 1/eps.