Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assumptions in Mathematica's NullSpace Command for Symbolic Matrices

When executing Mathematica's NullSpace command on a symbolic matrix, Mathematica makes some assumptions about the variables and I would like to know what they are.

For example,

In[1]:= NullSpace[{{a, b}, {c, d}}]

Out[1]= {}

but the unstated assumption is that

a d != b c.

How can I determine what assumptions the NullSpace command uses?

like image 738
Tyson Williams Avatar asked May 30 '11 18:05

Tyson Williams


People also ask

How do you check if two matrices are the same in Mathematica?

Two matrices A and B are equal if they have the same dimensions and 𝑎ij = bij for every i and j. A square matrix is a matrix that has the same number of rows as columns; that is, and n × n matrix for some positive integer n.

What is the null of a matrix?

Definition. The nullspace of the matrix A, denoted N(A), is the set of all n-dimensional column vectors x such that Ax = 0.


2 Answers

The underlying assumptions, so to speak, are enforced by internal uses of PossibleZeroQ. If that function cannot deem an expression to be zero then it will be regarded as nonzero, hence eligible for use as a pivot in row reduction (which is generally what is used for symbolic NullSpace).

---edit---

The question was raised regarding what might be visible in zero testing in symbolic linear algebra. By default the calls to PossibleZeroQ go through internal routes. PossibleZeroQ was later built on top of those.

There is always a question in Mathematica kernel code development of what should go through the main evaluator loop and what (e.g. for purposes of speed) should short circuit. Only the former is readily traced.

One can influence the process in symbolic linear algebra by specifying a non-default zero test. Could be e.g.

myTest[ee_]:= (Print[zerotesting[ee]]; PossibleZeroQ[ee])

and then use ZeroTest->myTest in NullSpace.

---end edit---

like image 138
Daniel Lichtblau Avatar answered Sep 29 '22 11:09

Daniel Lichtblau


Found this:

In this case, if you expand your matrix by one column, the assumption shows up:

NullSpace[{{a, b, 1}, {c, d, 1}}]

{{-((-b+d)/(-b c+a d)),-((a-c)/(-b c+a d)),1}}

Perhaps useful in some situations

like image 32
Dr. belisarius Avatar answered Sep 29 '22 11:09

Dr. belisarius