Re: Strange result in MMa 3.0

• To: mathgroup at smc.vnet.net
• Subject: [mg8178] Re: Strange result in MMa 3.0
• From: murray at math.umass.edu (Murray Eisenberg)
• Date: Mon, 18 Aug 1997 03:07:01 -0400
• Organization: University of Massachusetts, Amherst
• Sender: owner-wri-mathgroup at wolfram.com

```Julian Stoev !!! Address is anti-spamed !!! (stoev at removespam.usa.net) wrote:

: 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].
: [snip]
: So I was wondering why Mathematica gives result for NullSpace transposed?
: Is the definition I am using for NullSpace wrong?

Mathematica rather consistently works with row vectors rather than
column vectors.  For example, Eigenvectors also returns row vectors.
I cannot comment on the design reasons for that.  Of course there's a
dissonance with what's commonly done in many math books, but think of
how much screen space vectors would take if they always were formed
into vertical columns.

Of course, there is really no such thing as a row vector or a column
vector in Mathematica -- just lists.  A simple list of scalars has an
interpretation as a row vector and, of course, displays horizontally
by default.

A column vector is a matrix with one column, so to form it in
Mathematica you need a list of the form {{a}, {b}, {c}, ... }.

You can readily convert the output from NullSpace by the following:

tocol[vect_] := Map[List, vect]
(* that converts a single row vector  into the form of a list of
1-element lists that, using MatrixForm upon it, will display as a
column vector *)

Map[tocol, NullSpace[A]]

The latter converts each of the (row)vectors in the result of
NullSpace into a column vector.

By the way, strictly speaking, the result from NullSpace is NOT the
null space, but rather a BASIS OF the null space!

--
Murray Eisenberg                       Internet:  murray at math.umass.edu
Mathematics & Statistics Dept.            Voice:  413-545-2859 (W)
University of Massachusetts                       413-549-1020 (H)
Amherst, MA 01003                           Fax:  413-545-1801

```

• Prev by Date: Re: Is there really no longer any way to Find cells by cell style?
• Next by Date: Re: Is there really no longer any way to Find cells by cell style?
• Previous by thread: Re: Strange result in MMa 3.0
• Next by thread: Re: Strange result in MMa 3.0