[R] Logical inconsistency

Berwin A Turlach berwin at maths.uwa.edu.au
Sun Dec 7 19:05:12 CET 2008


G'day Wacek,

On Sat, 06 Dec 2008 10:49:24 +0100
Wacek Kusnierczyk <Waclaw.Marcin.Kusnierczyk at idi.ntnu.no> wrote:

[....]
> >> there is, in principle, no problem in having a high-level language
> >> perform the computation in a logically consistent way.  
> >
> > Is this now supposed to be a "Radio Eriwan" joke?  As another saying
> > goes: in theory there is no difference between theory and practice,
> > in practice there is.
> 
> no joke, sorry to disappoint you. 

Apparently it is, you seem to be a comedian without knowing it. :)

"Radio Eriwan" jokes are a class of jokes in which a question was posed
to the announcer of "Radio Eriwan", a fictive radio station.  The
answer was always "In principle yes, but..." or "In principle no,
but..."; the part that came after the but contradicted the initial
answer.  If you know a little bit of German, google for "Radio Eriwan"
and you will find out more about these jokes.  

So your posting would be a classical "Radio Eriwan" answer to a yet
to specify question:  "In principle, no problem of having a
high-level language perform the computation in a logcally consistent
way, but [...] i do not claim that r should implement arbitrary
precision floating point arithmetic [and] if you have involving
computations on floats it would make little sense to implement
arbitrary precision."  

Classical Radio Eriwan stuff, and I thought this class of jokes have
died out.....

> [...] the point was, the user was surprised, and the answer pointed
> her, if indirectly, to an article which is addressed to computer
> scientists and discusses low-level representational details, but the
> user was presumably interested in stats, not computer science.  so
> the answer felt like lacking a justification.  

First, I think it is a rather ambitious jump in logic that a user is
interested in stats because the user wants to see whether "8.3 - 7.3 >
1" is true.  The only indication of the user being interested in
stats would be that the user used R, which is used primarily for
statistical analysis; though some people apparently use it also as a
scripting language instead of Perl or Python.  If the user had typed
this into matlab/octave/scilab/YouNameIt, would would you have thought
that the user is interested in?

Secondly, that the FAQ points to an article that is addressed to
computer scientists is coincidental and not really of any importance.
There is a Wiley & Sons book called "Numerical Issues in Statistical
Computing for the Social Scientist", plenty of books on numerical
analysis, plenty of books for numerical analysis or numerical linear
algebra for statisticians that discuss issues that arise when you start
to do calculations in finite precision arithmetic.  You could probably
write papers entitled "What Every XXXX Scientist Should Know About
Floating-Point Arithmetic" for every possible XXXX.  It just so happens
that the article by Goldberg is one that is freely available on the
internet and it is much better to point people to this article than to
any of the myriads of books that exist on this topic but which they
would first have to get from the library.  

If you know of any other freely available article that discusses these
issues, and that you think is more appropriate for pointing useRs to,
feel free to suggest to the FAQ maintainers to change the citation.  

> > But you are wrong here, R performs logically *in the logic of finite
> > precision arithmetic*.  The problem is that you are using finite
> > precision arithmetic but expect that the rules and logic of infinite
> > precision arithmetic hold.  If you want to use have infinite
> > precision arithmetic, then use a tool that (supposedly) implements
> > it. 
> 
> well, it clearly depends what you regard as logical.  you can have r
> say '1==0' is true, and argue that it's correct by the logic adopted.

Either infinite precision arithmetic or finite precision arithmetic, in
neither of this would "1==0" being true be logical.

Though, I once read that Kahan managed to get Mathematica to believe
that 1==0.  It must have been some time ago, so probably was an old
version of Mathematica.  Kahan started with two expressions that were
logically, in infinite precision arithmetic, identical, so Mathematica
agreed that they were the same.  But when then asked to evaluate both
expression numerically, Mathematica evaluated one expression to 1 and
the other to 0 and, thus, started to believe that 1==0.
 
> fine.  the issue is, if you assume your users are statisticians, not
> computer scientists, you should not be surprised the logic some of
> them assume differs from the one you implement. 

If I assume that my users are statisticians, then I would assume that
they have learned during their training about finite precision
arithmetic and know about these problems.  Though, they might have
forgotten about having learned about it..

Cheers,

	Berwin



More information about the R-help mailing list