MathGroup Archive 2001

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

Search the Archive

Peculiar behavior of DiscreteDelta

Hi group;

I am using Mathematica, version 4.0 on a Mac OS.9 system and a Unix system. On
both systems I get the following peculiar buglet:

In[1]:= DiscreteDelta[1/2(1-Sqrt[5])+1/2(-1+Sqrt[5])]

results in a message entitled $MaxExtraPrecision::meprecp :  ...

and an output which is identical to the input.  This does not happen if
DiscreteDelta is replaced by a numeric function such as Sin.  This led me
to note that 

*  DiscreteDelta does not have the Attribute NumericFunction.

Back to the main point:

If the output of In[1] is followed by FullSimplify, then we get 1 which is
expected since the argument of DiscreteDelta is 0.  If Sqrt[5] is replaced
by other Sqrt[n] where n is not a perfect square, the result is again the
message and the input is returned unaltered.  However if Sqrt[5] is
replaced by Sqrt[r] (where r is symbolic) the input is returned unaltered
with no message.

Since  DiscreteDelta is not an oft used function, my guess is that Wolfram
will not get around to fixing this for some time.  While I wait, I would
like to write a "work around".

** I define a pseudo  DiscreteDelta say JackDelta[x] which, like
DiscreteDelta, gives 0 if the argument is not 0 and 1 otherwise. (That is,

	JackDelta[0]  = 1;
	JackDelta[x_?NumericQ] = 0;



returns 1. I am delighted but very puzzled.  

Well experts, what's up?

(1) Why doesn't


return 0.  (It returns the input unaltered)
(2) Why does 


return 0. In view of (1), it should!

(3) Why does


have an error message associated with it.

(4) Why does Mathematica have a different response for each of these calls? 

These things drive me nuts.


  • Prev by Date: RE: Plotting
  • Next by Date: Help optimizing a slow integral
  • Previous by thread: Re: Plotting
  • Next by thread: Re: Peculiar behavior of DiscreteDelta