![]() |
|
|
#1 |
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
3·5·137 Posts |
Hi,
Not sure where would be the appropriate section for this. I figure it could be posted as a puzzle even though I don't know the answer. For non zero positive integers a, b, c, x, and y, find a general solution for x and y for the inequality: 0<|xa-by|<c where: c=|a-b| Notes: * There are values for a and b which there are no solutions for such as: a = 66 b = 55 yet for: a = 66 b = 57 66 - 57 = 9 13 x 66 - 57 x 15 = 3 < 9 i.e.: x = 13 and y = 15 Thank you. Last fiddled with by a1call on 2016-03-20 at 18:37 |
|
|
|
|
|
#2 | |
|
Undefined
"The unspeakable one"
Jun 2006
My evil lair
22×1,549 Posts |
Quote:
ETA: Nevermind, OP edited the original post stipulating an extra condition 0<|xa-by|<c. Last fiddled with by retina on 2016-03-20 at 18:42 Reason: Moving the goalposts |
|
|
|
|
|
|
#3 |
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
3×5×137 Posts |
|
|
|
|
|
|
#4 |
|
"Forget I exist"
Jul 2009
Dumbassville
26·131 Posts |
the reason 66 and 55 can't work in the scenario you propose is simply because the difference is the GCD. in fact all such solutions with |a-b| = gcd(a,b) are out. so basically as long as c is in not equal to their gcd you can solve bezout's identity for their gcd and use that solution.
Last fiddled with by science_man_88 on 2016-03-20 at 18:51 |
|
|
|
|
|
#5 | |
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
3·5·137 Posts |
Quote:
![]() But the puzzle is still unsolved. We still need a general solution for x and y. |
|
|
|
|
|
|
#6 |
|
"Forget I exist"
Jul 2009
Dumbassville
100000110000002 Posts |
I know I'm right as a=gcd(a,b)*(a/gcd(a,b)); and b=gcd(a,b)*(b/gcd(a,b)) so plugging these in as a and b gets you that for any x and y you always get a multiple of their gcd the lowest such positive multiple is the gcd itself. I still don't have the general solution you want if you actually want numbers.
|
|
|
|
|
|
#7 | |
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
40078 Posts |
Quote:
Thank you for introducing me to Bézout's identity. See if that can produce a solution to the inequality. |
|
|
|
|
|
|
#8 |
|
"Forget I exist"
Jul 2009
Dumbassville
26×131 Posts |
|
|
|
|
|
|
#9 | |
|
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
947710 Posts |
Quote:
Step 2: if d = |A-B| <= 1, then there is no solution, because there is no d :: 0<d<1. Otherwise, use Extended Euclidean algorithm |
|
|
|
|
|
|
#10 | |
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
3×5×137 Posts |
Quote:
Thank you for solving the puzzle. Didn't take that long. ![]() I will now have to read up on the Extended Euclidean algorithm. |
|
|
|
|