Rational numbers
I want to expound on some extremely basic properties rational numbers that I find fascinating.
First, for the uninitiated, rational numbers are the numbers that result from dividing an integer by non-zero integer. I will assume you understand the properties of the Integers.
Two rational numbers, n=p/q, and m=r/s, (where p, and r are integers, and s and q are non-zero integers) are considered "equal" if and only if p*s=r*q in the integer sense of equality.
You multiply two rational numbers, n=p/q, and m=r/s, (where p, and r are integers, and s and q are non-zero integers) to get a rational number l=(p*r)/(q*s). When you add those two same rational numbers, you get (p*s+r*q)/(2*q*s).
Also note, for a rational number of the form, n=p/1(where p is an integer), we can shord hand the rational number to just be the integer p.
For those of you who wonder if this is a valid definition of equality:
- A rational number is equal to itself. If m is a rational number given by dividing r by s. r*s=r*s. (reflexive property)
- Given two rational numbers m=p/q, and n=r/s (where p, and r are integers, and s and q are non-zero integers). If m=n, p*s=r*q. This means r*q=s*p*s, which means m=n. (symmetric property)
- Given three rational numbers n=p/q, m=r/s, and l=t/u (where p, r, and t are integers, and s, q and u are non-zero integers)... and given that n=m and m=l. We have p*s=r*q and r*u=s*t. This means p*s*r*u=r*q*s*t. This further means that p*u*r*s=q*t*r*s. Dividing by r*s, p*u=q*t. This means n=l. (transitive property)
Given two rational numbers, n=p/q, and m=r/s, (where p, and r are integers, and s and q are non-zero integers) n is
less than or equal to m if and only if p*s is less than or equal to r*q in the integer sense of the inequality.
For those of you uncomfortable with this definition of the inequality, we'll check the properties.
- Given two rational numbers, n=p/q, and m=r/s, (where p, and r are integers, and s and q are non-zero integers). If n is less than or equal to m, and m is less than or equal to n. p*s is less than or equal to r*q, and r*q is less than or equal to p*s in the integer sense. This means in the integer sense, p*s=r*q. This then means n=m. (anti-symmetry).
- Given three rational numbers n=p/q, m=r/s, and l=t/u (where p, r, and t are integers, and s, q and u are non-zero integers)... and given that n is less than or equal to m and m is less than or equal to l. We have p*s is less than or equal to r*q and r*u less than or equal to s*t. This means p*s*r*u less than or equal to r*q*s*t. This further means that p*u*r is less than or equal to s=q*t*r*s. Dividing by r*s, p*u is less than or equal to q*t. This means n=l. (transitivity)
- Given two rational numbers, n=p/q, and m=r/s, (where p, and r are integers, and s and q are non-zero integers), either n*s is less than or equal to r*q or r*q is less than or equal to n*s or both. This means n is less than or equal to m or m is less than or equal to n
We say n is
greater than or equal to m is m if an only if less than or equal to n. We say that m
is less than(<) n if and only if m is less than or equal to n and it is not true that m=n. We say that n
is greater than (>) m if and only if it is not true that n is less than or equal to n.
OK, now that you have been initiated to rational numbers, I'd like to point out some interesting properties.
First, between every pair of rational numbers, there is the average of the two rational numbers between them..
More formally, consider two rational numbers, n=p/q, and m=r/s, (where p, and r are integers, and s and q are non-zero integers), where n<m. This means, p*s<r*q. Consider another rational number, l=(p*s+r*q)/(2*q*s). 2*q*s*p < q*p*s+q*r*q=q*(p*s+r*q), This means n<l. Also, s*(p*s+r*q)=s*p*s+s*r*q<2*s*r*q=2*q*s*r. This means l<m. So for any two rational numbers, there is a rational number (namely the average) between them.
Rational numbers have a "natural" form (my term, useful for the ensuing discussion). Say n=p/q. If there exists an integer, r, greater than 1, such that r divides p evenly, and r divides s evenly, then p/q is in an “unnatural” form of n. We can divide both p and q by r and check to see if the result for a common divisor. Once n=p_0/q_0, where p_0 and q_0 have no integer divisors in common that are greater than 1, well call it the “natural” form.
So with all these numbers around, one may think that every point along a number line is covered, but this is far from the case.
First, let's see if we can find a rational number n, such that n^2=2. Let us suppose we have such a rational number, n, in natural form, n=p/q. Then p^2/q^2=2. This means p^2=2*q^2. So p^2 is even, meaning p is even. So p=2*r (r is an integer). This means (2r)^2=4*r^2=2*q^2. So 2*r^2=q^2. This implies that q^2 is even, and therefore q is even. However, this means that n was not in natural form, no matter what we choose from p and q. So there is no rational solution to n^2=2.
Let's look now at the two sets of rational numbers defined by A={all rational numbers, n, such that n^2<2}, B={all rational numbers, n, such that n^2>2}.
Let us now define a function that returns a rational result for any rational input, n>0.
m=n+(2-n^2)/(n+2). Notice:m>n if and only n^2<2. Similarly, m<n if and only if n^2>2.
We can re-write m like this: m=(2*n+2)/(n+2). So now m^2-2=2*(n^2-2)/(n+2)^2. Notice now that, m^2-2<0 (IOW m^2<2) if and only if n^2<2, and that m^2>2 if and only if n^2>2.
So now for every element, n, in A, we have a greater element, m in A. This means there is no greatest element in A.
Similarly for every element, n, in B, we have a lesser element, m in B. This means there is no least element in B.
Trippy huh?