Re: Uniform design
- To: mathgroup at smc.vnet.net
- Subject: [mg48365] Re: Uniform design
- From: ab_def at prontomail.com (Maxim)
- Date: Tue, 25 May 2004 07:18:08 -0400 (EDT)
- References: <c8pu2d$kq9$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
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:
In[1]:=
Integrate[Log[a] + x + O[a], {x, 0, 1}]
Out[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:
In[2]:=
z + O[n] /. z -> 1/n + 1
z + O[n]^2 /. z -> 1/n + 1
Out[2]=
1 + O[n]
Out[3]=
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:
In[4]:=
Limit[O[n]/n^2, n -> 0]
Out[4]=
ComplexInfinity
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:
In[5]:=
Limit[z/n + O[n], n -> 0]
Out[5]=
ComplexInfinity
At least this one is good? Not exactly, because standard Mathematica
behaviour in such cases is to return z*Infinity.
In[6]:=
HarmonicNumber[n, 2] + O[n, Infinity]
-HarmonicNumber[n, 2] + O[n, Infinity]
Out[6]=
Pi^2/6 + O[1/n]^1
Out[7]=
-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 inbox.ru
(don't use the prontomail address anymore please)
- Follow-Ups:
- Re: Re: Uniform design
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Re: Uniform design