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[11]:= Limit[Floor[x], x -> 10, Direction -> -1] (*default setting*) Out[11]= 10 In[12]:= Limit[Floor[x], x -> 10, Direction -> 1] Out[12]= 9 In[13]:= Information@Direction >From In[13]:= "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[13]:= Attributes[Direction] = {Protected} In[19]:= Table[(Limit[Floor[x], x -> n, Direction -> #1] & ) /@ {-1, 1}, {n, -5, 5}] Out[19]= {{-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[20]:= (Limit[Sign[x - 2], x -> 2, Direction -> #1] & ) /@ {-1, 1} Out[20]= {1, -1} In[26]:= (Limit[UnitStep[x + 4], x -> -4, Direction -> #1] & ) /@ {-1, 1} Out[26]= {1, 0} BTW, note a little the plot of Floor In[28]:= 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[35]:= Show[Block[{$DisplayFunction = Identity}, (Plot[Floor[x], {x, #1[[1]], #1[[2]]}] & ) /@ Partition[Range[-3, 3], 2, 1]], PlotRange -> All, Axes -> False, Frame -> True] Another one method which I learn from Bob Hanlon is In[65]:= 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