Solving for variable in quotient of ceil function

125 Views Asked by At

Given $k=\lceil\frac m {n}\rceil$, I would like to solve for $m$ given $k$ and $n$ as positive integers. How do I solve for $m$, and is there a single solution for $m$?

Perhaps one way to do this might be to split $n$ up into cases depending on whether it is even or odd? However, I've noticed that this does not always work, and I think there might be a nicer way to do this.

1

There are 1 best solutions below

7
On BEST ANSWER

The number $m$ can be any of $nk-1, nk-2,nk+2,\dots, nk-(n-1)$.

For suppose that $m=(k-1)n+r$, where $r$ is the remainder, that is, $0\le r\le n-1$. Since $(k-1)n+r=kn-(n-r)$,
$$\frac{m}{n}=k-\frac{n-r}{n}.$$ We have $$\left\lceil k-\frac{n-r}{n}\right\rceil =k.$$