Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

RE: Undiscovered Bug?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg46880] RE: [mg46862] Undiscovered Bug?
  • From: "David Park" <djmp at earthlink.net>
  • Date: Fri, 12 Mar 2004 23:39:26 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Harold,

There's a way to make sense out of it. Take this example...

Part[x + y + z, {1, 3}]
x + z

Part took the 1st and 3rd parts and inserted them in the head of the
expression, Plus.

Part[x + y + z, {2, 2}]
2 y

Part took the 2nd part, and the 2nd part again and inserted them in the head
of the expression, Plus.

So with...

Part[x/y, {2, 2}]
1/y^2

Part took the 2nd part, 1/y, and the 2nd part again and inserted them in the
head of the expression, Times.

David Park
djmp at earthlink.net
http://home.earthlink.net/~djmp/


From: Harold Noffke [mailto:Harold.Noffke at wpafb.af.mil]
To: mathgroup at smc.vnet.net


MathGroup:

In Mathematica 5.0.1 with Windows 2000, I mistakenly used the [[{}]]
operator on x/y.  I was expecting an error, but I kept getting unusual
results as shown in In/Out's 2 to 5 below.

Have I stumbled on a bug, or is there a way to make sense out of this?


In[1]:= TreeForm[x/y]

Out[1]//TreeForm= Times[x, |           ]
                           Power[y, -1]

In[2]:= (x/y)[[{2,2}]]


Out[2]=  -2
        y

In[3]:= (x/y)[[{1,2,1}]]

         2
        x
Out[3]= --
        y

In[4]:= (x/y)[[{2, 2, 2, 2}]]

         -4
Out[4]= y

In[5]:= (x/y)[[{2, 1, 1, 0, 2, 2, 0}]]

             2  2
        Times  x
Out[5]= ---------
            3
           y


Regards,
Harold



  • Prev by Date: Re: Re: Creating a symmetric matrix
  • Next by Date: Re: Integrate vs NIntegrate
  • Previous by thread: Re: Undiscovered Bug?
  • Next by thread: Re: Undiscovered Bug?