MathGroup Archive 2004

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

Search the Archive

Re: Uniform design

  • To: mathgroup at
  • Subject: [mg48365] Re: Uniform design
  • From: ab_def at (Maxim)
  • Date: Tue, 25 May 2004 07:18:08 -0400 (EDT)
  • References: <c8pu2d$kq9$>
  • Sender: owner-wri-mathgroup at

Continuing on the topic of uniform design, let's see how well various
functions handle SeriesData. For instance, series expansions can be
integrated just like other expressions:

Integrate[Log[a] + x + O[a], {x, 0, 1}]

a + O[a]^2

The result is incorrect, probably because Integrate overlooks the
possibility that SeriesData can contain logarithmic terms. Next, we
can substitute values into series:

z + O[n] /. z -> 1/n + 1
z + O[n]^2 /. z -> 1/n + 1

1 + O[n]

1/n + 1 + O[n]^3

Only in the first case we lose the 1/n term, in the second case lose
O[n]^2 term. Let's look at Limit:

Limit[O[n]/n^2, n -> 0]


Strictly speaking, this is incorrect too, because n^2 is also O[n].
Another issue is that Mathematica outputs O[n]/n^2 as 1/O[n], which I
suppose can be acceptable as a conventional notation, but it's
questionable in the strict mathematical sense: O(n)/n^2 is O(1/n) and
not 1/O(n). Limit of 1/O(n) (not Mathematica's 1/O[n]!) would indeed
be equal to ComplexInfinity. Another example:

Limit[z/n + O[n], n -> 0]


At least this one is good? Not exactly, because standard Mathematica
behaviour in such cases is to return z*Infinity.

HarmonicNumber[n, 2] + O[n, Infinity]
-HarmonicNumber[n, 2] + O[n, Infinity]

Pi^2/6 + O[1/n]^1

-HarmonicNumber[n, 2] + O[1/n]^1

The last example demonstrates a different issue: transformation rules
catch only some of all the possible cases; here changing the sign
prevents the application of the rule, sometimes f[n]+O[n] and
Series[f[n],{n,0,0}] work slightly differently.

Lastly, there are some other problems with notation: O[x]^0 is allowed
in the output, but not as the input; O[1/x] will be output exactly as
O[x,Infinity] but means something different.

Maxim Rytin
m.r at
(don't use the prontomail address anymore please)

  • Prev by Date: Re: Min[], Max[]
  • Next by Date: Re: Compile
  • Previous by thread: Re: Uniform design
  • Next by thread: Re: Re: Uniform design