3
$\begingroup$

Why mathematica doesn’t solve this simple inequality ?

Reduce[Floor[x/2]<10,x,Integers]

It returns the error:Reduce::nsmet

Is it related to floor function?How to fix it?

$\endgroup$
1
  • $\begingroup$ The following gives some hint how Reduce approaches the problem: Reduce[Floor[x/2] < 10 && x > -200, x, Integers] $\endgroup$ – Michael E2 Jul 11 '20 at 1:16
3
$\begingroup$

How to fix it?

It looks like you need to tell it extra conditions

 Reduce[{Floor[x/2] < 10, x > 0}, x, Integers]

enter image description here

 Reduce[{Floor[x/2] < 10, x < 0}, x, Integers]

enter image description here

I do not know why Reduce did not generate these conditions automatically here.

$\endgroup$
1
$\begingroup$
Clear["Global`*"];

It will handle the cases when you indicate whether n is odd or even.

For n odd,

Reduce[Floor[n/2] < 10 && Mod[n, 2] == 1, n, Integers]

(* C[1] ∈ Integers && C[1] <= 9 && n == 1 + 2 C[1] *)

For n even

Reduce[Floor[n/2] < 10 && Mod[n, 2] == 0, n, Integers]

(* C[1] ∈ Integers && C[1] <= 9 && n == 2 C[1] *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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