Version 15 of irrational

Updated 2005-07-20 21:16:19

An irrational number cannot be represented as a fraction composed of integer parts. EG PI, e.

There are an infinite number of irrational numbers between each rational number, and there are an infinite number of rational numbers. Which you might think means there are more irrational than rationals [ CL feels compelled to point out that this is not a correct proof; notice, for example, that between each two distinct irrationals there are infinitely-many rationals]. See Cantor for the transfinite numbers.

Any number whose decimal representation recurs at any point is rational. This is proved since:

Make PRE = the decimal representation up to where the number starts repeating, and replace the repeating part with 0000... then the number PRE can be represented as PRE*1000..../1000.... (ie a fraction, using as many digits in the multiplier as needed to make PRE an integer). Eg 3.4352141414... = 34353/10000 + 0.141414/10000....

The repeating part can be made into a fraction by taking the repeat and dividing by 99999.... (as many 9s as are in the repeated part).

For example: .77777... = 7/9. 0.7171.. = 71/99; 0.142857142857... = 142857/999999, .00000717171... = 71/99/100000 and so on. So any number which has a recurring representation can be written as a sum of 2 fractions: Val = PRE + rept/999.... and is therefore a rational number.

Well that is a simple version of the proof, but largely correct.

In finite digit arithmetic (eg in a coding language such as C++ or Fortran or TCL) there are only a finite number of digits representing a value. Most computer languages therefore use rational numbers ONLY, and operate on rational numbers too. Thus computers really work in integers, though some algebra packages such as Mathematica, Maple etc do have some understanding of irrationals.

GWM


AMG: Accurately representing irrational numbers on finite computers requires some creativity. The obvious encoding is to store the sign, magnitude, and binary exponent (or implicitly understand the exponent to be 0 or -16 or some such for integer or fixed-point storage), but no combination of integral magnitude and integral exponent can exactly represent any irrational number. But there are ways around this...

One possibility is retaining the algebraic expression that generates said number, much like we do with pencil and paper. Let's say we're writing a calculator program using two-digit fixed point decimal encoding. First the user enters 2, so it remembers 2.00. Next the user hits sqrt, and the calculator stores 1.41. Lastly, the user presses sqr, resulting in 1.98. Huh? The calculator would have been correct if it instead had stored sqr(sqrt(2)).

Another is remembering not the number but rather its properties, the same way we mentally handle pi (for example). I know that when I work with pi I almost never think to myself "3.1415"; instead pi is pi, sin(pi) is 0, tan(pi) is undefined, etc. Or for sqrt(2): sure it comes close to 1.414, but more importantly sqr(sqrt(2)) is 2, for any value of 2 :^) .

All this leads to a computer algebra system.

So I wonder, is there a number that cannot even be expressed by a finite series of algebraic manipulations? How about cos(cos(...(cos(cos(0.5)))...))? It tends to, but is not equal to 0.739085133215. I don't know how to express it as a limit or an iterative expression (summation, product, or even an integral), yet still I have managed to enter it into my tkcon by turning it into a chunk of code. Since it doesn't terminate, it doesn't qualify as an algorithm, and it's impossible to manipulate in a finite amount of time. A clever fellow may be able to devise a usable limit (not just "x_0 = 0.5; x_i = cos(x_(i - i)); limit of x_i as i->infinity", which only restates the original expression), yet some other clever fellow might prove the nonexistence of a handy closed-form limit expression. If such a thing is proven, what does that say about our friend the infinite cosine? Or the computer algebra system? Does this mean there are numbers computers simply cannot manipulate? Or is there a way to master the infinite? These are just thoughts...

Update: The moment I hit the Save button I realized this particular "infinitely complex" expression really can be distilled into something more workable: It is equal to the (a?) value of x which solves cos(x)=x. Now I'm embarrassed. The Save button is a teacher both wise and cruel. Only the Send button is more harsh. :^)

EKB No reason to be embarrassed if you rediscover something interesting (IMHO). First, I think you've answered your own question -- yes, indeed, there are equations that have no closed-form solution. Also, you have implemented a reasonable (but not, I think, optimal) solution algorithm. Graphically, what you were doing is tracing the green line in the following diagram, which has plots of y=cos(x) and y=x:

http://www.kb-creative.net/images/CosxIsx.gif

I think by looking at the graph you can convince yourself that 1) there is a unique, positive solution to cos(x) = x and 2) it doesn't matter what your starting point is (it doesn't have to be 0.5). Another way to cast the problem you were working on is: what is the solution to cos(x) - x = 0? There are well-established algorithms for finding zeros of functions (e.g., Newton's method), but I don't know which algorithms are better in which situations.

By the way, 1. pi is irrational, 2. pi is the ratio between a circle's diameter and its circumference, therefore 3. no circle can have rational values for both diameter and circumference. Just thought I'd throw that in there. :^)


also qv Perl Syntax


Category Mathematics