[R] Number -> Fraction

Alberto Monteiro albmont at centroin.com.br
Thu Sep 13 20:44:26 CEST 2007


Ravi Varadhan wrote:
>
> Finding sufficiently accurate rational approximations to a real 
> number, can be done using fractions() in MASS, which uses
> continued fractions.
>
In a slight off-topic digression, I recently learned that
any irrational number that can be nicely approximated by
rational numbers is transcendental. The number that gets
the _worse_ approximations is the ubiquitous Golden Ratio:

  phi <- (1 + sqrt(5))/2

There's a way to express this precisely, something like
|x - p/q| < 1/q^n (http://en.wikipedia.org/wiki/Liouville_number)

Alberto Monteiro



More information about the R-help mailing list