Maybe a non-mathematician's answer will help. If you want to find all the numbers that solve the equation
x^2 = 4 you had better remember both square roots. Similarly, if you want all the numbers that solve sin(x) = 0 there are an infinite number, 0, 2p1, 4p1, etc. Likewise there are an infinite number of solutions for ^x = _1 as you have seen. For that matter, there are an infinite number of solutions for ^x = 1 (try 0 j. 2p1 etc.) Lots of times you don't want all the answers, and it's easier if you get just one, so you can have an invertible fnction. So you define a function that gives only one, the way ^ and ^. (and %:) are defined in J. That leaves it up to you to figure out what to do if you really need all the answers to a problem like ^x = 1 . When you learned elementary math, they wanted you to find all the answers to quadratic equations. ^ 0 j. 1p1 * 1 + 2 * _10 _9 _8 _1j_3.43025e_15 _1j3.67517e_15 _1j_3.43025e_15 You are getting numbers close to _1j0 but not exactly it, and taking the log gives you either 1 j. pi or 1 j. -pi depending on the sign of the garbage, because you are right around the discontinuity in the log function. Henry Rich > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Dan Bron > Sent: Friday, June 30, 2006 10:32 AM > To: General forum > Subject: Re: [Jgeneral] significant digits > > Henry Rich wrote: > > ^ doesn't have an inverse (unless you make some restrictions). > > So, the flaw in your argument was when you said that ^ and ^. > > cancel each other out. > > John Randall wrote: > > The problem here is that a function f has an inverse function > > only if f is 1-1. > > Thanks, guys. I knew there was a reason I put the word > "proof" in quotes :) > > Can you now explain why I was taught, in elementary math, to > express %:4 as (+,-)2 instead of just 2 ? If I have to > write (%:4) = (+,-)2 why do I not have to write (^._1) = > 0 j. 1p1 * 1 + 2 * i: _ ? Is it because the former has > only 2 elements, but the latter infinitely many? > > By the way, I'm pretty sure 0 j. 1p1 * 1 + 2 * i: N (scalar > positive integer N ) is the right expression for generating > for the logs of _1 but J doesn't agree: > > 10 {. ^. ^ 0 j. 1p1 * 1 + 2 * i: N =: 10 > 0j_3.14159 0j3.14159 0j_3.14159 0j3.14159 0j_3.14159 > 0j3.14159 0j3.14159 0j3.14159 0j3.14159 0j3.14159 > > ~. ^. ^ 0 j. 1p1 * 1 + 2 * i: N =: 10 > 0j_3.14159 0j3.14159 > > 10 {. q=. M #~ 0j1p1 ~: !.(2^_34) ^. ^ 0 j. 1p1 * > M =: 1 + 2 * i: N =: 1000 > _1995 _1993 _1989 _1987 _1985 _1981 _1979 _1973 _1971 _1967 > > 25 {. }. +/\^:_1 q > 2 4 2 2 4 2 6 2 4 2 2 4 2 6 2 4 2 2 4 2 6 2 4 2 6 > > > Have I got it wrong? What's the right expression? What I am > really generating with my expression? What's with the odd > gaps between successive 0j1p1 ? I don't see the pattern. > Or maybe this is just an implementation issue? > > -Dan > > > > > ---------------------------------------------------------------------- > For information about J forums see > http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
