Re: Strange result in MMa 3.0
- To: mathgroup at smc.vnet.net
- Subject: [mg8197] Re: Strange result in MMa 3.0
- From: Robert Knapp <rknapp>
- Date: Mon, 18 Aug 1997 23:24:46 -0400
- Organization: Wolfram Research, Inc.
- Sender: owner-wri-mathgroup at wolfram.com
Julian Stoev !!! Address is anti-spamed !!! wrote: > > Dear Group, > I am used to think, that the definition of NullSpace is: > NullSpace of linear operator A is a set N(A) defined by all elements x for > which A.x=[0] > > But Mathematica 3.0 gives me this strange result: > ========= > In[1]:= A = {{0, 1, 1, 2, -1}, {1, 2, 3, 4, -1},{2, 0, 2, 0, 2}} > Out[1]= {{0, 1, 1, 2, -1}, {1, 2, 3, 4, -1},{2, 0, 2, 0, 2}} > > In[2]:= NullSpace[A] > Out[2]= {{-1, 1, 0, 0, 1}, {0, -2, 0, 1, 0},{-1, -1, 1, 0, 0}} > (*this is correct, but transposed and this makes problems later*) > > In[3]:= > A . Transpose[NullSpace[A]] > Out[3]= > {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}} > =========================== > The problem is that in Mathematica A . transpose(nullspace(A))=[0]. > I don't want to give here the result when I try correct A . Nullspace(A) > The program reports that tensors have incopatible dimensions and returns > unevaluated result. > So I was wondering why Mathematica gives result for NullSpace transposed? > Is the definition I am using for NullSpace wrong? No actually both are right. Think of the list Out[2]= {{-1, 1, 0, 0, 1}, {0, -2, 0, 1, 0},{-1, -1, 1, 0, 0}} as representing a set of three elements (vectors), {-1, 1, 0, 0, 1}, {0, -2, 0, 1, 0}, and {-1, -1, 1, 0, 0}, each of which is in the Null space of A: In[2]:= A.{-1, 1, 0, 0, 1} Out[2]= {0, 0, 0} In[3]:= A.{0, -2, 0, 1, 0} Out[3]= {0, 0, 0} In[4]:= A.{-1, -1, 1, 0, 0} Out[4]= {0, 0, 0} Or alternatively, you can write In[5]:= (A.#)& /@ NullSpace[A] Out[5]= {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}} which is equivalent to A . Transpose[NullSpace[A]].