Answer the question
In order to leave comments, you need to log in
Find a pattern between numbers?
There are initial numbers, 5 pieces, on their basis the sixth number is formed. There are no other variables besides 5 numbers, but there may be constants.
Actions between 5 numbers are not known, the algorithm is not available. Actions can be of any nature, not only mathematical ones, but, for example, a bit-by-bit shift, something even more tricky, etc.
There are 5 examples and the resulting numbers have more numbers. Those. the algorithm can produce them indefinitely.
Is it possible to determine the algorithm and dependencies without reverse engineering the existing code?
At least in theory I want to understand whether it is possible to solve this problem?
Answer the question
In order to leave comments, you need to log in
impossible to solve in your problem statement.
You say that there are 5 numbers, that is, we know x1, x2, x3, x4, x5. There is an unknown arbitrary function F that calculates x6 = F(x1, x2, x3, x4, x5).
Task: Guess F and value x6.
xDDD
This is a task for a genetic algorithm. It is described and there is a source code in the book “Programming the Collective Mind”, look for it. Brief essence of the algorithm: mathematical operations are represented as a tree. For example, A + B is a tree at the root of the addition operation, two leaves of the tree A and B. Operation A * 2 + B is a tree at the root +, on the left (left operand) - Multiplication, on the right B. The “multiplication” node is again divided into two branches - on the left A on the right 2. Well, in general, you understand. We randomly generate a population and run a genetic algorithm. Types of mutations - copying and rearranging subtrees. The survival function is how well the resulting mathematical expression correctly finds the sixth term for each of your training sequences.
I tried this source code on simple examples, such as guessing formulas of this kind “A * 4 + B * 9” - the solution is found quite quickly on training sets of 100 examples. If you have a sufficient number of training examples, there is a chance that it will find a solution in your case. Please write. results if you do.
Maybe an approximation will help you ?
True, it is powerless before permuting the numbers in the resulting number))
Well, in theory, everything is possible. You have a good base: source - result. Therefore, armed with a cryptanalyst, this problem can be solved, in theory. In practice, you can come up with a very complex algorithm that is unlikely to be solved or possible, but with the involvement of such funds that the task is not worth it.
In addition, if the function is a black box for you, where did you get the idea that x7 is not used there, equal to the phase of Jupiter at a given, specific, moment in time.
Such tasks, nevertheless, are easier to solve by reverse, unless, of course, a certain pattern is immediately guessed there.
Well, if only the task was formulated more clearly.
“There are no other variables besides 5 numbers, but there may be constants.” Are constants not numbers?
“Actions can be of any nature, not only mathematical” - I can’t imagine non-mathematical actions on numbers. Number is a mathematical abstraction. A bitwise shift is a multiplication by a power of 2, for example, ...
Unless, like in that children's problem, non-mathematical operations on numbers are when the eight corresponds to two, because there are two circles in the eight. But if this is such an algorithm, then of course it is hardly possible to pick it up ...
If you came up with a problem out of your head, you need to formulate it more strictly.
Well, at least for any x1..x5, it is possible to construct for any possible x6 a 5th degree polynomial passing through all these points, so it is not possible to predict anything without additional data.
You can provide at least 1 row of numbers, and preferably a row of 3, in theory it is possible, if the 6th number is not random, but performed according to some algorithm, then it can be calculated in theory.
Can you ask these 5 numbers yourself? Or are they issued together with the 6th number already?
It seems to me that any sixth number can be added to the given five numbers - there will definitely be a pattern (and not one, but infinitely many) ... For example, consider the numbers 1, 2, 3, 4, 5:
Without known options for action between numbers, no. But if you can limit their number, you can try to pick up the function of the gene. algorithm. Those. a task of the form “given 5 numbers, arrange arithmetic operations between them so that the sixth number is obtained” gene. can be easily solved by the algorithm.
If the result is a number, and the spread of the five inputs is small enough, I would build tables like this to start with:
0+0-0+0-0=0
1+0-0+0-0=1
2+0-0+0-0=2
.....
0+1-0+0-0=1
.....
0+0-1+0-0=-1
.......
With an infinite output of 5:1 sets by the algorithm, it is possible to reduce the problem to 1:1, i.e. find many sets where only one variable changes, the rest are constants. In fact, we get F(x)=y, where x and y are known. the inverse function can be obtained by series expansion. Naturally, the function can be restored only with a certain accuracy.
IMHO the problem is solvable in theory.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question