[math-fun] Subject: Re: Draft of my November 2017 blog post
From: Michael Kleber <michael.kleber@gmail.com> To: math-fun <math-fun@mailman.xmission.com> Cc: James Propp <jamespropp@gmail.com> Reply-To: math-fun <math-fun@mailman.xmission.com>
I'm with Knuth (and his home invader) on this one. I like to start my Sums at 0 and my Products at 1: Product[k!^DifferenceDelta[Log[k], {k, 3}], {k, ∞}] == Khinchin^Log[2] Unfortunately, Mathematica starts its Sums at 1 (default) as well. (That guy rappelling through the skylight risked setting off Knuth's pipe organ.) --rwg On Mon, Nov 13, 2017 at 10:58 AM, Henry Baker <hbaker1@pipeline.com> wrote:
Make sure to run spell check; there are a couple of typos.
Re do/for loops:
Mathematicians created the original sin when they used 1-origin array subscripting. You'd have thought that a thousand years of zero usage would have taught them something!
Grace Hopper extended this sin with her 1-origin inclusive do-loops in Fortran, and we've all paid multiple billions in software debugging costs ever since.
The answer is surprisingly simple:
Always use zero-origin array indexing, and always use half-open interval do/for loops:
sum:=0; for i from 0 upto length(a) do sum:=sum+a(i);
or
sum:=0; N:length(a); for i in [0,N) do sum:=sum+a(i);
How so many computer languages could screw this up for so many years is utterly amazing!
At 06:37 AM 11/13/2017, James Propp wrote:
Hi,
I started writing a new draft titled "Impaled on a Fencepost" and would love to get people's feedback. I plan on publishing it on the 17th.
Some questions and misgivings that remain in my mind:
Am I missing some fun or important examples of fencepost error? Should I cite linguistics literature on the ambiguity of the word "between" (assuming it exists)? I feel I'm forgetting some famous movie or TV show featuring the fail-to-count-yourself error. Is "third, fifths, etc." terminology really called "ordinal" terminology for intervals? (I just made that up.) Was it really invented during the Renaissance? (I just made that up too.) Am I correct in what I write about legal matters?
I forgot to remind everyone that if you think your comment is one that might elicit a response from me (e.g., "You're right, my wording was confusing; is this better?"), or if you want your contribution to be acknowledged, then please sign your response; otherwise I won't know who you are.
Please leave your feedback here: https://mathenchant.wordpress.com?p=1998&shareadraft=5a0912d2a2e4a
Thanks,
Jim Propp
participants (1)
-
Bill Gosper