Re: Defining "<" for the rationals



In article <200511261621.jAQGLl016502@xxxxxxxxxxxxxxxxxxxx>,
mstemper@xxxxxxxxxxxxxxxx (Michael Stemper) wrote:

> I've been looking at the rational numbers as an equivalence relation.
> I've been able to show that the definitions of multiplication and addition
> give the same answer, regardless of which member of an equivalance set
> is chosen. I wanted to also define the "<" relation, but hit a stumbling
> block. Most of the time, you can say (a,b)<(c,d) iff ad<bc. However, this
> falls apart if b or d is negative.
>
> I could say "chose a member of [(a,b)] with a positive second element,"
> or I could say "if b<0, change the signs of a and b." Neither of these
> seem particularly elegant. Is there a cleaner way to define the less
> than relation on rationals?

The "standard" representation of a rational requires that the numerator
and denominator share no positive integer factor larger than 1 AND that
the denominator be positive.

In comparing standard representations, a/b < c/d iff a*d < b*c works
fine.


Alternately, you can define your equivalence relation on the Cartesian
product of the integers with the (positive) naturals. Then your
"denominators" are automatically positive. This automatically avoids the
problem of zero denominators as well.
.



Relevant Pages

  • Re: (Not quite) Cantors diagonal proof
    ... >> Please read the replies to you made by Tim Peters, Dave Seaman, Daniel ... > Method fails on rational numbers. ... Yes it fails because the rationals are countable, ... Given any number with repeating decimal, we can calculate the integer numerator and denominator. ...
    (sci.math)
  • Re: (Not quite) Cantors diagonal proof
    ... >> Please read the replies to you made by Tim Peters, Dave Seaman, Daniel ... > Method fails on rational numbers. ... Yes it fails because the rationals are countable, ... Given any number with repeating decimal, we can calculate the integer numerator and denominator. ...
    (sci.logic)
  • Defining "<" for the rationals
    ... I've been looking at the rational numbers as an equivalence relation. ... seem particularly elegant. ... than relation on rationals? ... Time flies like an arrow. ...
    (sci.math)
  • Re: forcing representation of denominator 1?
    ... (d (denominator odds))) ... (let* ((n (numerator odds)) ... CL rational numbers you could use rationals for pay-win ... risk-reward figures (for which you care about representation ...
    (comp.lang.lisp)
  • Re: printf "%.100f" the value 2 ^ (-127)
    ... > infinite set of rationals, would you find the member with the ... E.g. by trying a denominator of 1 first, ... makes the number fall into the range, if any (multiply range bounds by ... the denominator, and try surrounding integers). ...
    (microsoft.public.vc.language)