Condition number of Vandermonde matrix¶

Consider $N+1$ unformly spaced distinct points $$-1 = x_0 < x_1 < \ldots < x_N = 1.0$$ Their Vandermonde matrix is $$\begin{bmatrix} 1 & x_0 & x_0^2 & \ldots & x_0^N \\ 1 & x_1 & x_1^2 & \ldots & x_1^N \\ \vdots & \vdots & \vdots & & \vdots\\ 1 & x_N & x_N^2 & \ldots & x_N^N \end{bmatrix}$$

In [16]:
from numpy import linspace,zeros
from numpy.linalg import cond

In [17]:
for N in range(2,21):
x = linspace(-1.0,+1.0,N+1)
V = zeros((N+1,N+1))
for j in range(0,N+1):
V[j][:] = x**j
print "%8d %20.8e" % (N,cond(V))

       2       3.22550493e+00
3       8.01156105e+00
4       2.35309087e+01
5       6.38272826e+01
6       1.89814113e+02
7       5.35353118e+02
8       1.60544370e+03
9       4.62644992e+03
10       1.39516269e+04
11       4.07548818e+04
12       1.23389738e+05
13       3.63830758e+05
14       1.10480853e+06
15       3.28003166e+06
16       9.98312389e+06
17       2.97935974e+07
18       9.08473096e+07
19       2.72240823e+08
20       8.31377051e+08