The rational number 24/11 as a set

One way to define a rational number (a-b)/c is to define it as the (infinite) set of all 3-tuples of natural numbers (a1, b1, c1) for which (a-b)/c = (a1-b1)/c1 (b is needed for negative numbers).

Klick on a 3-tuple to see how it may be defined as a set.

24/11 = (24-0)/11 = {

( 24, 0, 11 ),

( 48, 0, 22 ), ( 48, 24, 11 ),

( 72, 0, 33 ), ( 72, 24, 22 ), ( 72, 48, 11 ),

( 96, 0, 44 ), ( 96, 24, 33 ), ( 96, 48, 22 ), ( 96, 72, 11 ),

( 120, 0, 55 ), ( 120, 24, 44 ), ( 120, 48, 33 ), ( 120, 72, 22 ), ( 120, 96, 11 ),

( 144, 0, 66 ), ( 144, 24, 55 ), ( 144, 48, 44 ), ( 144, 72, 33 ), ( 144, 96, 22 ), ( 144, 120, 11 ),

( 168, 0, 77 ), ( 168, 24, 66 ), ( 168, 48, 55 ), ( 168, 72, 44 ), ( 168, 96, 33 ), ( 168, 120, 22 ), ( 168, 144, 11 ),

( 192, 0, 88 ), ( 192, 24, 77 ), ( 192, 48, 66 ), ( 192, 72, 55 ), ( 192, 96, 44 ), ( 192, 120, 33 ), ( 192, 144, 22 ), ( 192, 168, 11 ),

( 216, 0, 99 ), ( 216, 24, 88 ), ( 216, 48, 77 ), ( 216, 72, 66 ), ( 216, 96, 55 ), ( 216, 120, 44 ), ( 216, 144, 33 ), ( 216, 168, 22 ), ( 216, 192, 11 ),

( 240, 0, 110 ), ( 240, 24, 99 ), ( 240, 48, 88 ), ( 240, 72, 77 ), ( 240, 96, 66 ), ( 240, 120, 55 ), ( 240, 144, 44 ), ( 240, 168, 33 ), ( 240, 192, 22 ), ( 240, 216, 11 ),

( 264, 0, 121 ), ( 264, 24, 110 ), ( 264, 48, 99 ), ( 264, 72, 88 ), ( 264, 96, 77 ), ( 264, 120, 66 ), ( 264, 144, 55 ), ( 264, 168, 44 ), ( 264, 192, 33 ), ( 264, 216, 22 ), ( 264, 240, 11 ),

( 288, 0, 132 ), ( 288, 24, 121 ), ( 288, 48, 110 ), ( 288, 72, 99 ), ( 288, 96, 88 ), ( 288, 120, 77 ), ( 288, 144, 66 ), ( 288, 168, 55 ), ( 288, 192, 44 ), ( 288, 216, 33 ), ( 288, 240, 22 ), ( 288, 264, 11 ),

( 312, 0, 143 ), ( 312, 24, 132 ), ( 312, 48, 121 ), ( 312, 72, 110 ), ( 312, 96, 99 ), ( 312, 120, 88 ), ( 312, 144, 77 ), ( 312, 168, 66 ), ( 312, 192, 55 ), ( 312, 216, 44 ), ( 312, 240, 33 ), ( 312, 264, 22 ), ( 312, 288, 11 ),

( 336, 0, 154 ), ( 336, 24, 143 ), ( 336, 48, 132 ), ( 336, 72, 121 ), ( 336, 96, 110 ), ( 336, 120, 99 ), ( 336, 144, 88 ), ( 336, 168, 77 ), ( 336, 192, 66 ), ( 336, 216, 55 ), ( 336, 240, 44 ), ( 336, 264, 33 ), ( 336, 288, 22 ), ( 336, 312, 11 ),

...

}

The equation (a-b)/c = (a1-b1)/c1 is equivalent to a·c1 + b1·c = a1·c + b·c1 - so only addition and multiplication of natural numbers are needed to define the rational numbers.

For rational numbers Q, Q1 as defined above, Q < Q1 is defined as a·c1 + b1·c < a1·c + b·c1 for one/all (a, b, c) ∈ Q, (a1, b1, c1) ∈ Q1.

Q + Q1 is defined as (a2-b2)/c2, where a2 = a·c1 + a1·c, b2 = b·c1 + b1·c, c2 = c·c1 for one/all (a, b, c) ∈ Q, (a1, b1, c1) ∈ Q1.

Be aware that (a2-b2)/c2 is simply a notation for the set determined by a2, b2 and c2 here - not an expression using subtraction and division.

The definition for Q + Q1 above simply is a transformation of the expression (a-b)/c + (a1-b1)/c1.

Assuming that a,c is minimal for a positive rational number a/c or (a-0)/c, we can enumerate all members of the set by doing this:

Let n be 1
Repeat:
  For all n1 from 0 to n-1:
    Let a1 be n·a
    Let b1 be n1·a
    Let c1 be (n-n1)·c
    Enumerate (a1,b1,c1)
  Increase n by 1

The enumeration as Python function with a limiting parameter k which will cause the function to enumerate (k·(k+1))/2 elements of a/c:

def print_rational_number(a,c,k):
    print str(a)+'/'+str(c)+' = ('+str(a)+'-0)/'+str(c)+' = {'
    for n in range(1,k+1):
        for n1 in range(n):
            a1=n*a
            b1=n1*a
            c1=(n-n1)*c
            print '( '+str(a1)+', '+str(b1)+', '+str(c1)+' ),'
        print
    print "..."
    print "}"

(back to √2)