Show that $\left\lceil x-\frac{1}{2} \right\rceil$ is the closest integer to the number $x$, except when $x$ is midway between two integers $n$ and $n+1$, when it is the smaller of these two integers.
We want to prove 2 cases here:
- When $x$ is midway between the two integers, $\left\lceil x-\frac{1}{2} \right\rceil$ is equal to the smaller of the two integers.
- When $x$ is not midway between the two integers, $\left\lceil x-\frac{1}{2} \right\rceil$ is equal to the closest integer to the number $x$.
If we let $x$ be midway between the two integers $n$ and $n+1$, then
$$x = n + \frac{(n+1)-n}{2} = n+ \frac{1}{2}$$
Now, substitute back in $x$ in $\left\lceil x-\frac{1}{2} \right\rceil$,
$$\left\lceil n+ \frac{1}{2} - \frac{1}{2}\right\rceil = \left\lfloor n \right\rfloor$$
The problem is why the ceiling function was changed to the floor function?
Because $n$ is an integer, $\lfloor n\rfloor= \lceil n \rceil = n.$