1
$\begingroup$

Do you think FindInstance should have found this solution?

ClearAll[n, d, m, a];
n = 90; d = 3;
eq = n/d^m == a;
FindInstance[ eq, {m, a}, PositiveIntegers]

V 14 gives

Solve::nsmet: This system cannot be solved with the methods available to Solve. Try Reduce or FindInstance instead.

But we see that there is obvious solution:

eq /. {m -> 2, a -> 10}

(*True *)

I know I can find m,a in other ways, but wanted to know if there is a problem here and that FindInstance should have been able to find the solution. Btw, Reduce and Solve also can't find this solution.

$\endgroup$
7
  • 1
    $\begingroup$ Include constraints, e.g., FindInstance[{eq, 0 < m < 100, 0 < a < 100}, {m, a}, PositiveIntegers, 5] $\endgroup$
    – Bob Hanlon
    Commented Mar 17 at 20:33
  • 2
    $\begingroup$ Order matters, I guess: FindInstance[eq, {a, m}, PositiveIntegers] $\endgroup$
    – Goofy
    Commented Mar 17 at 20:37
  • $\begingroup$ @Goofy wow. This makes no sense at all! But good find. Do you think this is a bug then? You can post this as answer if you want. $\endgroup$
    – Nasser
    Commented Mar 17 at 20:42
  • $\begingroup$ @BobHanlon thanks, Yes constraints helps. But I think in this case it should not needed it? $\endgroup$
    – Nasser
    Commented Mar 17 at 20:43
  • $\begingroup$ Constraints are often useful and also work with Solve or Reduce for this problem. $\endgroup$
    – Bob Hanlon
    Commented Mar 17 at 21:23

1 Answer 1

2
$\begingroup$

We only have to constraint the range of parameter a

FindInstance[eq && a <= 50, {m, a}, PositiveIntegers, 5 ]
(*{{m -> 1, a -> 30}, {m -> 2, a -> 10}}*)
$\endgroup$

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.