# Solving inequalities involving floor function

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?

• 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 1:16

How to fix it?

It looks like you need to tell it extra conditions

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


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


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

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] *)
`