Re: [racket-dev] feature request: gcd, lcm for rationals

2011-12-10 Thread David Van Horn

On 12/10/11 9:25 AM, David Van Horn wrote:

On 12/9/11 3:31 PM, Daniel King wrote:

On Fri, Dec 9, 2011 at 15:27, Carl Eastlund wrote:

What does "divides" even mean in Q? I think we need David to explain
what his extension of GCD and LCM means here, in that "divisors" and
"multiples" are fairly trivial things in Q.


I took "x divides y" to mean x/y is an integer.


I meant: y/x is an integer.

David

_
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] feature request: gcd, lcm for rationals

2011-12-10 Thread David Van Horn

On 12/9/11 3:31 PM, Daniel King wrote:

On Fri, Dec 9, 2011 at 15:27, Carl Eastlund  wrote:

What does "divides" even mean in Q?  I think we need David to explain
what his extension of GCD and LCM means here, in that "divisors" and
"multiples" are fairly trivial things in Q.


I took "x divides y" to mean x/y is an integer.


I don't suppose to understand all the math on this page, but I think
it uses the same definition that dvh is using.

http://mathworld.wolfram.com/GreatestCommonDivisor.html


Yes, that's where I got the definition I suggested.

As a concrete example of why I wanted gcd extended to rationals: I wrote 
a big-bang program that runs a set of big-bang programs, so it needs a 
tick-rate that is the gcd of all the tick-rates of the programs it runs, 
which may be rational.


David
_
 For list-related administrative tasks:
 http://lists.racket-lang.org/listinfo/dev


Re: [racket-dev] feature request: gcd, lcm for rationals

2011-12-10 Thread Jens Axel Søgaard
2011/12/10 Stephen Bloch 

>
> On Dec 9, 2011, at 3:31 PM, Daniel King wrote:
>
> > On Fri, Dec 9, 2011 at 15:27, Carl Eastlund  wrote:
> >> What does "divides" even mean in Q?  I think we need David to explain
> >> what his extension of GCD and LCM means here, in that "divisors" and
> >> "multiples" are fairly trivial things in Q.
> >
> > I don't suppose to understand all the math on this page, but I think
> > it uses the same definition that dvh is using.
> >
> > http://mathworld.wolfram.com/GreatestCommonDivisor.html
>
> Interesting: the Mathematica people have extended the gcd function from
> the integers to the rationals, not by applying the usual definition of gcd
> to Q (which would indeed be silly, as everything except 0 divides
> everything else), but by coming up with a different definition which, when
> restricted to integers, happens to coincide with the usual definition of
> gcd.
>

If we for rational numbers x and y define "x divides y" to mean "y/x is an
integer",
then I believe the definition
  d is a gcd of x and y
 <=> i) d divides a and y
ii) e divides x and y => d divides e
coincides with the MathWorld definition.


> I would wonder: is this the ONLY "reasonable" function on rationals which,
> when restricted to integers, coincides with the usual definition of gcd?
>

Not sure, but this seems relevant.

http://trac.sagemath.org/sage_trac/ticket/10771

-- 
Jens Axel Søgaard
_
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/dev