Prev: Persistent assumption
Next: Financial Data - Currencies
From: David Park on 16 Jan 2010 06:13 There is a perfectly simple explanation why it doesn't work for I. It's like saying that because I can calculate a determinant for 2 x 2 and 3 x 3 matrices by adding the products on the diagonals I should be able to do the same thing with any order matrix and students will be confused if they have to do otherwise. No, they can just learn how to do it. It's part of their education. And maybe they shouldn't be taught the limited method in the first place. Mathematica represents complex NUMBERS as atomic expressions, Complex[n1,n2] where n1 and n2 are NUMBERS. It seems to me to be a pretty reasonable design decision. It makes sense to think of complex numbers as entities in their own right. Then they used I as a input shortcut, and displayed complex numbers with \[ImaginaryI] to conform to standard notation. Maybe WRI should not have allowed I for input or ImaginaryI on display. If everyone had to type Complex[a,b], and saw it on output, they might not have to learn the difference between input, display and internal representation. If WRI did that, I'm sure there would be many more complaints and you would be near the head of the line. The other choice would be to do away with the Complex representation altogether. Then complex NUMBERS would be represented as Plus expressions and would no longer be number entities in their own right. I don't know what all the implications of that would be in the Mathematica handling of complex expressions, but I don't think it would be good. Mathematica would have to continually parse expressions to recognize complex numbers. For example, how would Mathematica know to simplify (3+4I)/(1-5I)? It should be able to simplify it just as easily as 4/2. When students get to the point where they are treating complex numbers and functions they can just learn the difference between input and internal representation. If they can't understand that, I don't see how they can understand much about complex algebra. And they should long ago have learned that it is worth while having convenient input forms and output displays. So don't teach them I -> -I. Teach them Complex[a_,b_] -> Complex[a,-b], or Conjugate and ComplexExpand. Teach them about complex NUMBERS. It's not that difficult. David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: AES [mailto:siegman(a)stanford.edu] But a single character on the lhs? It works correctly AFAIK for every other single-character in the alphabet. Why shouldn't one expect it to work for I?
From: Vince Virgilio on 16 Jan 2010 06:13 On Jan 15, 3:20 am, AES <sieg...(a)stanford.edu> wrote: > In article <hhpl28$9l...(a)smc.vnet.net>, > Leonid Shifrin <lsh...(a)gmail.com> wrote: > > > > > I stick to my view of replacement rules as being aimed primarily at adv= anced > > users, or at least as a tool that should be used with much care. > > But on the other hand, innumerable software apps of all varieties and at > all levels down to the most elementary (e.g., nearly all word > processors, text editors, graphics programs, spreadsheet programs, email > programs, and so on) include "Find and Replace" capabilities. > > These capabilities frequently have varied options: > "Find Next" "Replace and Find" "As Word" > "Start at Top" "Replace All" "In Selection Only" > and so on. Many have optional GREP abilities. > SNIP AES, Nice observation, but it opens a can of worms and potentially quite a tangent. I think MS Word's Autocorrect feature throws a wrench in this argument (Mac who?). Keywords such as '...' or \alpha readily disappear into their Unicode glyphs. Such "usual (non-arithmetic) conversions" complicate use of Find/Replace, *requiring closer attention by the user*. Stronger, I couldn't immediately figure out how to search for the converted alpha glyph in Word. Mathematica has its own set of similar complications and cautions. It's never easy. Vince Virgilio (As others have said, there are more expressive and transparent ways to conjugate an expression, i.e. Conjugate.)
From: David Park on 17 Jan 2010 07:12 Students will never be learning Mathematica early and be reasonably proficient with it before they get to college? I beg to disagree. It will happen because as a tool for studying, developing and communicating technical material Mathematica is orders of magnitude better than existing practice. Students who don't learn it, and institutions that don't exploit it will just fall too far behind. The education problem is a difficult problem to be solved, but it can be solved and it will be solved one way or another. Tony, I wish I could convince you to take a more positive approach to Mathematica. It is not a perfect instrument but through the ages masterworks have been produced with imperfect instruments. It's shortcomings are not nearly as important as what you CAN do with it. Nor is it a static instrument. The problem for all of us is to keep learning how to use it. It does pay off. David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: AES [mailto:siegman(a)stanford.edu] And one or two other responses in this thread have suggested that users should be given advanced training in the functioning and fine details of ReplaceAll before they even begin to use Mathematica. This latter proposal strikes me as a really crazy proposition, and essentially impossible in the real world. Suppose an instructor of EE or physics undergraduates in an already crammed and time-limited introductory network analysis or mechanics course starts by going through some simple phasor analyses of linear electric circuits or coupled mechanical systems with one or two resonances "by hand". Then, as take-home exercises, the students are asked to analyze and plot some 3 or 4 or 5-resonance cases using Mathematica and Manipulate (which can be a very pleasant as well as educational experience) -- but to do this the students first have to have a training course on Mathematica at the level suggested above? Not gonna happen. Or, as a broader approach, suppose that training in Mathematica at this level is going to be expected or required (before or after admission) of all incoming college students who might go into any Mathematica-using field of study, before they can take meaningful courses in that field? Not gonna happen. In any case, waking up this morning after reading 60 or 70 posts in this thread last night I realized that in 20+ years of using Mathematica I've always had a mental model of ReplaceAll as being essentially an **editing** tool, rather than a "mathematical" tool (whatever interpretation you might give to mathematical in that phrase). When I typed in f = expr /. rule, I expected that rule would be applied to expr as I originally typed it in -- or, better, to expr as Mathematica played it back to me in an Output cell when I typed it in earlier (very hard to argue with this latter interpretation, is it not?). Only then would that edited version of expr be evaluated and assigned to f. Isn't this more or less how the Find and Replace All capabilities function in every other ordinary software program known to man? (And isn't it how the construct /. almost always in fact functions, regardless of what internal shenanigans Mathematica goes through in processing it?) And as a final query: Is there a formal name in Mathematica for the string of characters that one types in and then sees in an Input cell before (and after) one hits the Enter key? Referring both to this character string and to the internal representation of this input string inside Mathematica as an "expression" -- in fact, the same expression -- is certainly a recipe for confusion, in debate and in understanding.
From: Leonid Shifrin on 17 Jan 2010 07:31 Hi Tony, I feel obliged to reply since your interpretation of those parts of my posts which you keep citing is not quite what I meant, but I hope that this is my last post in this thread. On Sat, Jan 16, 2010 at 3:11 AM, AES <siegman(a)stanford.edu> wrote: > > In article <hhpl28$9lf$1(a)smc.vnet.net>, > > Leonid Shifrin <lshifr(a)gmail.com> wrote: > > > > > > > > I stick to my view of replacement rules as being aimed primarily at > advanced > > > users, or at least as a tool that should be used with much care. > > > And one or two other responses in this thread have suggested that users > should be given advanced training in the functioning and fine details of > ReplaceAll before they even begin to use Mathematica. > > This latter proposal strikes me as a really crazy proposition, and > essentially impossible in the real world. > I think that the notion of the real world is a moving target, and besides continuously changing. I don't think most of research and engineering in the near future will be done like it is now. In particular, the conventional research process may learn a thing or two from the modern software development techniques, in terms of making the generated knowledge more universally accessible and useful to a wider audience than just experts in that particular field with many years of experience in it. I expect that tools allowing automation and synthesis will in the near future play no less important role than tools for specialization. IMO, in lots of fields more than enough of specialized knowledge has been generated already. At least in the fields I've been working, the annual number of new articles increased dramatically since the seventies or eighties, but very few of these papers can compare in quality with an average good paper from that period. I think that at least partially this is a problem of communication between different sub-domains which became very specialized - resembles to me the Babel tower somewhat. But to efficiently combine specialized knowledge, you need some common denominator. I view Mathematica as one of the candidates for tools to be widely used in this spirit. So, addressing specifically your statements: indeed, viewed as a tool for specialization, learning Mathematica on a decent level may seem too much of a burden since most specific problems require only a fraction of its power. But I think that in the near future ultra-specialization will be generally no longer enough for people to stay competitive in whatever they will be doing, exactly due to the large amounts of potentially useful knowledge having been already generated in other (sub)fields and waiting to be utilized. This is only my personal opinion anyway, the time will show who is right. Regarding your specific queries about ReplaceAll etc, just two comments: 1. The whole topic of this thread is based on an exceptional situation (considering auto-evaluation of I and a couple of other symbols), and there are really just a few of such exceptions, so I don't think it is appropriate to base general statements on these. 2. For anyone with a decent understanding of Mathematuca pattern-matching and evaluation, all these things don't pose any problem at all - and these two topics are not that hard to learn either. Regards, Leonid > > Suppose an instructor of EE or physics undergraduates in an already > crammed and time-limited introductory network analysis or mechanics > course starts by going through some simple phasor analyses of linear > electric circuits or coupled mechanical systems with one or two > resonances "by hand". > > Then, as take-home exercises, the students are asked to analyze and plot > some 3 or 4 or 5-resonance cases using Mathematica and Manipulate (which > can be a very pleasant as well as educational experience), but to do > this the students first have to have a training course on Mathematica at > the level suggested above? Not gonna happen. > > Or, as a broader approach, suppose that training in Mathematica at this > level is going to be expected or required (before or after admission) of > all incoming college students who might go into any Mathematica-using > field of study, before they can take meaningful courses in that field? > Not gonna happen. > > In any case, waking up this morning after reading 60 or 70 posts in this > thread last night I realized that in 20+ years of using Mathematica I've > always had a mental model of ReplaceAll as being essentially an > **editing** tool, rather than a "mathematical" tool (whatever > interpretation you might give to mathematical in that phrase). > > When I typed in f = expr /. rule, I expected that rule would be applied > to expr as I originally typed it in -- or, better, to expr as > Mathematica played it back to me in an Output cell when I typed it in > earlier (very hard to argue with this latter interpretation, is it > not?). Only then would that edited version of expr be evaluated and > assigned to f. > > Isn't this more or less how the Find and Replace All capabilities > function in every other ordinary software program known to man? > > (And isn't it how the construct /. almost always in fact functions, > regardless of what internal shenanigans Mathematica goes through in > processing it?) > > And as a final query: Is there a formal name in Mathematica for the > string of characters that one types in and then sees in an Input cell > before (and after) one hits the Enter key? Referring both to this > character string and to the internal representation of this input string > inside Mathematica as an "expression" -- in fact, the same expression -- > is certainly a recipe for confusion, in debate and in understanding. > >
From: Helen Read on 18 Jan 2010 02:35
On 1/17/2010 7:12 AM, David Park wrote: > Students will never be learning Mathematica early and be reasonably > proficient with it before they get to college? I beg to disagree. It will > happen because as a tool for studying, developing and communicating > technical material Mathematica is orders of magnitude better than existing > practice. Students who don't learn it, and institutions that don't exploit > it will just fall too far behind. > > The education problem is a difficult problem to be solved, but it can be > solved and it will be solved one way or another. > > Tony, I wish I could convince you to take a more positive approach to > Mathematica. It is not a perfect instrument but through the ages masterworks > have been produced with imperfect instruments. It's shortcomings are not > nearly as important as what you CAN do with it. Nor is it a static > instrument. > > The problem for all of us is to keep learning how to use it. It does pay > off. Hear, hear. My students come into university level Calculus I or II with no Mathematica experience, and learn to use it in my calculus class while learning calculus. It really only takes them a couple of weeks at the beginning of the semester to get up and running, and by the end of the semester all of my students are quite good at it. I haven't had to take things out of the curriculum to do this, either; we simply use Mathematica routinely in our work. Sometimes students come to see me a year or two or three later, and ask for help putting something they are working on for some other class into Mathematica. Generally they have a very good start on it when they come to see me, and need just a little help with a few details. -- Helen Read University of Vermont |