How to solve equations involving floor function

58 Views Asked by At

I am trying to solve the following problem:

$x = \lfloor a * y\rfloor$

where $x$ and $y$ are variables and $a$ is a constant.

What is the feasible space of $y$?

1

There are 1 best solutions below

1
On

I'm not sure if this is what you are looking for but you can rewrite your equation as saying that $x$ is the unique integer such that $$ ay \leq x < ay + 1 $$ so in turn, if $a$ is positive, $$ \frac{x}{a} \geq y > \frac{x-1}{a} $$ and if $a$ is negative, $$ \frac{x}{a} \leq y < \frac{x-1}{a} $$ which may be what you're looking for.

Note: if $a = 0$ then $x = 0$ so I'm assuming $a \ne 0$.