Finding integer solutions logically

  • Thread starter Georgepowell
  • Start date
  • Tags
    Integer
In summary: Would that make sense?In summary, to find values for A and B such that AB-A-B=1673, one can factor the expression on the left and search for two integers whose product is 1674. This can be done by searching for divisors of 1674 and setting them equal to A-1 and B-1, respectively. However, this method may involve some trial and error. Alternatively, more advanced algorithms such as Pollard's rho or Dixon's method can be used, but may also involve some trial and error and may not always result in finding integer solutions. A purely logical method without any trial and error may be difficult to find.
  • #1
Georgepowell
179
0
How would I find values for A and B such that

[tex]AB-A-B=1673[/tex]

Where A and B are integers?

I know the answer (28 and 63), but I want to know how to arrive at that answer without any guessing, or at least with a minimum amount of guessing.

Are there any other solutions? I just made this question up so there might be.

If it is not possible or just very very difficult then tell me.
 
Mathematics news on Phys.org
  • #2
Try to write the LHS in a factored form.
 
  • #3
I would factor the expression on the left, adding/subtracting constants as necessary. It's easier to solve as the product of two integers.


AB - A - B = 1673
A(B-1) - B = 1673
A(B-1) - B +1 = 1674
A(B-1) - (B-1) = 1674
(A-1)(B-1) = 1674

Then search for two integers whose product is 1674.

To find a solution, A-1=2 or A=3 is an obvious one. Even more obvious is A-1=1.

To find all solutions, you only need to search up to √1674 ≈ 41, so it shouldn't take too long.
 
  • #4
Redbelly98 said:
...
(A-1)(B-1) = 1674

Then search for two integers whose product is 1674
...

Good answer, that makes it a lot easier. It still involves 'searching' though.

Is there a way to do it without any searching? i.e. finding some equations and rearranging them to get A = 28, B = 63 (or any other answer).

Sorry if I am asking too much. but finding integer solutions is a wide area of maths and if there isn't a purely logical way of finding solutions then I have lost my faith in maths :(
 
  • #5
Georgepowell said:
Sorry if I am asking too much. but finding integer solutions is a wide area of maths and if there isn't a purely logical way of finding solutions then I have lost my faith in maths :(

Searching up to the square root is logical, just difficult (in some cases -- not so much here). Integer programming is one of the difficult areas of math, where linear programming (its real-number equivalent) is easy.

If you're saying that your faith in math is conditional on its ease, I hate to break it to you -- math can be hard.

Now in this particular case it's easy to see that solving the problem is essentially just factoring a number. There are asymptotically faster methods of factoring than trial division, fastest of wghich is the number field sieve. But if you're criticizing this method for being too hard, the NFS is certainly thr wrong way to go. It's very difficult to implement.
 
  • #6
Please note that I was only joking about 'loosing my faith' in maths. I know it is hard.

By 'purely logical' I meant a method that does not result in also finding non-integer solutions and ignoring them.
 
  • #7
Georgepowell said:
By 'purely logical' I meant a method that does not result in also finding non-integer solutions and ignoring them.

1. Find the prime factorization of 1674 (2 * 3^3 * 31).
2. Construct from #1 a list of factors dividing 1674. There are 16.
3. For each divisor d, let a = d + 1 and b = 1674/d + 1.
 
  • #8
CRGreathouse said:
1. Find the prime factorization of 1674 (2 * 3^3 * 31).

Am I right in saying that this would involve at least a little bit of trial and error/guessing/estimation?
 
  • #9
Georgepowell said:
Am I right in saying that this would involve at least a little bit of trial and error/guessing/estimation?

I'm not sure what you'd consider "trial and error/guessing/estimation". Why don't you look at some integer factorization algorithms and tell us? Pollard's rho, Dixon's method, the continued fraction method, S/G NFS, etc.
 
  • #10
CRGreathouse said:
I'm not sure what you'd consider "trial and error/guessing/estimation". Why don't you look at some integer factorization algorithms and tell us? Pollard's rho, Dixon's method, the continued fraction method, S/G NFS, etc.

1. Pollard's rho algorithm

quote from wikipedia:
Output: a non-trivial factor of n, or failure.

could result in failure. So trial and error.

2.Dixon's method

Another Wikipedia quote:
...many values of x are tested to see if p(x) factors completely over the factor base. If it does...

many values tested. So trial and error.

Do you see what I mean?

An example of what I mean is trying to find a real-number solution to x²+2x-8=0. You could use a simple trial and error method and factorise it to get (x-2)(x+4)=0 so x=2 or -4. Or you could complete the square and find the solution without any trial and error.

just a note: I tried to read the Wikipedia articles on the factorisation methods, but I didn't understand them much. So I just picked those quotes because I thought I could interpret them as 'trial and error'. I might be wrong.
 
Last edited:
  • #11
Georgepowell said:
Do you see what I mean?

No. I see that if an algorithm can output MAYBE or FAILURE or ERROR (or anything but FACTOR IS ___) that you'd consider it trial and error. But I don't understand which of the methods that don't include these other outputs you'd consider trial and error.

Edit: To put this anther way: I think the answer to your problem has more to do with your definition of trial and error than any real questions about factorization or Diophantine equations, so until I understand that definition well I won't be able to be much use.
 
  • #12
CRGreathouse said:
No. I see that if an algorithm can output MAYBE or FAILURE or ERROR (or anything but FACTOR IS ___) that you'd consider it trial and error. But I don't understand which of the methods that don't include these other outputs you'd consider trial and error.

Edit: To put this anther way: I think the answer to your problem has more to do with your definition of trial and error than any real questions about factorization or Diophantine equations, so until I understand that definition well I won't be able to be much use.

I don't understand the specifics of the algorithms you told me about, so I can't really comment on them. You can ignore anything I said about them in my last comment because they might not have made any sense. Sorry.

How about this as a definition:

If the algorithm can find the answer within a predefined number of calculations (that does not depend on the input), then it is not trial and error. If the length of the process does not have a limit with increasingly difficult inputs, then it IS trial and error.

E.G.

2a= b (where b is the input and a is the output)

The non-trial and error version would be to output a=b/2 (one calculation for any input)

The trial and error version would try every value for a up to b. So as the input increases in size, the amount of calculations increases.

With this definition, do the algorithms that you mentioned fit in the trial-and-error category?

Trial-and-error might not be the right word to use, but I couldn't think of another one. So sorry for any confusion from that.

Am I making any sense? :redface:

I guess you will want me to define 'a calculation' now
 
  • #13
The algorithm will at the very least have to consider the data by which the input is specified. Now, the size of the bitstring encoding a number will be given by the logarithm of the number (in base 2). Therefore the number of operation will have to grow at least logarithmically with the size of the numbers.
 
  • #14
Georgepowell said:
How about this as a definition:

If the algorithm can find the answer within a predefined number of calculations (that does not depend on the input), then it is not trial and error. If the length of the process does not have a limit with increasingly difficult inputs, then it IS trial and error.

That's a fine definition: constant arithmetic time complexity. That's a very limited class! It's inside L and I think NC^1.

Factorization is believed to be outside L (like most useful algorithms), so it seems likely that all factorization algorithms are "trial-and-error". Other algorithms you'd consider trial-and-error:
* Any sorting algorithm
* Any searching algorithm
* Any matrix multiplication algorithm
etc.
 
  • #15
CRGreathouse said:
That's a fine definition: constant arithmetic time complexity. That's a very limited class! It's inside L and I think NC^1.

Factorization is believed to be outside L (like most useful algorithms), so it seems likely that all factorization algorithms are "trial-and-error". Other algorithms you'd consider trial-and-error:
* Any sorting algorithm
* Any searching algorithm
* Any matrix multiplication algorithm
etc.

BRILLIANT! A solution to my problem :p. I was worried you would pick another hole in my question. I thought of that definition while lying in bed half asleep so I'm glad it does the job.
 
  • #16
So back to my original question.

Is there a way of finding integer solutions to equations like the one I mentioned without using any algorithms that are "outside L" whatever that means.
 
  • #17
Georgepowell said:
Is there a way of finding integer solutions to equations like the one I mentioned without using any algorithms that are "outside L" whatever that means.

No, because then you could factor that fast and we don't think it's possible to factor that fast.
 
  • #18
Another reason why there isn't a "trial and error" thing you can avoid is because you have more variables than equations.
 

FAQ: Finding integer solutions logically

How do you find integer solutions to a mathematical problem?

There are several strategies you can use to find integer solutions to a mathematical problem. One approach is to try different values for the unknown variables until you find a combination that satisfies all of the given conditions. Another method is to use algebraic manipulation, such as factoring and substitution, to simplify the problem and find integer solutions.

What is the difference between integer solutions and real solutions?

Integer solutions are whole numbers that satisfy a mathematical equation or inequality, while real solutions can be any number, including decimals and fractions. Integer solutions are a subset of real solutions, and they are often used in practical applications where only whole numbers make sense.

Can a mathematical problem have multiple integer solutions?

Yes, it is possible for a mathematical problem to have multiple integer solutions. In fact, some problems may have an infinite number of integer solutions, while others may have a finite number of solutions. It is important to carefully consider all possible solutions when solving a problem to ensure that no solutions are missed.

What is the role of logic in finding integer solutions?

Logic is crucial in finding integer solutions because it allows us to make deductions and draw conclusions based on the given information. By using logical reasoning, we can determine which values are possible solutions and eliminate those that do not fit the given conditions. This helps us narrow down our search and find integer solutions more efficiently.

Are there any shortcuts or tricks for finding integer solutions?

While there are no universal shortcuts or tricks for finding integer solutions, there are some strategies that can be helpful in certain situations. These include looking for patterns, using divisibility rules, and breaking down a problem into smaller, more manageable parts. It is also important to practice problem-solving and familiarize oneself with different types of problems to become more efficient at finding integer solutions.

Similar threads

Replies
4
Views
1K
Replies
8
Views
3K
Replies
2
Views
1K
Replies
1
Views
1K
Replies
6
Views
2K
Replies
1
Views
2K
Back
Top