Send Close Add comments: (status displays here)
Got it!  This site "www.robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.  Note: This appears on each machine/browser from which this site is accessed.
Non-rational number approximation
by RS  admin@robinsnyder.com : 1024 x 640


1. Non-rational number approximation
A rational number is a number that can be exactly represented as the division of two integers, say, a and b.

Rational number
The real numbers include numbers that are not rational. Integer ratios can be used to approximate real numbers that are not rational. Pythagoras had proven that the square root of 2 has no rational exact representation, but integer rational approximation were useful, nonetheless.

In antiquity, there were many attempts to approximate non-rational numbers as a ratio of two integers (i.e., rational number).

Such methods are still used today and called floating point approximations (albeit using very large integers). Consider the approximation of 1 over the square root of 3. This is done to get a ratio between 0.0 and 1.0.

Square root of three

2. Manual approach
A manual approach is to start trying values for numerator and denominator and see which is closest. There may be clever ways to prune the search. Here is a grid to show the best approximations for denominators ranging from 1 to 10 and numerators ranging from 0 to 10. The best approximation below and above the desired result is in light green while the others are in gray.

3. Manual grid
Ratio grid

4. Program approach
With the use of computer programming code, is easy to find rational approximations to non-rational numbers. Note: The program is intended to be somewhat clear, but not necessarily the most efficient.

5. Lua code
Here is the Lua code [#1]


6. Output
The output shows the best 20 integer ratio approximations where the denominator ranges from 1 to 300. The ratio of 153/265, found by Archimedes, is the best given these constraints. Here is the output of the Lua code.

That number 153 was taken to be a special number.

... more to be added ...

7. Square root of 2
Here is the above approach repeated for the inverse of the square root of 2.

Consider the approximation of 1 over the square root of 2. This is done to get a ratio between 0.0 and 1.0.

Square root of three

8. Manual grid
Ratio gridHere is the Lua code [#2]


9. Output
The output shows the best 20 integer ratio approximations where the denominator ranges from 1 to 300. The ratio of 153/265, found by Archimedes, is the best given these constraints. Here is the output of the Lua code.


10. End of page

by RS  admin@robinsnyder.com : 1024 x 640