0
$\begingroup$

Assuming i have 4 numbers a,b,c and d, my question is how can i find the right set(s) of operands a,b,c,d and operators which gives a specific result d, for example to find the right expression containing the operands 1,2,3 and 4 which evaluate to 24, a possible solution would be: 1*2*3*4 = 24 or 2*3*4/1 = 24, is there a tool/method to do this?.

$\endgroup$
0
$\begingroup$

I doubt it. There are these riddles where e.g. you only use the digit 4 and certain operator and try to create all possible numbers. Some are rather tricky, while others are easy but it does not seem like an algorithm can be found to do that.

Of course, that's not a proof but I'm not sure a proof would be easy.

You could e.g. see though, that it's difficult to construct $\pi$ with natural numbers, as $\pi$ is transcendental. So you will need more than just the standard operators.

$\endgroup$
  • $\begingroup$ Yeah i don't think too that such an algorithm exists, but trying differrent combinaison isn't that hard for a computer. $\endgroup$ – Mehdi Oct 22 '17 at 19:31
  • $\begingroup$ Sure, we could do some coding but a program is just an algorithm that a computer can understand. As I've explained, numbers as $\pi$ need more than standard operators. That'd already be a problem. $\endgroup$ – Qi Zhu Oct 22 '17 at 19:40
0
$\begingroup$

I personal didn't get your question well you need four numbers $A$ $B$ $C$ $D$, which on a particular operations gives a result $d$, Find all possible expression by which the variables $A$, $B$, $C$, and $D$ can be manipulated by an operation to give the same result $d$. If there was no repetition of any of the variable, we would not be able to get anything new $1×2×3×4 = 24$ and $(2×3×4) \div 1 = 24$.
$1$, $2$, $3$and $4$ Worked without repetition because one of the the variable there was equal to $1$, multiplying and dividing by $1$ is same. so there must be repetition of this variables if-not, we wouldn't get anything. Now let's first assume the product of all the variables was $d$ $$ A × B × C × D = d $$ finding another operation by which we can manipulate $A$ $B$ $C$ $D$ depends on the actual value of these variables.. If we were forced to to repeat a variable, then $$ \cdot A \cdot B \cdot C \cdot D \lt d $$ because introducing other maths operation like $+$ $-$ and $÷$, would lesser its value Now without repetition there are infinite ways to make up these, just by mixing and repeating the numbers

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.