views:

74

answers:

1

I want a program that does what I said in the title.

I realize that this is a pretty vague problem. I also realize that figuring out how to transform any input into any output is nearly impossible, but it seems like handling some simple cases should be feasible.

To provide a concrete example (in Python):

>>> def find_transform(start, desired):
>>>     # Insert magic here

>>> find_trasform([1,2,3], [3,2,1])
"reverse"

>>> find_trasform([1,2,3,4], [[1,2], [3,4]])
"divide 2"

I suspect there's an official word for this sort of thing, but I don't know what it is.

+1  A: 

Well, the term is called Data Mapping. It's a vast field that can serve a few purposes, including yours.

The tools for such a task are hard to master, so don't expect this to be easy. For this specific case, you will be looking for Data-Driven Mapping methodologies. These involve a combination of heuristics and statistics to find the relevant relationships.

Thankfully your examples are well expressed mathematically and will remain true for every element of the data sets. So you can start tackling this problem by trying to analyze mathematical relationships between paired elements and trying to validate any found relationships on the remaining pairs.

EDIT: The last example adds a new dimension. So this must be observable too. If you stick to a progressive relationship between sets as is the case there (first establish relationship between set 1 and 2, then between set 2 and 3) all will be well. It may even help to more quickly prove a relationship since you don't need to recurse so often. But more complex relationships between sets may force you into a much more complex problem to handle. Try to keep it simple.

Krugar
Cool. Thanks for the guidance.
Jesse Aldridge
interesting little big project you have there. Have fun.
Krugar