Unconventional Max[] behavior
- To: mathgroup at smc.vnet.net
- Subject: [mg28048] Unconventional Max[] behavior
- From: Ralph Benzinger <mma-l at endlos.net>
- Date: Thu, 29 Mar 2001 03:24:14 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hello: For many years I've been under the impression that Max[] can deal with numerical quantities only: In[1]:= Max[a + 1, a + 2] Out[1]= Max[1 + a, 2 + a] I was quite surprised when some days ago I discovered by accident that Max[] actually does simplify symbolic arguments when specifically told to do so: In[2]:= Max[a + 1, a + 2] // Simplify Out[2]= 2 + a But I was even more surprised when I tried to get a feel for the capabilities of the function: In[3]:= Max[2a + 1, 2a + 2] // Simplify Out[3]= Max[1 + 2 a, 2 + 2 a] Just WHY can Mathematica simplify [2] but not [3]? Does anybody happen to know some details about the inner workings of the Max[] function? A related question to my "discovery": Is there a standard way of defining a "simplification" rather than an "evaluation" rule? For example, if I have some function `foo' and I do _not_ want to include the definition foo[a_] + foo[b_] ^:= foo[a+b] can I still have the rewrite rule foo[a_] + foo[b_] -> foo[a+b] applied automatically whenever I invoke Simplify[]? Regards, Ralph -- Ralph Benzinger "This is my theory, it is mine, I own it, Cornell University and what it is, too." -- Ann Elk (Mrs.)