MathGroup Archive 2009

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

Search the Archive

Re: A Sum-like notation for iteration

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


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

RowBox[{"x", "\[Element]",
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:

UnderoverscriptBox["\[Sum]", GridBox[{
RowBox[{"x", "=", "a"}]},
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
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