Prev: Persistent assumption
Next: Financial Data - Currencies
From: David Park on 16 Jan 2010 06:08 No, they should learn Mathematica early. But they won't do that until Mathematica is nearly universal in the technical community and is considered to be a must have, must learn application. And that won't happen until anyone who has Mathematica is able write literate active dynamic notebooks that can be read by anyone following the free Acrobat Reader model. And once that happens, many more users will write their papers as Mathematica notebooks, and many more people will read them and be persuaded to buy and use Mathematica themselves. Then, students will buy and learn Mathematica and when they get to college they will know the basics and such simple things as how and how not to use replacement rules. David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: AES [mailto:siegman(a)stanford.edu] In article <hhhmn8$o9t$1(a)smc.vnet.net>, Leonid Shifrin <lshifr(a)gmail.com> wrote: > . . . so to use it correctly one should have a pretty good idea of the > internal representation of participating expressions in Mathematica, as well > as on possible evaluations that may take place. This is certainly not > intuitive . . . In other words, the vast majority of college students, working engineers and scientists, and generally anyone with less than an MS degree in Math, should stay miles away from Mathematica. At least that's what these words imply to me . . .
From: Daniel Lichtblau on 16 Jan 2010 06:09 AES wrote: > In article <hhhmhl$o48$1(a)smc.vnet.net>, > Valeri Astanoff <astanoff(a)gmail.com> wrote: > >> Imho, when applying a rule lhs -> rhs >> it's a risky practice to use the same symbol >> in 'lhs' and 'rhs', because, very often, there is >> no easy way to check what has been done. >> >> Anyway, for occasional users, you're right : it's crazy! >> > > Thank you -- that's really my primary point. > > And I'd add: it's damaging (to users, and to Mathematica). > > As for writing rules, I'd not even try writing something compound, like > a + b or especially something like 1 + I, on the lhs, because I'd have > no intuition as to how this would work (how spaces would be handled, > etc.) > > 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? "[W]ork for me" (let's try to use correct grammar here). In[1]:= D[Sin[x], x] /. D -> f Out[1]= Cos[x] In[3]:= Exp[I*Pi] /. Pi -> E Out[3]= -1 In[4]:= Exp[I*Pi] /. I -> E Out[4]= -1 In[5]:= N[Pi] /. N -> P Out[5]= 3.14159 In[14]:= Cos[x] + O[x]^2 /. O -> P Out[14]= SeriesData[x, 0, {1}, 0, 2, 1] Daniel Lichtblau Wolfram Research
From: David Park on 16 Jan 2010 06:09 I don't use them but what about displayed LaTeX documents? Can you replace by typing in what you see? What about a YouTube file? Can you replace one person with another by using two pictures? If I type in 2 * 3 * 4 and then try to use 2 -> 5, can I claim that I typed 2 in and I should bloody well be able to replace it? Mathematica is a CAS and MANY things are processed on input and no longer appear in the for they were entered. It isn't just Complex[a,b]. It's easy to do calculations in Mathematica. You insist on using a method that doesn't work because it ignores the fact that Mathematica processes numbers on input. It's a waste of time. There are more interesting places to 'improve' Mathematica. For example, primed and double primed characters are commonly used in textbooks and papers, but Mathematica does not make it easy to use them. (I do provide an easy method to use them in Presentations.) There are many convenient things that can be done, but I -> -I is just a dead horse. David Park djmpark(a)comcast.net http://home.comcast.net/~djmpark/ From: AES [mailto:siegman(a)stanford.edu] 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. 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. So: 1) Most any computer user at even a very elementary level knows about these tools, rather expects to have them available, and expects them to function as they in fact do function. 2) In particular, they operate (visibly!) on what you see -- not some arcane internal representation. 3) So, if such a novice user goes to Mathematica, it's only to be expected that this user will thnik that Mathematica's ReplaceAll should function in a similar fashion (and, helpfully, Mathematic's /. operator most of the time does function in that way) (sarcasm mode in that parens). 4) So why can't Mathematica also have a TextReplace[ ] function, or something similar, that would function in that way _on what the user sees or has typed (or copied and pasted) into a selected cell_. Given such a function my input would be Find " I " and replace it with " (-I) ".
From: AES on 16 Jan 2010 06:10 > 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. 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: DrMajorBob on 16 Jan 2010 06:10
> 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. > > So: > > 1) Most any computer user at even a very elementary level knows about > these tools, rather expects to have them available, and expects them to > function as they in fact do function. Agreed. WRI's help facility, also, has long suffered (IMHO) from an unusual concept of what "search" means. Find within a notebook works more or less as above, but Replace and ReplaceAll do not. They do a more complicated job, admittedly, but not in what I'd call a WYSIWYG manner. A Replace function that works on Graphics internals is hard to imagine without viewing it in terms of FullForm (or other internal representation), but the internals of Graphics are not well-documented or static. I frequently have to actually LOOK at the voluminous FullForm of a graphic, in order to discover what can be changed. Bobby On Fri, 15 Jan 2010 02:20:47 -0600, 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. > > > 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. > > So: > > 1) Most any computer user at even a very elementary level knows about > these tools, rather expects to have them available, and expects them to > function as they in fact do function. > > 2) In particular, they operate (visibly!) on what you see -- not some > arcane internal representation. > > 3) So, if such a novice user goes to Mathematica, it's only to be > expected that this user will thnik that Mathematica's ReplaceAll should > function in a similar fashion (and, helpfully, Mathematic's /. operator > most of the time does function in that way) (sarcasm mode in that > parens). > > 4) So why can't Mathematica also have a TextReplace[ ] function, or > something similar, that would function in that way _on what the user > sees or has typed (or copied and pasted) into a selected cell_. > > Given such a function my input would be Find " I " and replace it > with " (-I) ". > -- DrMajorBob(a)yahoo.com |