       Re: Limit of Floor function

• To: mathgroup at smc.vnet.net
• Subject: [mg73868] Re: Limit of Floor function
• From: "dimitris" <dimmechan at yahoo.com>
• Date: Fri, 2 Mar 2007 06:35:16 -0500 (EST)
• References: <es6dgu\$s4l\$1@smc.vnet.net>

```Why must be undefined?
As you said Floor has STEP discontinuity at every integer value.

So everything is normal!

In:=
Limit[Floor[x], x -> 10, Direction -> -1] (*default setting*)
Out=
10

In:=
Limit[Floor[x], x -> 10, Direction -> 1]
Out=
9

In:=
Information@Direction
>From In:=
"Direction is an option for Limit. Limit[expr, x -> x0, Direction ->
1] computes the limit as x approaches x0 from smaller values.
Limit[expr, x -> x0, Direction -> -1] computes the limit as x
approaches x0 from larger values. Direction -> Automatic uses
Direction -> -1 except for limits at Infinity, where it is equivalent
to Direction -> 1."
>From In:=
Attributes[Direction] = {Protected}

In:=
Table[(Limit[Floor[x], x -> n, Direction -> #1] & ) /@ {-1, 1}, {n,
-5, 5}]
Out=
{{-5, -6}, {-4, -5}, {-3, -4}, {-2, -3}, {-1, -2}, {0, -1}, {1, 0},
{2, 1}, {3, 2}, {4, 3}, {5, 4}}

Other common functions with step discontinuities are Sign and
UnitStep.

In:=
(Limit[Sign[x - 2], x -> 2, Direction -> #1] & ) /@ {-1, 1}
Out=
{1, -1}

In:=
(Limit[UnitStep[x + 4], x -> -4, Direction -> #1] & ) /@ {-1, 1}
Out=
{1, 0}

BTW, note a little the plot of Floor

In:=
Plot[Floor[x], {x, -3, 3}, Axes -> False, Frame -> True]

The vertical lines are due to buggy behavior of Plot algorithm and
should not be there.
Searching in the archives you can find many threads regarding the
removal of them.

A quick one (but not certainly the best) method is by

In:=
Show[Block[{\$DisplayFunction = Identity}, (Plot[Floor[x], {x, #1[],
#1[]}] & ) /@ Partition[Range[-3, 3], 2, 1]],
PlotRange -> All, Axes -> False, Frame -> True]

Another one method which I learn from Bob Hanlon is

In:=
Block[{\$DisplayFunction = Identity}, Plot[Floor[x], {x, -3, 3}, Axes -
> False, Frame -> True]]
Show[% //. Line[{s___, {x1_, y1_}, {x2_, y2_}, e___}] /; Abs[(y2 - y1)/
(x2 - x1)] > 10 || Sign[y1] != Sign[y2] :>
Sequence[Line[{s, {x1, y1}}], Line[{{x2, y2}, e}]], PlotRange ->
All];

Regards
Dimitris

=CF/=C7 Eric Smith =DD=E3=F1=E1=F8=E5:
> Mathematica 5.2 evaluates one-sided limits of the Floor function
> correctly.  But if I just ask:
>
>    Limit[Floor[x],x->10]
>
> It replies "10".  Shouldn't it tell me the limit is undefined,
> since the Floor function has a step discontinuity at every integer
> value?
>
> Thanks,
> Eric

```

• Prev by Date: Re: Overlaying a grid on graphics to guide placement
• Next by Date: Re: Re: Re: Re: Hold and Equal
• Previous by thread: Re: Re: Limit of Floor function
• Next by thread: Re: Limit of Floor function