Peculiar behavior of DiscreteDelta
- To: mathgroup at smc.vnet.net
- Subject: [mg28731] Peculiar behavior of DiscreteDelta
- From: Jack Goldberg <jackgold at math.lsa.umich.edu>
- Date: Fri, 11 May 2001 03:38:48 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
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; Amazingly, JackDelta[1/2(1-Sqrt[5])+1/2(-1+Sqrt[5])] returns 1. I am delighted but very puzzled. Well experts, what's up? (1) Why doesn't Sin[1/2(1-Sqrt[5])+1/2(-1+Sqrt[5])] return 0. (It returns the input unaltered) (2) Why does JackDelta[1/2(1-Sqrt[5])+1/2(-1+Sqrt[5])] return 0. In view of (1), it should! (3) Why does DiscreteDelta[1/2(1-Sqrt[5])+1/2(-1+Sqrt[5])] 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. Jack
- Follow-Ups:
- Re: Peculiar behavior of DiscreteDelta
- From: Daniel Lichtblau <danl@wolfram.com>
- Re: Peculiar behavior of DiscreteDelta