Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Possible Bug in Mathematica 6

  • To: mathgroup at smc.vnet.net
  • Subject: [mg90199] Re: Possible Bug in Mathematica 6
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Wed, 2 Jul 2008 05:29:22 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <g4d31k$et0$1@smc.vnet.net>

Amir Ahmed Ansari wrote:

> I tried this on a friend=92s computer using Mathematica 6. Consider the
> following matrix:
> 
> {
>     { f_11, f_12, f_13, 0, 0, 0, 0, 0, 0 },
>     { 0, 0, 0, f_21, f_22, f_23, 0, 0, 0 },
>     { 0, 0, 0, 0, 0, 0, ( a f_11 + b f_21 ), ( a f_12 + b f_22 ), =
> ( a f_13 +
> b f_23 ) },
>     { f_21, f_22, f_23, f_11, f_12, f_13, 0, 0, 0 },
>     { ( a f_11 + b f_21 ), ( a f_12 + b f_22 ), ( a f_13 + b f_23 =
> ), 0, 0,
> 0, f_11, f_12, f_13 },
>     { 0, 0, 0, ( a f_11 + b f_21 ), ( a f_12 + b f_22 ), ( a f_13 =
> + b f_23
> ), f_21, f_22, f_23 }
> }

You should try to copy and past Mathematica expressions InputForm [1], 
for it is way more readable and far less prone to misinterpretation 
(especially when your email/newsgroup client adds spurious equal sings).

Also, avoid funny notation such as f_11 which is interpreted by 
Mathematica as Times[11, Pattern[f, Blank[]]] rather than the intended 
Subscript[f, 11].

Now, here is what I get having translated the above "code". The matrix m 
is a 6 by 9 rectangular matrix, with matrix rank 5.

m = {{f11, f12, f13, 0, 0, 0, 0, 0, 0}, {0, 0, 0, f21, f22, f23, 0, 0,
      0}, {0, 0, 0, 0, 0, 0, a*f11 + b*f21, a*f12 + b*f22,
      a*f13 + b*f23}, {f21, f22, f23, f11, f12, f13, 0, 0, 0},
     {a*f11 + b*f21, a*f12 + b*f22, a*f13 + b*f23, 0, 0, 0, f11, f12,
      f13}, {0, 0, 0, a*f11 + b*f21, a*f12 + b*f22, a*f13 + b*f23, f21,
      f22, f23}};


Dimensions[m]

{6, 9}

MatrixRank[m]

5

> All 5x5 have a determinant of 0 as can be seen by using Det[]. Yet,
> MatrixRank[] comes out to be 5. Is this a bug or am I doing something
> stupid?

What do you exactly mean by, "all 5x5 have a determinant of 0"? And more 
importantly, how did you check that?

Anyway, Mathematica is right in claiming that the matrix rank is 5.

Following the online documentation, we can check that the matrix rank 
(5) plus the length of the null space (4) is equal to the number of 
columns of m (9):

     Length[NullSpace[m]]

     4

Moreover, the matrix rank (5) is equal to the length of the 
SingularValueList (5):

     Length[SingularValueList[m]]

     5

(Note that it is very unlikely that MatrixRank, NullSpace, and 
SingularValueList are all buggy -- and in a consistent manner.)

Regards,
- Jean-Marc

[1] To use the _InputForm_ when copying an expression from a Mathematica 
notebook to an email client: select the cell(s) you want to include in 
your email, then within the *Cell* menu select either *Convert To* or 
*Display As* and choose *InputForm*. Finally, copy and paste as usual.


  • Prev by Date: Re: A set of several questions
  • Next by Date: Re: Draw two functions in a graph, one of them does also have a parameter.
  • Previous by thread: RE: Re: Possible Bug in Mathematica 6
  • Next by thread: Re: Possible Bug in Mathematica 6