new keywords for limit()

8 views
Skip to first unread message

Burcin Erocal

unread,
Jul 24, 2010, 5:30:15 PM7/24/10
to sage-...@googlegroups.com
Hi,

Trac #9200 [1] adds new keywords from_left and from_right to the top
level limit() function. We already have above, below, minus, plus as
keywords. I wonder if a new one is necessary, and if it should be
"from_left/from_right".

[1] http://trac.sagemath.org/sage_trac/ticket/9200

For reference, Maple only support 4 keywords [2], left, right, real,
complex.

[2] http://www.maplesoft.com/support/help/Maple/view.aspx?path=limit

IMHO, we should also try to keep the interface simple, and not clutter
things up by supporting many different ways of doing the same thing.

Any comments?


Cheers,
Burcin

Rob Beezer

unread,
Jul 25, 2010, 1:00:12 AM7/25/10
to sage-devel
Hi Burcin,

As Dana Ernst has now mentioned on the ticket, this an outgrowth of
the professional development workshop that Jason Grout, Karl-Dieter
Crisman and myself have been running this summer on Sage through the
Mathematical Association of America. Dana is one of our top
students. ;-) But seriously, he is interested in contributing to
Sage and I've been helping him along with the process.

Another one of the "students" (faculty at mostly undergraduate
colleges) wondered about why these keywords were not present (I think
they may be in some other of the M's, but obviously not Maple, and I
can't recall exactly). So we all suggested they could be added, and
Dana took the bait.

So three developers thought this would be useful in their teaching.
Which is not to say it shouldn't be discussed here in the open. I'm
all for avoiding clutter, but also thought these keywords would be
valuable (and IMHO opinion, preferable to "above" and "below" when we
tend to draw the axis for the domain horizontally!).

Thanks for bringing the discussion here.

Rob

Burcin Erocal

unread,
Jul 26, 2010, 3:05:31 AM7/26/10
to sage-...@googlegroups.com
Hi Rob,

On Sat, 24 Jul 2010 22:00:12 -0700 (PDT)
Rob Beezer <goo...@beezer.cotse.net> wrote:

> Hi Burcin,
>
> As Dana Ernst has now mentioned on the ticket, this an outgrowth of
> the professional development workshop that Jason Grout, Karl-Dieter
> Crisman and myself have been running this summer on Sage through the
> Mathematical Association of America. Dana is one of our top
> students. ;-) But seriously, he is interested in contributing to
> Sage and I've been helping him along with the process.

His patch was perfect. I'd be really happy to see other people
contribute to symbolics. There are lot's of relatively simple issues
new developers could address. We should be more careful about keeping a
clean user interface however.

> Another one of the "students" (faculty at mostly undergraduate
> colleges) wondered about why these keywords were not present (I think
> they may be in some other of the M's, but obviously not Maple, and I
> can't recall exactly). So we all suggested they could be added, and
> Dana took the bait.

Here is the help page for the MMA command Limit:

http://reference.wolfram.com/mathematica/ref/Limit.html

They seem to only allow -1 and 1 for the Direction argument.

I suggest we add "left" and "right" (instead of "from_left" and
"from_right"). In addition, deprecate "above" and "below".

Comments?

Burcin

Rob Beezer

unread,
Jul 26, 2010, 11:51:47 PM7/26/10
to sage-devel
Hi Burcin,

> Here is the help page for the MMA command Limit:
>
> http://reference.wolfram.com/mathematica/ref/Limit.html
>
> They seem to only allow -1 and 1 for the Direction argument.

Yes, I looked at that later. Notice that

http://reference.wolfram.com/mathematica/tutorial/FindingLimits.html

says Direction -> -1 for a "limit approaching from above." That is
either wrong, or potentially very confusing (in my opinion).

> I suggest we add "left" and "right" (instead of "from_left" and
> "from_right"). In addition, deprecate "above" and "below".

+1 from me. I think that would be a big improvement.

Rob

D.C. Ernst

unread,
Jul 27, 2010, 3:23:28 PM7/27/10
to sage-devel
> > I suggest we add "left" and "right" (instead of "from_left" and
> > "from_right"). In addition, deprecate "above" and "below".
>
> +1 from me.  I think that would be a big improvement.

I'm assuming that you want to replace "from_left" (respectively,
"from_right") with "left" (respectively, "right"). There are two
reasons why I elected to go with "from_*":

1. This is more akin to the language that students use when learning
one-sided limits.
2. I wanted to avoid confusion about whether "left" meant "moving
leftward" as opposed to "from the left."

I'm not particularly in love with "from_*" and I am certainly
agreeable to changing it (as suggested earlier or otherwise). Can we
use the symbols "+" and "-"? This most closed mimics the standard
notation and is concise. Thoughts?

Dana

Johannes

unread,
Jul 28, 2010, 3:39:00 AM7/28/10
to sage-...@googlegroups.com

> 2. I wanted to avoid confusion about whether "left" meant "moving
> leftward" as opposed to "from the left."
>
+1 here seems to be more presice than just left or right.
greatz Johannes

Burcin Erocal

unread,
Jul 28, 2010, 5:42:37 AM7/28/10
to sage-...@googlegroups.com
Hi Dana,

On Tue, 27 Jul 2010 12:23:28 -0700 (PDT)
"D.C. Ernst" <ernst...@gmail.com> wrote:

> > > I suggest we add "left" and "right" (instead of "from_left" and
> > > "from_right"). In addition, deprecate "above" and "below".
> >
> > +1 from me.  I think that would be a big improvement.
>
> I'm assuming that you want to replace "from_left" (respectively,
> "from_right") with "left" (respectively, "right"). There are two
> reasons why I elected to go with "from_*":
>
> 1. This is more akin to the language that students use when learning
> one-sided limits.
> 2. I wanted to avoid confusion about whether "left" meant "moving
> leftward" as opposed to "from the left."

There is no tab completion for these arguments, I don't think they'll
be used if we leave them as "from_*"

> I'm not particularly in love with "from_*" and I am certainly
> agreeable to changing it (as suggested earlier or otherwise). Can we
> use the symbols "+" and "-"? This most closed mimics the standard
> notation and is concise. Thoughts?

I like these better than "left" and "right", especially since we
already support "plus" and "minus."


Thank you.

Burcin

ma...@mendelu.cz

unread,
Jul 28, 2010, 2:18:51 PM7/28/10
to sage-devel
I wonder if the preferred way how to read the limit in some language
is something like
"limit of the function f as x moves leftward and approaches a".

I could mistaken, but I think that "limit" and "left" allways means
limit from the left, left-hand-side limit, etc. I am not fluent in
English, but despite this fact I think there is no confusion. I have
never heard on a conferrence somethink like "x moves leftward" for
limit from the right. Does anybody have another experience?

Robert Marik

Robert Bradshaw

unread,
Jul 28, 2010, 2:28:08 PM7/28/10
to sage-...@googlegroups.com

I am a native English speaker, and have never heard left or right
meaning anything other than the limit *from* the left (negative) or
right (positive) sides. Personally, I'd rather save the keystrokes and
not have to type "from_" every time.

- Robert

Jason Grout

unread,
Jul 29, 2010, 2:30:59 AM7/29/10
to sage-...@googlegroups.com
On 7/27/10 12:23 PM, D.C. Ernst wrote:

> I'm not particularly in love with "from_*" and I am certainly
> agreeable to changing it (as suggested earlier or otherwise). Can we
> use the symbols "+" and "-"? This most closed mimics the standard
> notation and is concise. Thoughts?
>


+1 on the '+' and '-'. If we had that syntax, that's what I'd teach my
students to use since they'd already be using it in the classroom.

Thanks,

Jason

Robert Bradshaw

unread,
Jul 29, 2010, 2:55:50 AM7/29/10
to sage-...@googlegroups.com

'+'1, we're getting closer... :)

- Robert

Jason B Hill

unread,
Jul 29, 2010, 3:51:31 AM7/29/10
to sage-...@googlegroups.com
> +1 on the '+' and '-'.  If we had that syntax, that's what I'd teach my
> students to use since they'd already be using it in the classroom.

I'm +1 here too. I'm just paranoid and wondering if non-English/American keyboard layouts will provide one of the 9+ unicode hyphen characters that isn't identical to my American "-". (Some hyphens are breaking, some aren't... etc. Various keyboard layouts reflect the language's usage.). Is this an issue?

Jason

Jason B Hill

unread,
Jul 29, 2010, 12:09:42 PM7/29/10
to sage-...@googlegroups.com

I suppose python takes care of this, or else the minus sign would cause some issues.

For future reference to those who write LaTeX, you can use various hyphens depending on whether or not you want line-breaking. (I.e., so "line-breaking" can or cannot be split between lines at the hyphen.) I've tested this a bunch. They all look the same in the charter font I use, but U+002D (from my keyboard) will break after (except when placed after a number), U-2014 will break both before and after, and U+2011 will not break at all.

Jason

Rob Beezer

unread,
Jul 29, 2010, 12:19:10 PM7/29/10
to sage-devel
A rough summary so far. Correct me if you think I have not read
comments correctly. Status quo is below/above and minus/plus and a
patch to add from_left/from_right.

* left/right is preferable to from_left/from_right

* a suggestion to deprecate below/above, with no objections,
and some support

* support for '-'/'+', maybe augmenting minus/plus as
"shortcuts" of a sort (modulo keyboard dashes/hyphens/etc)

And a chance to vote. Mark exactly those options you would like to
see as the complete set of possibilites for the 'dir' keyword on
limit(). Not marking is tantamount to not adding it, or deprecating
it if it already exists. Remember, the original motivation for this
thread was to "not clutter
things up by supporting many different ways of doing the same thing."

[ ] minus/plus

[ ] '-'/'+'

[ ] below/above

[ ] left/right

[ ] from_left/from_right

Rob Beezer

unread,
Jul 29, 2010, 12:22:54 PM7/29/10
to sage-devel
I'm going to undiplomatically poison the well as I'll be offline for
the next few days. I like minus/plus and '-'/'+' as a package, like
left/right, and would not miss below/above. With good documentation,
I'm less concerned about clutter.

[X] minus/plus

[X] '-'/'+'

[ ] below/above

[X] left/right

[ ] from_left/from_right

Rob

Jason Grout

unread,
Jul 29, 2010, 12:39:26 PM7/29/10
to sage-...@googlegroups.com


My votes are the same as Rob's.

Thanks,

Jason


D.C. Ernst

unread,
Jul 29, 2010, 3:15:01 PM7/29/10
to sage-devel
> > [X] minus/plus
>
> > [X] '-'/'+'
>
> > [ ] below/above
>
> > [X] left/right
>
> > [ ] from_left/from_right
>
> My votes are the same as Rob's.

Ditto.

Burcin, earlier you said that there wouldn't be any tab completion for
"from_left" and "from_right." Why is that? Does this have to do with
my patch or how Sage handles tab completion? Is the default syntax
for a given command the only one that shows up for tab completion?

FWIW, I don't think anyone that already understands one-sided limits
would be confused by using "left" instead of "from_left". My original
choice in syntax was motivated by students that are learning one-sided
limits for the very first time. I've had plenty of students confused
(albeit only briefly) about what the notation of one-sided limits
really means. I'm not advocating sticking with my original choice of
keywords, but rather just explaining my initial point of view.

Thanks for all the discussion! (I never thought such a small thing
would generate so much discussion.)

Dana

kcrisman

unread,
Jul 29, 2010, 3:46:43 PM7/29/10
to sage-devel

>
> Burcin, earlier you said that there wouldn't be any tab completion for
> "from_left" and "from_right."  Why is that?  Does this have to do with
> my patch or how Sage handles tab completion?  Is the default syntax
> for a given command the only one that shows up for tab completion?
>

I think (I may be misinterpreting) that the point was

sage: lim[tab]

won't give you the various options, and

sage: lim(f,x=c,dir=[tab]

doesn't work as Sage is currently constructed. Someone would have to
look at

sage: lim?

which perhaps is the best result in any case :)

- kcrisman

ma...@mendelu.cz

unread,
Jul 29, 2010, 4:14:04 PM7/29/10
to sage-devel
Also my votes are the same as Rob's :)

Robert Marik

>
> Thanks,
>
> Jason

Jason B Hill

unread,
Jul 29, 2010, 4:31:19 PM7/29/10
to sage-...@googlegroups.com
>
> > [X] minus/plus
>
> > [X] '-'/'+'
>
> > [ ] below/above
>
> > [X] left/right
>
> > [ ] from_left/from_right
>
> My votes are the same as Rob's.

Also my  votes are the same as Rob's :)

Ditto.

Jason

D.C. Ernst

unread,
Jul 30, 2010, 9:36:25 PM7/30/10
to sage-devel
It seems that the votes are unanimous. I'll redo the patch sometime
after MathFest. Thanks for all the discussion.

Dana

Jason Grout

unread,
Jul 31, 2010, 12:24:13 AM7/31/10
to sage-...@googlegroups.com
On 7/29/10 12:15 PM, D.C. Ernst wrote:

> Thanks for all the discussion! (I never thought such a small thing
> would generate so much discussion.)


Typically, the discussion is inversely proportional to the scope of the
change and the knowledge required to understand the change. See

http://bikeshed.com/

or

http://en.wikipedia.org/wiki/Parkinson%27s_Law_of_Triviality

Thanks,

Jason

Reply all
Reply to author
Forward
0 new messages