I have some number X (0-999) and six random numbers (<50).
I need program to automatically finds number X (or number closest to X if its not possible to find X) using basic mathematical operations with brackets and those 6 random numbers.
Can someone recommend me a way to approach this problem? I read somewhere that I should use postfix-notations and genetic algorithms but I don't know much about either of those.
Postfix notation avoids the complications that come with using brackets. It allows you to model the equation as
6! = 720
permutations in all), followed by4^5 = 1024
combinations in all)The total number of possible equations is
720*1024 = 737280
. So I see no reason to use a genetic algorithm, you can simply try all the possibilities. After finding the best postfix solution, you'll need to convert to infix with the appropriate brackets.