Finding integer numbers using basic operations

In summary, the conversation is about constructing an algorithm for a number theory problem, specifically finding a target using a given set of numbers and four basic operations. The person asking the question is unsure if there are existing solutions and mentions their own solution which is a brute-force approach. They are looking for more efficient algorithms for this problem.
  • #1
seezeey
1
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
  • #2
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.
 

What are the basic operations used to find integer numbers?

The basic operations used to find integer numbers are addition, subtraction, multiplication, and division. These operations can be used in different combinations to find the desired integer number.

How do I determine if a number is an integer?

A number is considered an integer if it is a whole number with no decimal or fraction. This means that it can be divided evenly by 1 and itself. You can also determine if a number is an integer by checking if it has a remainder of 0 when divided by 1.

Can negative numbers be considered integers?

Yes, negative numbers can be considered integers. Integers include all whole numbers, including negative numbers. For example, -5, -2, 0, 3, 7 are all integers.

What are some common strategies for finding integer numbers using basic operations?

One common strategy is to use addition and subtraction to work backwards from a given number to find the desired integer. Another strategy is to use multiplication and division to find factors of a given number that can be used to create the desired integer.

Are there any shortcuts or tricks for finding integer numbers using basic operations?

Yes, there are some shortcuts and tricks that can be used to find integer numbers using basic operations. For example, the sum of two odd numbers is always an even number, and the sum of two even numbers is always an even number. Also, when multiplying two numbers with the same sign (both positive or both negative), the result will always be a positive number.

Similar threads

  • Linear and Abstract Algebra
Replies
13
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Linear and Abstract Algebra
Replies
11
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Linear and Abstract Algebra
Replies
1
Views
749
Replies
3
Views
254
  • Linear and Abstract Algebra
Replies
1
Views
916
  • Set Theory, Logic, Probability, Statistics
Replies
12
Views
964
  • Precalculus Mathematics Homework Help
Replies
7
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
2K
Back
Top