Re: More /.{I->-1} craziness
- To: mathgroup at smc.vnet.net
- Subject: [mg106036] Re: More /.{I->-1} craziness
- From: Richard Fateman <fateman at cs.berkeley.edu>
- Date: Thu, 31 Dec 2009 03:13:51 -0500 (EST)
- References: <hhf5s3$h4o$1@smc.vnet.net>
AES wrote: > The more I play with these I->-I substitution rules, the more seemingly > wildly inconsistent results emerge. For example: > > In[1]:= -I/.I->-I > > Out[1]= -I > ..snip.. > These examples you give are perfectly consistent with a certain world view which is that I is not a symbol, but a functional form, Complex[0,1], and -I is a different form, Complex[0,-1]. The fact that this is not what you expect as a mathematician is simply your fault.:) You might find these examples. some old, some new, confusing as well. (in Mathematica 6.0) Here are some puzzles for you. Guess what they return. (Answers below) 3 /. 3->4 3 /.3->4 3 /0.3->4 (which helps explain previous line) 3 / . 3 ->4 3 /. 3.0->4 3/.3.0->4 3.0/. 3.0->4 a. 3/. a->b a.3 /. a->b a .3 . 4 /. 3 -> c a. 3 . 4 /. 3 -> c .......answers......... 3 /. 3->4 returns 4 3 /.3->4 returns 10.->4 3 /0.3->4 returns 10.->4 (which helps explain previous line) 3 / . 3 ->4 syntax error 3 /. 3.0->4 returns 3 3/.3.0->4 returns 0.->4 3.0/. 3.0->4 returns 4 a. 3/. a->b returns b.3 a.3 /. a->b returns 0.3*b a .3 . 4 /. 3 -> c returns a 0.3.4 a. 3 . 4 /. 3 -> c returns a.c.4 and yes, I know the explanation for all of these.