/*  there or 4 vectors in that we show 3 vectors are independent but 4  are dependent */
a=array([[1,1,1,2],[0,1,1,3],[0,0,1,4]])
/ * considering first 3 vectors for showing 3 vectors are independent*/
b=array([[1,1,1],[0,1,1],[0,0,1]])
c=det(b)
if c==0:
   print 'dependent'
else:
   print 'independent' 
/* for showing 4 vectors are dependent*/
z=array([[0],[0],[0],[0]])
import scipy.linalg as linalg
c=linalg.solve(a,z)
if c==0 /* i.e checking for c is a zero vector or not*/
    print 'independent'
else
    print 'dependent'

Strang-2.3-4-U (last edited 2010-12-17 06:47:06 by 172)