4

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?

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

2 Answers2

4

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.

Nasser
  • 143,286
  • 11
  • 154
  • 359
2
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] *)

Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198