2
$\begingroup$

! tried to solve $ \frac{999999}{1000000}<a+\sqrt{2} b\land a+\sqrt{2} b<1$ over the integers through

Reduce[999999/1000000 < a + Sqrt[2]* b && a + Sqrt[2]*b < 1, {a,b}, Integers]
*(a|b)∈ Integers&&(999999 - 1000000 a)/(1000000 Sqrt[2])<b<(1 - a)/Sqrt[2]*

, but the answer is not constructive. The FindInstance command instantly fails. The command

NMaximize[{1,999999/1000000 < a + Sqrt[2]* b && a + Sqrt[2]* b < 1 && {a,b}∈ Integers}, {a, b}]

is running without any response for hours. The solutions exist in view of

999999/1000009 < a + Sqrt[2]*b&&a + Sqrt[2]*b < 1 /.{a-> -12345606202, b->8729661864}
*True*
$\endgroup$
7
  • $\begingroup$ There are infinitely many such pairs and you will not describe constructively solutions unless you suplement conditions on solutions. This is a nice example what Reduce can do. $\endgroup$
    – Artes
    Commented Feb 5, 2020 at 20:08
  • $\begingroup$ @Artes: Can you ground your statementss? TIA. $\endgroup$
    – user64494
    Commented Feb 5, 2020 at 20:10
  • $\begingroup$ I find it is obvious nevertheless one has to work out a satisfactory answer in a way comprehensible for others. . $\endgroup$
    – Artes
    Commented Feb 5, 2020 at 20:13
  • $\begingroup$ @Artes: Thank you for your personal opinions. I prefer arguments. Thank you anyway. $\endgroup$
    – user64494
    Commented Feb 5, 2020 at 20:15
  • $\begingroup$ @Artes: Can you kindly present a solution of the system under consideration which differs from {a-> -12345606202, b->8729661864}? TIA. $\endgroup$
    – user64494
    Commented Feb 5, 2020 at 20:39

1 Answer 1

2
$\begingroup$

We can find solutions to this using rational approximations for the Sqrt[2]. For example, using

s40 = Last[Convergents[Sqrt[2], 40]]
(* 1023286908188737/723573111879672 *)

s41 = Last[Convergents[Sqrt[2], 41]]
(* 2470433131948081/1746860020068409 *)

we get two accurate approximations, one either side of Sqrt[2]

s40 > Sqrt[2] > s41
(* True *)

Given the exact inequality

ineqexact = 
  999999/1000000 < a + Sqrt[2]*b && a + Sqrt[2]*b < 1;

We can define 4 inequalities such that any solution will be a solution of the exact inequality

ineqapprox = (ineqexact /. Sqrt[2] -> s40) && (ineqexact /. Sqrt[2] -> s41);

We can find a solution

instance = FindInstance[ineqapprox, {a, b}, Integers]
(* {{a -> -2103168819944748, b -> 1487164934563041}} *)

and verify it

ineqexact /. instance
(* {True} *)

I presume that using progressively more accurate approximations one could find many more.

$\endgroup$
3
  • $\begingroup$ Thank you. I accept your answer. It should be noticed that FindInstance[ineqapprox, {a, b}, Integers, 3] performs SystemException[MemoryAllocationFailure] on my comp. $\endgroup$
    – user64494
    Commented Feb 5, 2020 at 21:33
  • $\begingroup$ @user64494 MemoryAllocationFailure sounds like you've run out of memory. Perhaps you can monitor memory usage? $\endgroup$
    – mikado
    Commented Feb 5, 2020 at 21:58
  • $\begingroup$ No, the RAM of my comp does not exhaust. $\endgroup$
    – user64494
    Commented Feb 6, 2020 at 6:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.