# NullSpace[_, Method->“OneStepRowReduction”] is sometimes wrong; how can I work out when this happens?

Edit 2015: Has this been fixed yet?

(This is on MMA 7.0.1.0 on OS X)

I've just found a large matrix m for which NullSpace[m] and NullSpace[m, Method->"OneStepRowReduction"] give different answers (the first one is the correct answer).

I put the matrix up at pastebin as won't fit here!

What's going on? How might I guess ahead of time which arguments are going to break Method->"OneStepRowReduction"?

(Update; it seems the bug has got worse in 8, rather than better.)

• On a side note, Mathematica 8 yields an empty list in both cases. I'm going to assume the bug has been fixed. – David Feb 2 '12 at 0:57
• Could have been either of two bugs in "OneStepRowReduction" when algebraics are present. Both were fixed prior to version 8 release. – Daniel Lichtblau Feb 2 '12 at 14:47
• No, I think this is a real problem --- and your answers indicate it's got worse in Mathematica 8, not better! The NullSpace should not be empty. Here's the result of RootReduce[NullSpace[m]]: {{Root[3 - 80 #1^2 + 9 #1^4 &, 1], Root[3 - 80 #1^2 + 9 #1^4 &, 4], Root[-3 + 4 #1^2 + 3 #1^4 &, 4], Root[3 - 32 #1^2 + 81 #1^4 &, 3], Root[1 - 38 #1 + 116 #1^2 - 90 #1^3 + 27 #1^4 &, 4], Root[1 + 38 #1 + 116 #1^2 + 90 #1^3 + 27 #1^4 &, 4], Root[-1 + 23 #1^2 + 27 #1^4 &, 3], 1}}, which you can verify really is in the kernel. – Scott Morrison Feb 2 '12 at 19:08
• @DanielLichtblau, is there any reference for these bugs? I'd like to be able to ascertain which code running in 7 I can or cannot 'trust' (to the extend that trusting Mathematica is ever possible). – Scott Morrison Feb 2 '12 at 20:04
• @Scott Morrison (1) No reference I'm aware of. (2) I verified that matrix.your_vector has a 97th component of around -10.8. So it's not a serious contender for a null vector. – Daniel Lichtblau Feb 2 '12 at 22:02

\$Version
(*  "10.4.1 for Mac OS X x86 (64-bit) (April 11, 2016)"  *)


Let m = <pastebin monster>.

ns1 = NullSpace[m];
ns2 = NullSpace[m, Method -> "OneStepRowReduction"];
diff = ns1 - ns2; RootReduce[diff]
(*  {{0, 0, 0, 0, 0, 0, 0, 0}}  *)


So they're equivalent in V10.4.1.

Update: Checking correctness

After many minutes, this returns the zero vector:

m.First@ns1 // RootReduce


And these all return a rank of 7:

MatrixRank[m]
MatrixRank[N[m]]
MatrixRank[N[m, 32]]


Finally, Dimensions[m] yields {880, 8}, all of which confirms the answer is correct.

• Does the output appear to be correct or could they both be wrong? – Mr.Wizard Jul 20 '16 at 21:43
• @Mr.Wizard It appears (numerically) to give a correct null space member and the matrix rank comes out to be 7 (for an 880 x 8 matrix), both on the exact matrix and on numericized matrices at various precisions. So yes, the output appears to be correct. (I'm waiting on m.First@ns1 // RootReduce, but I'm not sure it will finished any time soon, or that I will wait for it.) – Michael E2 Jul 20 '16 at 21:50

I tried this problem (fed the matrix into an object called m) with 10.3 on a Macbook pro running OS X 10.10.5 (Yosemite). Both methods yield an empty Nullspace, though onesteprowreduction took much longer. So it looks like it hasn't been fixed in 10.3 :(.

Another possibility remains. @scott-morrison - can you demonstrate that it really is in the kernel?

In:= NullSpace[m]

Out= {}

In:= NullSpace[m, Method -> "OneStepRowReduction"]

Out= {}

• This answer might be more appropriate as a comment. – bbgodfrey Jul 20 '16 at 21:23
• True, but I lack the reputation to be able to comment on others' questions – Michael Neale Jul 26 '16 at 22:26