Finding integer numbers using basic operations

Click For Summary
SUMMARY

The discussion centers on constructing an algorithm to determine if a target integer can be formed using a given set of integers and four basic operations (addition, subtraction, multiplication, and division) without reusing any number. The example provided illustrates a valid solution for the integers 1, 2, 3, and 4 to reach the target of 17. The consensus is that existing algorithms for this problem are limited, with brute-force approaches being the most viable, albeit inefficient due to potential state-explosion. The discussion concludes that no scientifically robust algorithms exist for this problem beyond brute force.

PREREQUISITES
  • Understanding of basic number theory concepts
  • Familiarity with algorithm design and complexity analysis
  • Knowledge of brute-force search techniques
  • Experience with mathematical operations: addition, subtraction, multiplication, division
NEXT STEPS
  • Research advanced pruning techniques in brute-force algorithms
  • Explore combinatorial optimization methods for integer problems
  • Learn about state-space search algorithms
  • Investigate existing number theory algorithms for integer solutions
USEFUL FOR

This discussion is beneficial for algorithm developers, computer scientists, and mathematicians interested in number theory and optimization problems involving integer calculations.

seezeey
Messages
1
Reaction score
0
Hello everyone!

I am trying to construct an algorithm for the following problem and was wondering if there is any existing body of knowledge on this. Please forgive me if this is inappropriate (or ridiculous) but I am totally foreign to number theory.

It goes like this:
You are given n integers and allowed to use four basic operations. You are also given another integer as the target. You are required to find the target using the given numbers.
The only rule is that you can use each number (given or derived) only once.

Is there an efficient algorithm to check if there exists a solution to any given instance of this problem?

For example:

given numbers: 1 2 3 4
target: 17

a valid solution would be (4 + 1) * 3 + 2 = 17
an invalid solution would be (4 + 4) * 2 + 1 = 17, since 4 is used twice.

My solution is practically a brute-force approach with pruning and it is subject to state-explosion.

Thanks in advance...

--seezeey
 
Physics news on Phys.org
You have a certain alphabet, n integers combined with at least one of four possible operation symbols. Then you have an evaluation function: the calculation of the expression. Thus we have a finite number of allowed words with a finite set of evaluation values. These can all be listed and then decided, whether a given number is among them.

As such an algorithm is completely useless from a scientific point of view, there probably won't be any approaches other than brute force.
 

Similar threads

  • · Replies 33 ·
2
Replies
33
Views
5K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K