By expanding the left, I found that $\lfloor\frac{(n+1)^2}2\rfloor$ = $\lfloor\frac{n^2}2 + n + \frac{1}2\rfloor$. I am not sure how to relate $\lfloor n + \frac{1}2 \rfloor$ to n so as to show that the right is true/false. Any ideas?
-
4Try letting $n=1$ – user84413 Sep 09 '17 at 23:12
-
3Assuming that $n$ is a natural number, you can separate out the $n$ from your expression giving $\lfloor\frac{(n+1)^2}{2}\rfloor = \lfloor\frac{n^2}{2}+\frac{1}{2}\rfloor + n$, so the question is when is $\lfloor\frac{n^2}{2}+\frac{1}{2}\rfloor = \lfloor\frac{n^2}{2}\rfloor$. The answer: this is true only for even $n$ and not true for any odd $n$. – JMoravitz Sep 09 '17 at 23:33
-
@TobyMak I sure didn't. $\frac{(n+1)^2}{2}=\frac{n^2+2n+1}{2}=\frac{n^2}{2}+\frac{2n}{2}+\frac{1}{2}=\frac{n^2}{2}+\frac{1}{2}+n$. Now, I just moved the $n$ outside of the floor function, recognizing that $\lfloor a+b\rfloor = a+\lfloor b\rfloor$ whenever $a$ is an integer and $b$ is any real number. – JMoravitz Sep 10 '17 at 00:10
1 Answers
We can start looking at what would happen if you actually have some values for $n$ for the left hand side when you expand it: $$\lfloor \frac{n^2}{2} + n + \frac{1}{2} \rfloor$$
We can clearly see that IF $n$ is an even number, then $\frac{n^2}{2} + n$ is an even number (won't show the proofs for even and odd number properties here); in that case the $\frac{1}{2}$ at the end won't do anything, the floor function will essentially delete it.
This means we're just left with $\lfloor \frac{n^2}{2} + n \rfloor$. Which is the same as $\lfloor\frac{n^2}{2}\rfloor + n$, because a floor function on an even number does nothing. We can just put floors all over the place but we'll leave it like that just to make it the same as in the question.
Now let's try and see what happens IF $n$ is an odd number; then the fraction $\frac{n^2}{2}$ will always have a rest of $\frac{1}{2}$ (i.e. an odd number divided by two will always have that rest). If we were to put the $+\frac{1}{2}$ fraction outside of the floor, it would just become a $+1$ (because this fraction will always bump $\frac{n^2}{2}$ up to the next integer), similarly the floor function will do nothing to the final term $n$ (because it is an integer and floor functions do nothing to those). This means we can rewrite the expanded equation as $\lfloor\frac{n^2}{2} \rfloor + n + 1$ (if $n$ is odd). As before, on this final equation, we can just put extra floor functions on there however we want to, but as before let's leave it like that for simplicity.
Now, let's compile the information:
\begin{cases} \lfloor \frac{(n+1)^2}{2} \rfloor = \lfloor\ \frac{n^2}{2} \rfloor + n& \text{ if } n = even\\ \lfloor \frac{(n+1)^2}{2} \rfloor = \lfloor\frac{n^2}{2} \rfloor + n + 1 & \text{ if } n= odd \end{cases} $$$$ So only when $n = even$ are they the same, else it's always one off.
- 698