Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #4301

Re: Just another Mathematica "Gotcha"

From DrMajorBob <btreat1@austin.rr.com>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Just another Mathematica "Gotcha"
Date 2011-08-11 09:11 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j206c8$722$1@smc.vnet.net> (permalink)
References <j1r5d3$fi4$1@smc.vnet.net> <201108101049.GAA26342@smc.vnet.net>

Show all headers | View raw


AES failed to take into account the precedence of operators??

Bobby

On Wed, 10 Aug 2011 05:49:57 -0500, Kevin J. McCann <kjm@kevinmccann.com>  
wrote:

> I think that in the first, Mathematica is applying your rule to Normal,  
> not to
> the output. Put parens around it (Series ...//Normal)/.b2->0 and it  
> works.
>
> Kevin
>
> On 8/9/2011 7:24 AM, AES wrote:
>> Seems as if the following two expression should yield the same output
>> -- seems that way to me anyway -- but they don't.  I'll hide the
>> actual outputs down below so Mathematica gurus (or "ordinary users")
>> can make their predictions as to which one does what.
>>
>> In[1]:= Series[a+(b1+b2)x,{x,0,1}] //Normal /.{b2->0}
>>
>> In[2]:= Series[a+(b1+b2)x,{x,0,1}] /.{b2->0} //Normal
>>
>> My conclusions:
>>
>> 1)  By any normal rules of interpretation or ordinary interpretations
>> of these statements, they both should do the same same thing.
>>
>> 2)  This is just another Mathematica "Gotcha" -- and not a
>> particularly forgivable one.
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Out[1]= a+(b1+b2) x
>>
>> Out[2]= a+b1 x
>>
>


-- 
DrMajorBob@yahoo.com

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Just another Mathematica "Gotcha" AES <siegman@stanford.edu> - 2011-08-09 11:24 +0000
  Re: Just another Mathematica "Gotcha" David Bailey <dave@removedbailey.co.uk> - 2011-08-10 10:45 +0000
  Re: Just another Mathematica "Gotcha" Richard Fateman <fateman@cs.berkeley.edu> - 2011-08-10 10:50 +0000
    Re: Just another Mathematica "Gotcha", and HoldForm bug Richard Fateman <fateman@cs.berkeley.edu> - 2011-08-11 09:12 +0000
    Re: Just another Mathematica "Gotcha", and HoldForm DrMajorBob <btreat1@austin.rr.com> - 2011-08-12 09:06 +0000
    Re: Just another Mathematica "Gotcha", and HoldForm bug "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-08-12 09:05 +0000
    Re: Just another Mathematica "Gotcha", and HoldForm bug "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com> - 2011-08-12 09:06 +0000
      Re: Just another Mathematica "Gotcha", and HoldForm bug Richard Fateman <fateman@cs.berkeley.edu> - 2011-08-27 12:18 +0000
    Re: Just another Mathematica "Gotcha", and HoldForm Murray Eisenberg <murray@math.umass.edu> - 2011-08-12 09:13 +0000
  Re: Just another Mathematica "Gotcha" "Kevin J. McCann" <kjm@KevinMcCann.com> - 2011-08-10 11:00 +0000
  Re: Just another Mathematica "Gotcha" Roger Wilson <rogerhw999@gmail.com> - 2011-08-11 07:26 +0000
  Re: Just another Mathematica "Gotcha" Simon <simonjtyler@gmail.com> - 2011-08-11 07:26 +0000
  Re: Just another Mathematica "Gotcha" DrMajorBob <btreat1@austin.rr.com> - 2011-08-11 09:11 +0000

csiph-web