M
M
Maxim2013-12-15 20:48:06
Mathematics
Maxim, 2013-12-15 20:48:06

Is there an algorithm that allows you to place signs between terms to get equality?

Let's say there is an expression:
4 4 4 = 4;
Is there an algorithm that will put + or - signs to get an identity?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Y
Yuri Yarosh, 2013-12-15
@Frapsy

If the numbers are different - you can consider this problem as a breadth-first search.
If the same, then this is a simple generation of all permutations in the sequence.

G
GavriKos, 2013-12-15
@GavriKos

You can use a complete enumeration, you can use a genetic algorithm for the sake of interest (I once implemented it - it works and it's not difficult) - and then you can get approximate results.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question