MathGroup Archive 2009

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

Search the Archive

Re: A Sum-like notation for iteration

  • To: mathgroup at smc.vnet.net
  • Subject: [mg102376] Re: A Sum-like notation for iteration
  • From: cca at gregosetroianos.mat.br
  • Date: Fri, 7 Aug 2009 05:30:30 -0400 (EDT)

Peter,

1. >>The example you give doesn't make sense to me

Try this in Mathematica 6:

Hold[Sum[f[x], {x, {a, b, c}}]] // TraditionalForm

Before, I wrote "f" instead of "f[x]" because this was not relevant to my
main point, which was the 2D formatting of the Sum expression, and not its
interpretation. (In the latter case, of course, we can mantain just "f",
this now meaning any expression (possibly) containing the summation symbol
as a free variable.) The result I get in V6 (between the Hold) is this:

\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(x = 1\), \({a, b, c}\)]f(x)\)

In[2]:= $Version

Out[2]= "6.0 for Microsoft Windows (32-bit) (April 28, 2007)"

(I thought this was just a bug, to be fixed soon. But this formatting
disappeared from V7.) This made me thinking they were seriously trying to
find a 2D notation for list interators in Sum -- in the case above, a sum
over the list {a,b,c}. The formatting of such a sum is not "moot". By
analogy with the standard notation for sums over a set, it could be just
this:

\!\(\*UnderscriptBox["\[Sum]",
RowBox[{"x", "\[Element]",
RowBox[{"{",
RowBox[{"a", ",", "b", ",", "c"}], "}"}]}]]\)f[x]

In fact, this presentation is so natural that its incarnation as list
iterators in V6 was long awaited by me in previous versions. (One could
object to the use of Element above on the grounds that Element only works
for built in "domains". However, this invokes a (false) compositionality
principle for mathematical notation.)

2>>So far, I think Wolfram have done a
>>pretty good job of "walking the tightrope" when deciding what
>>notations to include.

I agree. And the future is very promissing and exciting. For example, I
think we=B4ll soon have multiscripts (for tensors) and other MathML elements.

3. >>how do we format something like Table[f[x], {x, 1, 100, 2}]?

Here is an interesting thing which is probably little known. Mathematica
correctly parses a 2D notation for summation with steps. Paste the
following in a TraditionalForm cell:

Module[{a=-2,b=10,s=3},\!\(\*
UnderoverscriptBox["\[Sum]", GridBox[{
{
RowBox[{"x", "=", "a"}]},
{
RowBox[{
RowBox[{"\[CapitalDelta]", " ", "x"}], "=", "s"}]}
}], "b"]f[x]\)]

I noticed this in V4 and it still works in V7. Curiously enough,
FormatValues@Sum does not inform us about this formatting. So, here is an
example of something "available within the system" which someone might
consider "non-standard".

Carlos Cesar de Araujo
Gregos & Troianos Educacional
www.gregosetroianos.mat.br
Belo Horizonte, MG, Brasil
(31) 3283-1122


  • Prev by Date: Re: error with Sum and Infinity
  • Next by Date: Re: Eigenvalues of sparse arrays
  • Previous by thread: Re: A Sum-like notation for iteration
  • Next by thread: Re: A Sum-like notation for iteration