MathGroup Archive 2011

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

Search the Archive

Just another Mathematica "Gotcha"

  • To: mathgroup at
  • Subject: [mg120759] Just another Mathematica "Gotcha"
  • From: AES <siegman at>
  • Date: Tue, 9 Aug 2011 07:19:34 -0400 (EDT)
  • Delivered-to:

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

  • Prev by Date: More robust pattern based replacement rules?
  • Next by Date: Re: MathLink C# .NET 2010
  • Previous by thread: Re: More robust pattern based replacement rules?
  • Next by thread: Re: Just another Mathematica "Gotcha"