1
$\begingroup$

I don't understand why the following Minimize code is returning unevaluated. I believe I have it coded properly and the expected minimum is $x=14$ and $y=1$.

 Minimize[{1 + x == 15 y, x >= 14 y}, {x, y}, PositiveIntegers]
 (* Minimize[{1 + x == 15 y, x >= 14 y}, {x, y}, PositiveIntegers] *)

Can Minimize not solve this problem?

$\endgroup$
5
  • $\begingroup$ What does this give you: Minimize[{1 + x = 15 y, x >= 14 y}, {x, y}, PositiveIntegers] ?? $\endgroup$
    – Syed
    Jun 2, 2023 at 10:59
  • $\begingroup$ @Syed That syntax returns a "Tag 1+x is protected" message but does return the minimum. The double equal sign however is the standard syntax for an equation and I would prefer adhering to strict syntax and not encountering unnecessary messages or errors with my code. Thanks though. $\endgroup$
    – josh
    Jun 2, 2023 at 11:44
  • 1
    $\begingroup$ What are you trying to minimize? You only supply two conditions, but no function that shall be minimized. Solve[{1 + x == 15 y, x >= 14 y}, {x, y}, PositiveIntegers] works fine. $\endgroup$
    – Roman
    Jun 2, 2023 at 11:50
  • $\begingroup$ @Roman: In the case above, there are other values which satisfy the relations such as $(29,2)$, $(46,3)$ and so on. I am looking for the smallest. This concerns a larger problem of $x+a==ny$ with a set of inequalities $x+a_j>=iy$ with $a,b,a_j,n$ all positive integers. Above is only a simple example and I have some concern or skepticism Solve would not always give me the smallest. $\endgroup$
    – josh
    Jun 2, 2023 at 12:06
  • $\begingroup$ The "smallest" by what metric? For example, is (29, 2) "smaller than", "bigger than", or "equal to" (28,3) under the ranking you have in mind? $\endgroup$ Jun 2, 2023 at 20:15

1 Answer 1

7
$\begingroup$

You need to specify what you mean by "smallest solution". If it means that you want the smallest value of $x+y$, then you can do

Minimize[{x + y, 1 + x == 15 y && x >= 14 y}, {x, y}, PositiveIntegers]
(*    {15, {x -> 14, y -> 1}}    *)

You can define other quantities to be minimized; but you cannot skip defining what you mean by "smallest".

$\endgroup$
0

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