Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Applying Mathematica to practical problems

  • To: mathgroup at
  • Subject: [mg130990] Re: Applying Mathematica to practical problems
  • From: Richard Fateman <fateman at>
  • Date: Sat, 1 Jun 2013 06:27:48 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <kmngb2$3rv$> <> <> <ko9ipa$kde$>

On 5/31/2013 12:16 AM, Andrzej Kozlowski wrote:
> I think this is an excellent and quite fascinating account of serious
> and genuinely useful application of some of Mathematica's vast
> capabilities,

Really I don't think he was using much of Mathematica's capabilities.

Symbolic Z transform and trying to optimize expressions by recognition
of constants.

> which made me feel that the kind of stuff that the rest of
> us do is more akin to playing.

Speak for yourself.

  To my mind, it also should make very
> clear (to anyone who had any doubts) the complete irrelevance of most of
> the "criticism" of Mathematica that Richard Fateman has been posting for
> over 2 decades (not that I expect him to stop doing it or even modify it
> in anyway).

Certainly not in response to Doty or you.
> I don't think the points John's makes needs any further support

eh, he seemed to say that he liked to use Mathematica but didn't like
to use SPICE.  Of the two, it seemed that SPICE was essential.  He
didn't explain how Mathematica was especially useful as compared to
other computer algebra systems.

  so I
> want to address just one issue: Richard's use of the words "erroneous,
> incorrect, buggy" etc. This has, in fact, already been addressed by John
> in the first sentence of his reply,

um, subjective and personal, you mean?

but so briefly that I think there is
> still some room for additional comment. Almost always when RJF uses such
> words in connection with Mathemtica he is playing a kind of game, well
> familiar to the veterans of this forum but which could confuse
> newcomers.

Newcomers to Mathematica end up confused when they realize the program
doesn't do what they thought it was supposed to do.

  The idea is to make ambiguous statements that can be
> interpreted in at least two ways: one could be called "strong" and the
> other "weak".

I suppose you are entitled to your opinion, but my thought is that
you are mistaken, at the very least.

  The "strong" interpretation is the one you hope will
> influence people not very familiar with the topic (or with this sort of
> rhetorical tricks), the weak one is what you turn to when pressed by
> people who demand precise justification of your claims. When this
> happens it turns out that the alleged "errors" are not at all what
> people normally call errors but merely aspect of design that Richard
> does not like

Sure, there are some people who might no worry about bad design.
They probably could justify (say) keeping loaded firearms unlocked in
a house with children.  After all, people know not to point firearms
at other people and click the trigger.  Just an opinion.

>(assuming, of course, that he does not have another hidden
> motive that goes beyond disliking the working of Mathematica).

I think my reports are generally quite specific and reproducible.
If you think none of them represent an error, I think you mistaken.

> Thus, Richard whenever he sees a chance to influence someone who he
> thinks is new to Mathematica, suggest that Mathematica's significance
> arithmetic is prone to give wrong answers and is unreliable.

Usually I point it out when someone discovers a problem in the first
place, and wonders about how it could be that an answer is so wrong.

The reason my comments reappear is generally because the questions/
complaints reappear.

  But when
> pressed, he has admitted on a number of occasions that:
> 1. Significance arithmetic, being a (faster) version of interval
> arithmetic, can be useful when used by people who understand it and that
> it is used quite reliably by many built-in Mathematica functions such as
> NSolve (and also Solve).

I doubt that I said this.  I probably said (since I believe it to be the
case)  that internal to routines in Mathematica, the default 
significance arithmetic is bypassed, essentially by separately computing
the precision of intermediate results and imposing that on the numbers 
in an iteration.  In other words, these routines work IN SPITE OF
significance arithmetic, not because of it.

> 2. It is easy to switch to fixed precision arithmetic whenever one wants
> with a simple usage of Block.

If you switch to fixed precision, then you have to know what
the precision should be fixed at.  Numerical analysts have some 
techniques for doing this, and these techniques can be implemented
in Mathematica, and have been, in some internal routines, by
clever people.  But Mathematica documentation would lead you to
believe that Mathematica does the right thing by default.  This
is, in general, false.  As you see by the example you quote, from me!

> In other words: significance arithmetic is a feature that Mathematica
> offers in addition to standard, fixed precision arithmetic.

There is double-float arithmetic, which is almost standard, but
has some quirks. More serious problems for the extended precision.

To use the fixed precision arithmetic, one has to either intersperse
SetPrecision[A,p] among the calculations, or set the system
variables $MaxPrecision and $MinPrecision to a particular integer.
Maybe there are other ways to do this, e.g. using integer arithmetic
and simulating binary point, ...

  How can more
> be worse than less?

The damage, however, is to the user who believes the Significance
arithmetic when it does not deserve to be believed.

Of course JRF when pressed, has admitted all this (I
> can post references but I don't think he will deny it)

I have heard of out-of-context quotes, but you don't even bother!
You simply misrepresent.

  and his
> objections actually amount to just two things: the choice of
> significance arithmetic as the deafult for extended precision
> computations and the fact that Mathematica treats what are actually
> intervals as "numbers" instead of just calling them something else
> ("fuzz balls").

I am not sure what you are claiming here.  If a number is an interval,
then what are the endpoints?  If they are numbers, then they too are
intervals, etc.  ad infinitum.   Much better to have numbers, and then
intervals which are pairs of numbers. end of recursion.

  Every time there is a serious discussion of these
> things, he is forced to concede all these points but then, at the next
> opportunity, he starts the whole things all over again.

I suppose you can make things up if you don't even bother to quote.

  In the end, he
> becomes so careless that he ends up writing comical nonsense like:
>> I will say that for scientific computing it is probably a bad feature
>> to have finite numbers x   such that x ==0  and  x+1 == x.
> Excuse me? I have always assumed that every number system has at least
> one finite number x such that x+1=x, this follows from the group
> axiom.

I think you mean x+1==1  when x is the additive identity  (e.g. zero for 
real numbers).

  Also, by the way, if we are talking about group addition then
> "x ==0  and  x+1 == x"   is a not very economical way to express
> x==0.

um,  read what I wrote and what you wrote  again.

> More seriously, there are two things are being insinuated here, both of
> them false. The first is that having "numbers" with unusual properties
> is somehow "wrong" or even "eccentric" in mathematics.

I contend that x==0   and x+1==x  is beyond eccentric. Mathematica
also may believe x+1==x+2, even though it also believes that
Solve[ s+1==s+2, s]    has no solutions.   Yet x is a solution!
(x=z from the computation below...)

  This is, of
> course, completely false and one can give lots of examples.

You can give an example that numbers in Mathematica sometimes
are not wrong.  That's not much comfort.  It is like you asking me
"How was your hamburger"  and I say "Parts of it were excellent"..

To take just
> one: in non standard analysis one has infinitely many "infinitely small
> numbers" x such that n x <1 for every positive integer n.

OK, If I want to model that I should definitely not use significance
arithmetic.  The zero-ish number z below has the property than
Rationalize[z] is 0
yet z<1 is false.

This is both
> logically sound and very useful in practical proofs and computations.
> Exactly the same is true of "fuzz balls".

I don't see how this relates to Mathematica.  There are many algebraic
systems possible.  Mathematica deals with just a few,  like the Ring
of integers, the Field of rational numbers, some modular stuff, 
Polynomials and Rational Functions,  Matrices,  floats as a model
of reals, principally.   complex numbers, and a bunch of other
stuff including Log, Exp, graphics stuff, maps, whatever.
Someone may have written a package for non-standard analysis, but
if so, probably did not use software extended precision.

> Another insinuation, equally false, is that an unsuspecting "naive" user
> of Mathematica could fall into some trap because of this.

How could you possibly know this?  Just read mathgroup to find people 
who fall into holes.

> Naive users of
> Mathematica practically never use arbitrary precision arithmetic.

Practically never, but occasionally?  Like slightly pregnant?

> who need it will almost always look into the documentation and realise
> that they won't be dealing with numbers in the ordinary sense but
> intervals of variable size.

Users may use it simply by typing too many digits.

  This is why examples of the kind that RJF
> loves posting never come up naturally.

Except on Mathgroup occasionally.

  The only time they occur is
> either then RJF posts them or sometimes when someone discovers low
> precision numbers and tries things like:
> 1`0 == 0
> True
> 1`0 == 1
> True

No, I think that this pretty much unlikely. Discovering low precision 
numbers by typing them in.

  People who truly worry about
precision probably know a lot more about it than this.  They will
be troubled and surprised by Mathematica's model, most likely.
> But, of course, to be able to enter numbers with no precision you really
> need to know, well, what it means for a number to have Precision 0. At
> this point, I suspect, RJF will be tempted to come up with his favourite
> example of the the kind of thing that awaits an unsuspecting user who
> for some reason needs to evaluate:
> z = 1.11111111111111111111;While[(z = 2*z - z) != 0, Print[z]]
> Well, see it for yourself (in Mathematica 9) and decide if anyone would
> find it so confusing.

First of all you don't need so many digits.
(z = 1.11111111111111111; Do [z = 2*z - z, {36}]; z)  produces 0.
(z = 1.1111111111111111; Do [z = 2*z - z, {36}]; z)  produces 1.11111

RealDigits[z] is {{1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, 1}
InputForm[z] is 1.1111111111111112


  • Prev by Date: Re: Applying Mathematica to practical problems
  • Next by Date: Re: Help needed on how plot a stereographic projection
  • Previous by thread: Re: Applying Mathematica to practical problems
  • Next by thread: Re: Applying Mathematica to practical problems