# Elementary Number Theory and Its Application, 6th Edition by Kenneth H. Rosen Exercises 1.1.17

17. Show that $[x + 1/2]$ is the integer nearest to $x$ (when there are two integers equidistant from $x$,it is the larger of the two).
Solution: We will make an assumption to prove our statement.
Let us assume that
$x=[x]+r$
Where $0<=r<1$
Now,
$x+\frac{1}{2}=[x]+r+\frac{1}{2}$
We condition r on the following cases.
Case 1 :
If $r<\frac{1}{2}$
Then,
$[x]<=x+$
$=[x]+r+\frac{1}{2}$
$<[x]+1$
This implies that $[x]$ is an integer nearest to $x$ and
$[x+\frac{1}{2}]=[x]$
Case2:
If $r>=\frac{1}{2}$
Then,
$[x]+1<=x+r+\frac{1}{2}$
$<[x]+2$
This implies that $[x]+1$ is the integer nearest to $x$ (assuming $x$ is midway between $[x]$ and $[x+1]$) and
$[x+\frac{1}{2}]=[x]+1$
Hence, we have proved that $[x+\frac{1}{2}]$ is the integer nearest to $x$.