Hacker News new | past | comments | ask | show | jobs | submit login
Inverse Symbolic Calculator Plus (newcastle.edu.au)
28 points by edwintorok on May 1, 2013 | hide | past | favorite | 14 comments



Basically, this app tries guess whether a floating point number specified by the user can be expressed as some multiple of pi, e or one of the other important math numbers.

ex: You want to calculate 150[degrees] in radians. Simple you say, just convert using your calculator: 150 [degrees] = 2.35619449019 [rad].

However On an exam/homework you would lose marks for this answer since it is not given "the right way" (as a fraction of pi). Using this app you can find out that 2.35619449019 [rad] = (3*pi)/4 [rad] and get all points.

Cool.


I prefer RIES [1], that does pretty much the same thing. You can download its source code (C, GPL licensed) [2] or try it on the webpage. Oblig. (relevant) xkcd [3].

[1] http://mrob.com/pub/ries/index.html

[2] http://mrob.com/pub/ries/src/ries.c.txt

[3] http://xkcd.com/1047/


Definitely cool, even though it's overloaded at the moment.

The HP-48 series calculators and their successors have commands to convert from floating point to the approximately equivalent rationals or fraction of pi, but not exponentials or radicals or anything else like that. The tolerance for the approximation is determined by how many digits of the floating point number the calculator is set to display, so if you know the denominator is supposed to be small, you can force the calculator to produce the right answer even if you have relatively few decimal digits to work with or if there's a lot of rounding error.


150/360 = 5/12, so 150 deg = 5pi/6 rad.

Clearly we could use this calculator. :P


I tried entering 4, which it suggested 2/5 to be the best answer. I would have assumed it suggested 2+2, but apparently it cannot handle simple calculations.

Since 2/5 is 0.4, I thought it was because just entering '4' meant '0.4', but entering '4.0' and it produced the same result.


I you look at the results, it's just matching a sequence of digits. It's not looking at the decimal place at all.


Just gave it pi squared over 6 (1.6449340668482264), which is the sum to infinity of 1/n-squared, and it identified it as zeta(2) (http://en.wikipedia.org/wiki/Zeta_function). Impressive.


Is there a developed theory around this kind of work? This seems somehow related to various search strategies, but it'd be interesting to hear what sort of tools are exploited.


Yes - lattice reduction and integer relation detection.

You can construct a basis that contains a load of constants (pi, pi/2, pi/3, sqrt(pi) etc), and combinations of constants (pi*e, e^pi etc). Then you can use an integer relation algorithm [1] like PSLQ [2,3] to find integer coefficients with which to express the desired number in terms of elements of the basis.

[1] http://en.wikipedia.org/wiki/Integer_relation_algorithm [2] http://arminstraub.com/files/pslq.pdf [3] http://mathworld.wolfram.com/PSLQAlgorithm.html



Maybe machine learning, trying to build models from examples is very common problem in ML. For example, regression [1] seems close.

[1] http://en.wikipedia.org/wiki/Regression_analysis


There's been a recent blog by John D. Cook about doing the same thing with SymPy, which is fairly nifty:

http://www.johndcook.com/blog/2013/04/30/recognizing-numbers...


     Standard lookup results for 1

     Best guess: 1/10


try 0




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: