Floor-Ceil Properties

224 Views Asked by At

If $n$ and $k$ are integers, with $k$ different from zero:

$$\left\lceil{\frac{n+1}{k}}\right\rceil = \left\lfloor{\frac{n}{k}}\right\rfloor + 1$$

How can I prove this property? I would appreciate it if somebody can help me.

5

There are 5 best solutions below

0
On

Here is a hint. Use

$$\left\lceil{x}\right\rceil = \left\lfloor{x}\right\rfloor + 1, x \notin Z$$

$$\left\lceil{x}\right\rceil = \left\lfloor{x}\right\rfloor, x \in Z$$

$$-\left\lceil{x}\right\rceil = \left\lfloor{-x}\right\rfloor$$

and divide up your possible values of $n,k$ into cases where $(n+1)/k$ is an integer, and when it isn't.

0
On

Let $m=\left\lfloor\frac{n}k\right\rfloor$; then $$m\le\frac{n}k<m+1\;,$$ so

$$m+\frac1k\le\frac{n}k+\frac1k<m+1+\frac1k\;,$$

i.e.,

$$m+\frac1k\le\frac{n+1}k<(m+1)+\frac1k\;.\tag{1}$$

The first inequality in $(1)$ shows that $m<\left\lceil\frac{n+1}k\right\rceil$ and hence that $m+1\le\left\lceil\frac{n+1}k\right\rceil$; to complete the proof, we need to show that $\left\lceil\frac{n+1}k\right\rceil\le m+1$.

The trick is to notice that $n<(m+1)k=mk+k$, so

$$n+1<mk+k+1\le mk+2k=(m+2)k\;,$$

and hence

$$\frac{n+1}k<m+2\;.$$

Can you finish it from there?

0
On

Hint:

you can pull integers in\out so $$\lceil \frac n k + \frac 1 k \rceil=\lfloor \frac n k + 1 \rfloor$$

0
On

By the division algorithm, there exists an integer $q$ (the quotient) and an integer $0 \leq r < k$ (the remainder) such that $$n = qk+r$$

Therefore $$\left\lceil{\frac{qk+r+1}{k}}\right\rceil = \left\lfloor{\frac{qk+r}{k}}\right\rfloor + 1$$ $$\left\lceil{q+\frac{r+1}{k}}\right\rceil = \left\lfloor{q+\frac{r}{k}}\right\rfloor + 1$$ Since $q$ is an integer $$q+\left\lceil{\frac{r+1}{k}}\right\rceil = q+\left\lfloor{\frac{r}{k}}\right\rfloor + 1$$ Since the $\frac{r}{k}$ is less than 1, $\left\lfloor{\frac{r}{k}}\right\rfloor$ becomes $0$. And since $r + 1 \leq k$, $\left\lceil{\frac{r+1}{k}}\right\rceil$ becomes 1.

Note this argument does not address the case of $k < 0$.

1
On

Say $k$ and $n$ are integers: $n$ can be written as $n = \lfloor \frac{n}{k} \rfloor k+r$, with residue $r\in [0,\dots,k-1] $. So $\frac{n+1}{k} = \lfloor \frac{n}{k} \rfloor +\frac{r+1}{k}$, the rest should follow.