Finding integer solutions logically

  • Context: High School 
  • Thread starter Thread starter Georgepowell
  • Start date Start date
  • Tags Tags
    Integer
Click For Summary

Discussion Overview

The discussion revolves around finding integer solutions for the equation AB - A - B = 1673, with a focus on logical methods to derive these solutions without excessive guessing. Participants explore various mathematical approaches, including factoring and integer programming, while questioning the nature of trial and error in algorithms.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant seeks a logical method to find integer values for A and B in the equation AB - A - B = 1673, expressing a desire to avoid guessing.
  • Another suggests factoring the left-hand side of the equation, leading to the expression (A-1)(B-1) = 1674, which simplifies the search for integer solutions.
  • Some participants discuss the practicality of searching for factors of 1674, noting that while it is a logical approach, it still involves some level of searching.
  • There is a suggestion that integer programming is a complex area of mathematics, and that finding integer solutions can be inherently difficult.
  • Participants explore the concept of "purely logical" methods, with one proposing to find the prime factorization of 1674 and construct factors from it.
  • There is a debate about whether certain factorization algorithms can be classified as trial and error, with differing opinions on the definitions of trial and error in the context of algorithmic processes.
  • Some participants express uncertainty about the nature of trial and error in relation to various factorization methods, questioning the implications of algorithmic outputs that may not yield definitive results.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the existence of a purely logical method for finding integer solutions without any guessing. There are multiple competing views on the nature of trial and error in mathematical algorithms and the difficulty of finding integer solutions.

Contextual Notes

Participants highlight the complexity of integer programming and factorization, noting that the difficulty of finding solutions may depend on the specific methods employed and the nature of the inputs.

Georgepowell
Messages
179
Reaction score
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
Try to write the LHS in a factored form.
 
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.
 
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 :(
 
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.
 
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.
 
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.
 
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?
 
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.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 20 ·
Replies
20
Views
4K
Replies
7
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 1 ·
Replies
1
Views
30K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 2 ·
Replies
2
Views
11K
  • · Replies 10 ·
Replies
10
Views
2K