Skip to main content
added 2 characters in body
Source Link
user64494
  • 29.1k
  • 4
  • 29
  • 56

Since the feasible discrete set RealAbs[Sqrt[2] - x / y] < 0.0001 is infinite, this is a hard task for NMaximize. It can be done as follows. First, we find the maximum for x >= 1000 && y >= 1000 by

NMaximize[{Log[1/y, RealAbs[Sqrt[2] - x/y]], 
Element[{x, y}, Integers] && x >= 1000 && y >= 1000 && 
RealAbs[Sqrt[2] - x/y] < 0.0001}, {x, y},Method->{"DifferentialEvolution", "ScalingFactor" ->3}]

which produces {1.51158, {x -> 1649, y -> 1166}} and a warning

NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.0001+RealAbs[Sqrt[2]-Round[x]/Round[<<1>>]]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution.

The above result is a feasible solution in view of

N[RealAbs[Sqrt[2] - x/y] /. { x -> 1649, y -> 1166}]

0.0000231443

Second, in order to be sure, we apply the known lower estimate for RealAbs[Sqrt[2] - x/y] (see the "Liouville numbers and transcendence" section in that Wiki article for info) $$\exists A>0\, \forall\{x,y\}\in\mathbb{N} \left| \sqrt{2}-\frac{x}{y}\right|> \frac A {y^2} $$. According to Lemma from this section, we may take $A=\frac 1 {5}$ ($M=5$). This inequality implies the inequality ForAll[{x,y},{x,y} \[Element] PositiveIntegers && y>1, Log[1/y, RealAbs[Sqrt[2] - x/y]] < Log[1/y, 1/5] + 2]. It is clear the maximum of Log[1/y, 1/5] + 2] for all integers y >=1000 is attained at y==1000 and is equal to N[Log[1/1000, 1/5]]==0.23299.

Third, now we apply counting for x>=1&&x<=999&&y>=2&&y<=999

Do[If[RealAbs[Sqrt[2] - x/y] < 0.0001, Print[{x, y, N[Log[1/y, RealAbs[Sqrt[2] - x/y]]]}]],
 {x, 1, 99999}, {y, 2, 99999}]

{99,70,2.24473} {140,99,2.07542}... {997, 705, 1.59229}

Summarizing the above, we draw the conclusion that the maximum under consideration is equal to 2.224473 at {x==99,y==70}.

Edit. 1000 in the above instead of 100 and constant $A= \frac 1 5$ instead of $A=\frac 1 3$.

Since the feasible discrete set RealAbs[Sqrt[2] - x / y] < 0.0001 is infinite, this is a hard task for NMaximize. It can be done as follows. First, we find the maximum for x >= 1000 && y >= 1000 by

NMaximize[{Log[1/y, RealAbs[Sqrt[2] - x/y]], 
Element[{x, y}, Integers] && x >= 1000 && y >= 1000 && 
RealAbs[Sqrt[2] - x/y] < 0.0001}, {x, y},Method->{"DifferentialEvolution", "ScalingFactor" ->3}]

which produces {1.51158, {x -> 1649, y -> 1166}} and a warning

NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.0001+RealAbs[Sqrt[2]-Round[x]/Round[<<1>>]]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution.

The above result is a feasible solution in view of

N[RealAbs[Sqrt[2] - x/y] /. { x -> 1649, y -> 1166}]

0.0000231443

Second, in order to be sure, we apply the known lower estimate for RealAbs[Sqrt[2] - x/y] (see the "Liouville numbers and transcendence" section in that Wiki article for info) $$\exists A>0\, \forall\{x,y\}\in\mathbb{N} \left| \sqrt{2}-\frac{x}{y}\right|> \frac A {y^2} $$. According to Lemma from this section, we may take $A=\frac 1 {5}$ ($M=5$). This inequality implies the inequality ForAll[{x,y},{x,y} \[Element] PositiveIntegers && y>1, Log[1/y, RealAbs[Sqrt[2] - x/y]] < Log[1/y, 1/5] + 2]. It is clear the maximum of Log[1/y, 1/5] + 2] for all integers y >=1000 is attained at y==1000 and is equal to N[Log[1/1000, 1/5]]==0.23299.

Third, now we apply counting for x>=1&&x<=999&&y>=2&&y<=999

Do[If[RealAbs[Sqrt[2] - x/y] < 0.0001, Print[{x, y, N[Log[1/y, RealAbs[Sqrt[2] - x/y]]]}]],
 {x, 1, 99}, {y, 2, 99}]

{99,70,2.24473} {140,99,2.07542}... {997, 705, 1.59229}

Summarizing the above, we draw the conclusion that the maximum under consideration is equal to 2.224473 at {x==99,y==70}.

Edit. 1000 in the above instead of 100 and constant $A= \frac 1 5$ instead of $A=\frac 1 3$.

Since the feasible discrete set RealAbs[Sqrt[2] - x / y] < 0.0001 is infinite, this is a hard task for NMaximize. It can be done as follows. First, we find the maximum for x >= 1000 && y >= 1000 by

NMaximize[{Log[1/y, RealAbs[Sqrt[2] - x/y]], 
Element[{x, y}, Integers] && x >= 1000 && y >= 1000 && 
RealAbs[Sqrt[2] - x/y] < 0.0001}, {x, y},Method->{"DifferentialEvolution", "ScalingFactor" ->3}]

which produces {1.51158, {x -> 1649, y -> 1166}} and a warning

NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.0001+RealAbs[Sqrt[2]-Round[x]/Round[<<1>>]]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution.

The above result is a feasible solution in view of

N[RealAbs[Sqrt[2] - x/y] /. { x -> 1649, y -> 1166}]

0.0000231443

Second, in order to be sure, we apply the known lower estimate for RealAbs[Sqrt[2] - x/y] (see the "Liouville numbers and transcendence" section in that Wiki article for info) $$\exists A>0\, \forall\{x,y\}\in\mathbb{N} \left| \sqrt{2}-\frac{x}{y}\right|> \frac A {y^2} $$. According to Lemma from this section, we may take $A=\frac 1 {5}$ ($M=5$). This inequality implies the inequality ForAll[{x,y},{x,y} \[Element] PositiveIntegers && y>1, Log[1/y, RealAbs[Sqrt[2] - x/y]] < Log[1/y, 1/5] + 2]. It is clear the maximum of Log[1/y, 1/5] + 2] for all integers y >=1000 is attained at y==1000 and is equal to N[Log[1/1000, 1/5]]==0.23299.

Third, now we apply counting for x>=1&&x<=999&&y>=2&&y<=999

Do[If[RealAbs[Sqrt[2] - x/y] < 0.0001, Print[{x, y, N[Log[1/y, RealAbs[Sqrt[2] - x/y]]]}]],
 {x, 1, 999}, {y, 2, 999}]

{99,70,2.24473} {140,99,2.07542}... {997, 705, 1.59229}

Summarizing the above, we draw the conclusion that the maximum under consideration is equal to 2.224473 at {x==99,y==70}.

Edit. 1000 in the above instead of 100 and constant $A= \frac 1 5$ instead of $A=\frac 1 3$.

added 100 characters in body
Source Link
user64494
  • 29.1k
  • 4
  • 29
  • 56

Since the feasible discrete set RealAbs[Sqrt[2] - x / y] < 0.0001 is infinite, this is a hard task for NMaximize. It can be done as follows. First, we find the maximum for x >= 1001000 && y >= 1001000 by

NMaximize[{Log[1/y, RealAbs[Sqrt[2] - x/y]], 
Element[{x, y}, Integers] && x >= 1001000 && y >= 1001000 && 
RealAbs[Sqrt[2] - x/y] < 0.0001}, {x, y},Method->{"DifferentialEvolution", "ScalingFactor" ->3}]

which produces {1.4930951158, {x -> 150431649, y -> 106371166}} and a warning

NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.0001+RealAbs[Sqrt[2]-Round[x]/Round[<<1>>]]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution.

The above result is a feasible solution in view of

N[RealAbs[Sqrt[2] - x/y] /. { x -> 150431649, y -> 106371166}]

90.718*10^-70000231443

Second, in order to be sure, we apply the known lower estimate for RealAbs[Sqrt[2] - x/y] (see the "Liouville numbers and transcendence" section in that Wiki article for info) $$\exists A>0\, \forall\{x,y\}\in\mathbb{N} \left| \sqrt{2}-\frac{x}{y}\right|> \frac A {y^2} $$. According to Lemma from this section, we may take $A=\frac 1 {2.9}$$A=\frac 1 {5}$ ($M=2.9$$M=5$). This inequality implies the inequality ForAll[{x,y},{x,y} \[Element] PositiveIntegers && y>1, Log[1/y, RealAbs[Sqrt[2] - x/y]] < Log[1/y, 1/2.9]5] + 2]. It is clear the maximum of Log[1/y, 1/2.9]5] + 2] for all integers y >=100>=1000 is attained at y==100y==1000 and is equal to N[Log[1/1001000, 1/2.9]]==05]]==0.23119923299.

Third, now we apply counting for x>=1&&x<=99&&y>=2&&y<=99x>=1&&x<=999&&y>=2&&y<=999

Do[If[RealAbs[Sqrt[2] - x/y] < 0.0001, Print[{x, y, N[Log[1/y, RealAbs[Sqrt[2] - x/y]]]}]],
 {x, 1, 99}, {y, 2, 99}]

{99,70,2.24473} {140,99,2.07542}... {997, 705, 1.59229}

Summarizing the above, we draw the conclusion that the maximum under consideration is equal to 2.224473 at {x==99,y==70}.

Edit. 1000 in the above instead of 100 and constant $A= \frac 1 5$ instead of $A=\frac 1 3$.

Since the feasible discrete set RealAbs[Sqrt[2] - x / y] < 0.0001 is infinite, this is a hard task for NMaximize. It can be done as follows. First, we find the maximum for x >= 100 && y >= 100 by

NMaximize[{Log[1/y, RealAbs[Sqrt[2] - x/y]], 
Element[{x, y}, Integers] && x >= 100 && y >= 100 && 
RealAbs[Sqrt[2] - x/y] < 0.0001}, {x, y},Method->{"DifferentialEvolution", "ScalingFactor" ->3}]

which produces {1.49309, {x -> 15043, y -> 10637}} and a warning

NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.0001+RealAbs[Sqrt[2]-Round[x]/Round[<<1>>]]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution.

The above result is a feasible solution in view of

N[RealAbs[Sqrt[2] - x/y] /. {x -> 15043, y -> 10637}]

9.718*10^-7

Second, in order to be sure, we apply the known lower estimate for RealAbs[Sqrt[2] - x/y] (see the "Liouville numbers and transcendence" section in that Wiki article for info) $$\exists A>0\, \forall\{x,y\}\in\mathbb{N} \left| \sqrt{2}-\frac{x}{y}\right|> \frac A {y^2} $$. According to Lemma from this section, we may take $A=\frac 1 {2.9}$ ($M=2.9$). This inequality implies the inequality ForAll[{x,y},{x,y} \[Element] PositiveIntegers && y>1, Log[1/y, RealAbs[Sqrt[2] - x/y]] < Log[1/y, 1/2.9] + 2]. It is clear the maximum of Log[1/y, 1/2.9] + 2] for all integers y >=100 is attained at y==100 and is equal to N[Log[1/100, 1/2.9]]==0.231199.

Third, now we apply counting for x>=1&&x<=99&&y>=2&&y<=99

Do[If[RealAbs[Sqrt[2] - x/y] < 0.0001, Print[{x, y, N[Log[1/y, RealAbs[Sqrt[2] - x/y]]]}]],
 {x, 1, 99}, {y, 2, 99}]

{99,70,2.24473}

Summarizing the above, we draw the conclusion that the maximum under consideration is equal to 2.224473 at {x==99,y==70}.

Since the feasible discrete set RealAbs[Sqrt[2] - x / y] < 0.0001 is infinite, this is a hard task for NMaximize. It can be done as follows. First, we find the maximum for x >= 1000 && y >= 1000 by

NMaximize[{Log[1/y, RealAbs[Sqrt[2] - x/y]], 
Element[{x, y}, Integers] && x >= 1000 && y >= 1000 && 
RealAbs[Sqrt[2] - x/y] < 0.0001}, {x, y},Method->{"DifferentialEvolution", "ScalingFactor" ->3}]

which produces {1.51158, {x -> 1649, y -> 1166}} and a warning

NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.0001+RealAbs[Sqrt[2]-Round[x]/Round[<<1>>]]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution.

The above result is a feasible solution in view of

N[RealAbs[Sqrt[2] - x/y] /. { x -> 1649, y -> 1166}]

0.0000231443

Second, in order to be sure, we apply the known lower estimate for RealAbs[Sqrt[2] - x/y] (see the "Liouville numbers and transcendence" section in that Wiki article for info) $$\exists A>0\, \forall\{x,y\}\in\mathbb{N} \left| \sqrt{2}-\frac{x}{y}\right|> \frac A {y^2} $$. According to Lemma from this section, we may take $A=\frac 1 {5}$ ($M=5$). This inequality implies the inequality ForAll[{x,y},{x,y} \[Element] PositiveIntegers && y>1, Log[1/y, RealAbs[Sqrt[2] - x/y]] < Log[1/y, 1/5] + 2]. It is clear the maximum of Log[1/y, 1/5] + 2] for all integers y >=1000 is attained at y==1000 and is equal to N[Log[1/1000, 1/5]]==0.23299.

Third, now we apply counting for x>=1&&x<=999&&y>=2&&y<=999

Do[If[RealAbs[Sqrt[2] - x/y] < 0.0001, Print[{x, y, N[Log[1/y, RealAbs[Sqrt[2] - x/y]]]}]],
 {x, 1, 99}, {y, 2, 99}]

{99,70,2.24473} {140,99,2.07542}... {997, 705, 1.59229}

Summarizing the above, we draw the conclusion that the maximum under consideration is equal to 2.224473 at {x==99,y==70}.

Edit. 1000 in the above instead of 100 and constant $A= \frac 1 5$ instead of $A=\frac 1 3$.

deleted 65 characters in body
Source Link
user64494
  • 29.1k
  • 4
  • 29
  • 56

Since the feasible discrete set RealAbs[Sqrt[2] - x / y] < 0.0001 is infinite, this is a hard task for NMaximize. It can be done as follows. First, we find the maximum for x >= 100 && y >= 100 by

NMaximize[{Log[1/y, RealAbs[Sqrt[2] - x/y]], 
Element[{x, y}, Integers] && x >= 100 && y >= 100 && 
RealAbs[Sqrt[2] - x/y] < 0.0001}, {x, y},Method->{"DifferentialEvolution", "ScalingFactor" ->3}]

which produces {1.49309, {x -> 15043, y -> 10637}} and a warning

NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.0001+RealAbs[Sqrt[2]-Round[x]/Round[<<1>>]]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution.

The above result is a feasible solution in view of

N[RealAbs[Sqrt[2] - x/y] /. {x -> 15043, y -> 10637}]

9.718*10^-7

Second, in order to be sure, we apply the known lower estimate for RealAbs[Sqrt[2] - x/y] (see the "Liouville numbers and transcendence" section in that Wiki article for info) $$\exists A>0\, \forall\{x,y\}\in\mathbb{N} \left| \sqrt{2}-\frac{x}{y}\right|> \frac A {y^2} $$. According to Lemma from this section, we may take $A=\frac 1 3$$A=\frac 1 {2.9}$ ($M=2.9$). This inequality implies the inequality ForAll[{x,y},{x,y} \[Element] PositiveIntegers && y>1, Log[1/y, RealAbs[Sqrt[2] - x/y]] < Log[1/y, 1/3]2.9] + 2]. It is clear the maximum of Log[1/y, 1/3]2.9] + 2] for all integers y >=100 is attained at y==100 and is equal to N[Log[1/100, 1/3]]==02.2385619]]==0.231199.

Third, now we apply counting for x>=1&&x<=99&&y>=2&&y<=99

Do[If[RealAbs[Sqrt[2] - x/y] < 0.0001, Print[{x, y, N[Log[1/y, RealAbs[Sqrt[2] - x/y]]]}]],
 {x, 1, 99}, {y, 2, 99}]

{99,70,2.24473}

Summarizing the above, we draw the conclusion that the maximum under consideration is equal to 2.224473 at {x==99,y==70}.

Since the feasible discrete set RealAbs[Sqrt[2] - x / y] < 0.0001 is infinite, this is a hard task for NMaximize. It can be done as follows. First, we find the maximum for x >= 100 && y >= 100 by

NMaximize[{Log[1/y, RealAbs[Sqrt[2] - x/y]], 
Element[{x, y}, Integers] && x >= 100 && y >= 100 && 
RealAbs[Sqrt[2] - x/y] < 0.0001}, {x, y},Method->{"DifferentialEvolution", "ScalingFactor" ->3}]

which produces {1.49309, {x -> 15043, y -> 10637}} and a warning

NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.0001+RealAbs[Sqrt[2]-Round[x]/Round[<<1>>]]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution.

The above result is a feasible solution in view of

N[RealAbs[Sqrt[2] - x/y] /. {x -> 15043, y -> 10637}]

9.718*10^-7

Second, in order to be sure, we apply the known lower estimate for RealAbs[Sqrt[2] - x/y] (see the "Liouville numbers and transcendence" section in that Wiki article for info) $$\exists A>0\, \forall\{x,y\}\in\mathbb{N} \left| \sqrt{2}-\frac{x}{y}\right|> \frac A {y^2} $$. According to Lemma from this section, we may take $A=\frac 1 3$. This inequality implies the inequality ForAll[{x,y},{x,y} \[Element] PositiveIntegers && y>1, Log[1/y, RealAbs[Sqrt[2] - x/y]] < Log[1/y, 1/3] + 2]. It is clear the maximum of Log[1/y, 1/3] + 2] for all integers y >=100 is attained at y==100 and is equal to N[Log[1/100, 1/3]]==0.238561.

Third, now we apply counting for x>=1&&x<=99&&y>=2&&y<=99

Do[If[RealAbs[Sqrt[2] - x/y] < 0.0001, Print[{x, y, N[Log[1/y, RealAbs[Sqrt[2] - x/y]]]}]],
 {x, 1, 99}, {y, 2, 99}]

{99,70,2.24473}

Summarizing the above, we draw the conclusion that the maximum under consideration is equal to 2.224473 at {x==99,y==70}.

Since the feasible discrete set RealAbs[Sqrt[2] - x / y] < 0.0001 is infinite, this is a hard task for NMaximize. It can be done as follows. First, we find the maximum for x >= 100 && y >= 100 by

NMaximize[{Log[1/y, RealAbs[Sqrt[2] - x/y]], 
Element[{x, y}, Integers] && x >= 100 && y >= 100 && 
RealAbs[Sqrt[2] - x/y] < 0.0001}, {x, y},Method->{"DifferentialEvolution", "ScalingFactor" ->3}]

which produces {1.49309, {x -> 15043, y -> 10637}} and a warning

NMaximize::incst: NMaximize was unable to generate any initial points satisfying the inequality constraints {-0.0001+RealAbs[Sqrt[2]-Round[x]/Round[<<1>>]]<=0}. The initial region specified may not contain any feasible points. Changing the initial region or specifying explicit initial points may provide a better solution.

The above result is a feasible solution in view of

N[RealAbs[Sqrt[2] - x/y] /. {x -> 15043, y -> 10637}]

9.718*10^-7

Second, in order to be sure, we apply the known lower estimate for RealAbs[Sqrt[2] - x/y] (see the "Liouville numbers and transcendence" section in that Wiki article for info) $$\exists A>0\, \forall\{x,y\}\in\mathbb{N} \left| \sqrt{2}-\frac{x}{y}\right|> \frac A {y^2} $$. According to Lemma from this section, we may take $A=\frac 1 {2.9}$ ($M=2.9$). This inequality implies the inequality ForAll[{x,y},{x,y} \[Element] PositiveIntegers && y>1, Log[1/y, RealAbs[Sqrt[2] - x/y]] < Log[1/y, 1/2.9] + 2]. It is clear the maximum of Log[1/y, 1/2.9] + 2] for all integers y >=100 is attained at y==100 and is equal to N[Log[1/100, 1/2.9]]==0.231199.

Third, now we apply counting for x>=1&&x<=99&&y>=2&&y<=99

Do[If[RealAbs[Sqrt[2] - x/y] < 0.0001, Print[{x, y, N[Log[1/y, RealAbs[Sqrt[2] - x/y]]]}]],
 {x, 1, 99}, {y, 2, 99}]

{99,70,2.24473}

Summarizing the above, we draw the conclusion that the maximum under consideration is equal to 2.224473 at {x==99,y==70}.

deleted 65 characters in body
Source Link
user64494
  • 29.1k
  • 4
  • 29
  • 56
Loading
edited body
Source Link
user64494
  • 29.1k
  • 4
  • 29
  • 56
Loading
Source Link
user64494
  • 29.1k
  • 4
  • 29
  • 56
Loading