From: David Park on
It would be nice if some of these features could be designed out. Another
thing I find inconvenient is the way expressions often Simplify to a form
that contains extra minus signs. But perhaps trying to design these things
out will just push out problems somewhere else.

Nevertheless, I think this is primarily an education problem. Users do not
learn the basic use of Mathematica early enough and then they stumble over
various features just when they have a serious problem that needs solving.
Very frustrating.

One skill that students may especially lack is the ability to manipulate
expressions in a more detailed form. They may want to do this to obtain a
specific textbook form, or just because they prefer a certain form, or
because they want to follow a specific solution path. Mathematica is really
good at that kind of stuff but learning to do it takes education, time and
practice. Just adding extra notes and examples in Help, although useful, is
not in itself going to solve the education problem. And it's not fair to
students to throw Mathematica at them on difficult material, when they have
not really learned how to use it.


David Park
djmpark(a)comcast.net
http://home.comcast.net/~djmpark/


From: AES [mailto:siegman(a)stanford.edu]


In article <hh9vfo$1rk$1(a)smc.vnet.net>,
Richard Fateman <fateman(a)cs.berkeley.edu> wrote:

> Scot T. Martin wrote:
> > The problem is that "-1." is not "1".

> And furthermore, this bug has been declared a feature. And defended,
> repeatedly. Just as I does not occur in -I.
> It can be fixed, should be fixed, and has been fixed in other CAS.


I'll defer to Richard Fateman (and/or other computer algebra experts) as
to whether this general behavior (!! especially with respect to -I !!)
is a bug that should be fixed, or a feature.

But if it's gonna be considered a feature in Mathematica, I'd strongly
suggest that it should be strongly **featured** -- or, if you like, it
should be warned about!! -- in the Mathematica documentation, especially
at the more elementary levels of documentation, **so that ordinary users
can't miss being warned about this unexpected behavior** ^HH^H^H^H
sorry, so that they can't miss being warned about "this feature".

For example, right after the first line of the Help for I, which says

I represents the imaginary unit Sqrt[-1].

there might be a warning line which says

WARNING: I is a number and not a symbol. Attempting to replace
or reverse the sign of I using a rule, such as expr/.{I->-I) may
produce unexpected results if the expr contains -I.

(By the way, note the wording above: "I represents", not "I is".)

There are a very large number of other places in the Mathematica
documentation where emphasized WARNINGs like this would be helpful.

(I suppose there could even be optional warning messages that appear any
time a cell executes a rule containing a number on the LHS of a
ReplaceAll symbol. And, the documentation for ReplaceAll could have an
initial WARNING message that it is not just the kind of Global Search
and Replace command that many ordinary users, familiar with many other
word processing and software apps, might well think it is. )



From: DrMajorBob on
I fully agree.

We should be told that -I is an atom, hence it does NOT contain I as a
part.

a - I is NOT an atom, since we get a match in

Cases[a - I, -I, {0, Infinity}]

{-I}

AtomQ[a - I]

False

yet 1 - I _is_ an atom, so

Cases[1 - I, -I, {0, Infinity}]

{}

AtomQ[1 - I]

True

I don't know that this ever hinders me in practice, but the rationale
escapes me.

Bobby

On Tue, 29 Dec 2009 00:18:40 -0600, AES <siegman(a)stanford.edu> wrote:

> In article <hh9vfo$1rk$1(a)smc.vnet.net>,
> Richard Fateman <fateman(a)cs.berkeley.edu> wrote:
>
>> Scot T. Martin wrote:
>> > The problem is that "-1." is not "1".
>
>> And furthermore, this bug has been declared a feature. And defended,
>> repeatedly. Just as I does not occur in -I.
>> It can be fixed, should be fixed, and has been fixed in other CAS.
>
>
> I'll defer to Richard Fateman (and/or other computer algebra experts) as
> to whether this general behavior (!! especially with respect to -I !!)
> is a bug that should be fixed, or a feature.
>
> But if it's gonna be considered a feature in Mathematica, I'd strongly
> suggest that it should be strongly **featured** or, if you like, it
> should be warned about!! in the Mathematica documentation, especially
> at the more elementary levels of documentation, **so that ordinary users
> can't miss being warned about this unexpected behavior** ^HH^H^H^H
> sorry, so that they can't miss being warned about "this feature".
>
> For example, right after the first line of the Help for I, which says
>
> I represents the imaginary unit Sqrt[-1].
>
> there might be a warning line which says
>
> WARNING: I is a number and not a symbol. Attempting to replace
> or reverse the sign of I using a rule, such as expr/.{I->-I) may
> produce unexpected results if the expr contains -I.
>
> (By the way, note the wording above: "I represents", not "I is".)
>
> There are a very large number of other places in the Mathematica
> documentation where emphasized WARNINGs like this would be helpful.
>
> (I suppose there could even be optional warning messages that appear any
> time a cell executes a rule containing a number on the LHS of a
> ReplaceAll symbol. And, the documentation for ReplaceAll could have an
> initial WARNING message that it is not just the kind of Global Search
> and Replace command that many ordinary users, familiar with many other
> word processing and software apps, might well think it is. )
>


--
DrMajorBob(a)yahoo.com

From: Murray Eisenberg on
Dpcumentation Center reference page for I, "More Information", FIRST bullet:

"Numbers containing I are converged to the type Complex."

And in the Examples section, subsectin "Possible Issues", 4th set of
examples:

"Complex numbers are atomic objects and do not explicitly
contain I:"

FullForm[2+I]
Complex[2,1]

This is not to contradict your assertion that it would be useful to give
an explicit example that doing something like

2+3I /. I->-I

does not in fact form the expected conjugate. But at least the
documentation given does give some pause as to whether such an attempt
might fail to work.

On the other hand, not every possible issue can be addressed immediately
at the top of documentation just because this or that user happened to
experience some difficulty with it.

Only gathering usage statistics, or having a focus group of users trying
stuff, might suffice to escalate some issues to the point of requiring
more prominent warnings.

I wonder how many users in fact experience this issue. (Yes, I know a
number have asked about the same thing here, but then of course one
hears only from those for whom it was an issue, and not from those for
whom it was not.) I can imagine, in fact, that a majority of users --
at least of relative novice users, might first think, "I want to take a
conjugate; let me search the documentation how to do that -- I'll look
up 'conjugate'." And, finding immediately the reference page for
Conjugate, use that.


AES wrote:
> In article <hh9vfo$1rk$1(a)smc.vnet.net>,
> Richard Fateman <fateman(a)cs.berkeley.edu> wrote:
>
>> Scot T. Martin wrote:
>>> The problem is that "-1." is not "1".
>
>> And furthermore, this bug has been declared a feature. And defended,
>> repeatedly. Just as I does not occur in -I.
>> It can be fixed, should be fixed, and has been fixed in other CAS.
>
>
> I'll defer to Richard Fateman (and/or other computer algebra experts) as
> to whether this general behavior (!! especially with respect to -I !!)
> is a bug that should be fixed, or a feature.
>
> But if it's gonna be considered a feature in Mathematica, I'd strongly
> suggest that it should be strongly **featured** or, if you like, it
> should be warned about!! in the Mathematica documentation, especially
> at the more elementary levels of documentation, **so that ordinary users
> can't miss being warned about this unexpected behavior**
> sorry, so that they can't miss being warned about "this feature".
>
> For example, right after the first line of the Help for I, which says
>
> I represents the imaginary unit Sqrt[-1].
>
> there might be a warning line which says
>
> WARNING: I is a number and not a symbol. Attempting to replace
> or reverse the sign of I using a rule, such as expr/.{I->-I) may
> produce unexpected results if the expr contains -I.
>
> (By the way, note the wording above: "I represents", not "I is".)
>
> There are a very large number of other places in the Mathematica
> documentation where emphasized WARNINGs like this would be helpful.
>
> (I suppose there could even be optional warning messages that appear any
> time a cell executes a rule containing a number on the LHS of a
> ReplaceAll symbol. And, the documentation for ReplaceAll could have an
> initial WARNING message that it is not just the kind of Global Search
> and Replace command that many ordinary users, familiar with many other
> word processing and software apps, might well think it is. )
>

--
Murray Eisenberg murray(a)math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305


From: AES on
In article <hhc79g$2np$1(a)smc.vnet.net>,
DrMajorBob <btreat1(a)austin.rr.com> wrote:

> -1. is a Real, hence an Atom, so it has no subordinate parts.
>
> Bobby
>

Thanks -- except, after digging out and reading the Basic Objects
tutorial (which was useful), I think you mean "hence an atomic object"?

Is "Atom" a defined term in Mathematica? The tutorial doesn't seem to
use it.

[And as an aside, is the shaded table of atomic objects in this tutorial
supposed to be a *complete* list of *all* the atomic objects in
Mathematica? I'm never clear whether these shaded lists are supposed to
contain all, or just some, of the objects they illustrate.].

From: danl on
> Scot T. Martin wrote:
>> The problem is that "-1." is not "1".
>
> And furthermore, this bug has been declared a feature. And defended,
> repeatedly. Just as I does not occur in -I.
> It can be fixed, should be fixed, and has been fixed in other CAS.

Deja vu all over again. Why it was only three weeks ago I was seeing
various assertions of bughood mentioned in the Usenet sci.math.symbolic
thread at URL below (insert usual caveats about email line breaking of
URLs).

http://groups.google.com/group/sci.math.symbolic/browse_thread/thread/0256579cfacee298#

One response, from Jon McLoone of Wolfram Research, was quite on target.
I'll try to give a different one.

The first rule of syntactic replacement is that it must obey syntax.
Whether Mathematica's InputForm and related formatting is in some way
misleading in that -1.0 "looks like" it contains 1, or 3-4*I "looks like"
it contains I, is of secondary importance (or maybe tertiary). Far more
important are the following.

(1) InputForm must be readily interpreted (by Mathematica) in an
unambiguous manner. Where possible, e.g numeric notation, it should also
not be overly burdened with prefix notation (that is to say, it is also
nice to have something that is human-readable). Example: Use some familiar
notation, say 3-4*I, to denote what in Mathematica FullForm is
Complex[3,-4].

(2) Numbers must be entities that contain no arithmetic operators e.g.
minus or times. Example: There is no Minus or Times in Complex[3,-4], even
though it "looks" like 3-4*I in Mathematica InputForm. This is important
for efficient arithmetic, and I think also for general evaluation of input
(Example: one wants 3*x/4 and (3/4)*x to evaluate to the same internal
representation, using Times[Rational[3,4],x]).

(3) As noted earlier, syntactic replacement should not arbitrarily and
capriciously depart from following syntax (Examples: Do not consider
Complex[3,4] as "containing" Complex[0,1], even though their respective
InputForm notations are 3+4*I and I, Do not consider Times[3,Power[x,-2]]
as containing x^2, even though InputForm shows it as 3/x^2).

Clearly there are design decisions behind all this. Anyone is free to
state dislike of those decisions. That does not make them bugs. It does
not even necessarily make them bad decisions. Me, I think the ones
itemized above are just fine, which is why I took the trouble to mention
them explicitly.

Daniel Lichtblau
Wolfram Research