Null Space

Author

Eric W. Weisstein
June 4, 2003

This notebook downloaded from http://mathworld.wolfram.com/notebooks/LinearAlgebra/NullSpace.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/NullSpace.html.

©2005 Wolfram Research, Inc. except for portions noted otherwise

Code

IntegerNullSpace[m_List?MatrixQ]:=Module[{m2=Transpose[Join[m,IdentityMatrix[Length[m[[1]]]]]],
hnf,
nullvecs
},
hnf=Developer`HermiteNormalForm[m2][[2]];
nullvecs=Select[hnf,Apply[And,Map[#==0&,Take[#,Length[mat]]]]&];
Map[Drop[#,Length[mat]]&,nullvecs]
]

Real Nullspace

n1=NullSpace[{{-2,-2,-1,-1,0,0,-1,0,-1,1,0,1},{1,0,1,-1,0,-1,-1,-2,0,-2,0,-1}}]

Length[n1]

Integer Nullspace

n2=IntegerNullSpace[{{-2,-2,-1,-1,0,0,-1,0,-1,1,0,1},{1,0,1,-1,0,-1,-1,-2,0,-2,0,-1}}]