Let $n$ be a positive integer. In order to find the integer closest to $\sqrt n$, Mary finds $a^2$, the closest perfect square to $n$. She thinks that a is then the number she is looking for. Is she always correct?
Problem
Source:
Tags: inequalities
osmosis92
02.09.2011 23:18
Yes. Suppose that $a^2\leq n<(a+1)^2$.
Case 1: $n$ is closer to $(a+1)^2$. Then $(a+1)^2-n<n-a^2\Longrightarrow 2a^2+2a+1<2n$. Multiplying by 2, we get $4a^2+4a+2<4n$, which means $4a^2+4a+1<4n$. Square root both (positive) sides to get $2a+1<2\sqrt{n}\Longrightarrow a+1-\sqrt{n}<\sqrt{n}-a$, or that $\sqrt{n}$ is closer to $a+1$.
Case 2: $n$ is closer to $a^2$. Then $(a+1)^2-n>n-a^2\Longrightarrow 2a^2+2a+1>2n$. Multiply by 2 to get $4a^2+4a+2>4n$. But $4n\neq 4a^2+4a+1$ by modulo 4, so we must have $4a^2+4a+1>4n$. Take square root to get $2a+1>2\sqrt{n}\Longrightarrow a+1-\sqrt{n}>\sqrt{n}-a$, or that $\sqrt{n}$ is closer to $a$. QED
Note: we only consider strict inequality in the cases because $n$ cannot be the average of $a^2,(a+1)^2$, which is not an integer.