Finding a function to convert arbitrary input to output

In summary, the conversation discusses the desire for a program to automatically generate a function to convert inputs to outputs. Various techniques such as using genetic programming, matrix reduction, Lagrange interpolating polynomials, and fitting complex functions are suggested. However, it is noted that there are an infinite number of possible functions and that genetic programming may not be effective in finding an exact match. The conversation also mentions the possibility of using a tree-searching method with backtracking.
  • #1
Twinbee
117
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
  • #2
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
 
  • #3
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:
  • #4
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.
 
  • #5
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.)
 

Related to Finding a function to convert arbitrary input to output

1. What is the purpose of finding a function to convert arbitrary input to output?

The purpose of finding a function to convert arbitrary input to output is to create a mathematical relationship between the input and output that can be used to consistently and accurately predict the output for any given input. This can be useful in various fields such as data analysis, computer programming, and engineering.

2. How do you determine the most appropriate function for a given set of input and output?

This typically involves analyzing the data and identifying any patterns or relationships between the input and output. Depending on the type of data, various mathematical techniques such as regression analysis or curve fitting may be used to find the most appropriate function.

3. Can any function accurately convert arbitrary input to output?

No, not all functions are suitable for converting arbitrary input to output. The function must be able to accurately capture the relationship between the input and output, and it must also follow certain mathematical rules and properties.

4. Are there any limitations to finding a function to convert arbitrary input to output?

Yes, there can be limitations such as incomplete or inconsistent data, which can make it difficult to identify a clear relationship between the input and output. In some cases, a function may not be able to accurately convert all types of input to output.

5. What are some examples of functions used to convert arbitrary input to output?

Some common examples include linear functions, polynomial functions, logarithmic functions, and exponential functions. However, the specific function used will depend on the type of data and the relationship between the input and output.

Similar threads

  • General Math
Replies
4
Views
795
Replies
1
Views
1K
Replies
4
Views
946
Replies
6
Views
1K
  • General Math
Replies
5
Views
966
  • General Math
Replies
2
Views
742
  • Computing and Technology
Replies
11
Views
3K
Replies
13
Views
1K
Replies
8
Views
1K
Back
Top