Finding a function to convert arbitrary input to output

AI Thread Summary
The discussion focuses on finding a mathematical function to convert arbitrary input values to specific outputs. Participants suggest various techniques, including matrix reduction for linear solutions, Lagrange interpolating polynomials for closed-form answers, and consulting Sloane's OEIS for potential solutions. There is interest in software that utilizes genetic programming or other methods to automate this process, although concerns are raised about the effectiveness of genetic programming for exact matches. The conversation highlights the complexity of the problem, noting that there are infinitely many functions that could produce the desired outputs. Ultimately, the goal is to find the simplest function that meets the criteria.
Twinbee
Messages
116
Reaction score
0
I have arbitrary input numbers, and an arbitrary output. I want a program to automatically give me a function (various constants and mathematical symbols) to convert from the input to the output. What's the best way of doing this?

Are there any programs to do this for you, perhaps which use genetic programming? Any general techniques and tricks to solve this manually?

Here are two examples. The solution to the second one would be great, but I would prefer a general technique to achieve the conversion for any example.

1, 4 -> 15
2, 2 -> 12
5,1 -> 18

Easy peasy - you just add the first two numbers together, and multiply that by 3. Anyone can do that in their head. But for something like this, it gets much harder:

a=3. b=8. c=1.6 -> 0
a=2 b=1.5 c=3 -> 0
a=1.6666 b=3 c=3 -> 0
a=1.85 b=3.863 c=2.5 -> 0
a=2.1 b=2.445 c=2.4 -> 0
 
Mathematics news on Phys.org
A truly arbitrary function could be the given values at the given points, and 0 elsewhere. There are lots of possibilities. Having said that:

* Put the data in a matrix and reduce it; if there's a linear solution that should find it.
* You may be able to use Lagrange interpolating polynomials to give a closed form answer
* Looking up values in Sloane's OEIS could give an answer
* Really complex functions can be fitted with the techniques in http://citeseer.ist.psu.edu/293266.html
 
Thanks for those. Yes, I've heard before that there are an infinite number of possible functions to create a given output. However, I'm looking for the shortest naturally. In the above case, multiplying by 0, or dividing by infinity would also result in the desired function, but one can exclude those cases.

I'll study the above points you've made in more depth. In the meantime, does anyone know of any software (free or commerical, but preferably cheap) that would use genetic programming or similar to do all of this automatically?
 
Last edited:
I don't imagine genetic programming would be very effective on this problem, since you're looking for exact matches. If you're going to use a standard AI method, tree-searching method with backtracking would probably be better.
 
Twinbee said:
Thanks for those. Yes, I've heard before that there are an infinite number of possible functions to create a given output.

In fact, the number of such functions is two to the power of the continuum. It's 'more than infinite', it's uncountable. It's 'more than uncountable', it's beth_2.

(Not that you care.)
 
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top