# Math Help - Integer part

1. ## Integer part

Hi everyone.

Show that $\forall{x\in{\mathbb{Z^+}\cup{0}}}$ then $[\frac{n}{2}]+[-\frac{n}{2}]=n$

Thanks so much.

2. ## Re: Integer part

You mean $\forall n\in\mathbb Z^+\cup\{0\},$ $\left\lfloor\frac n2\right\rfloor+\left|\left\lfloor-\frac n2\right\rfloor\right|=n?$

If $n$ is even, say $n=2k,$ $\left\lfloor\frac n2\right\rfloor+\left|\left\lfloor-\frac n2\right\rfloor\right|=k+\left|-k\right|=2k=n.$

If $n$ is odd, say $n=2k+1,$ $\left\lfloor\frac n2\right\rfloor+\left|\left\lfloor-\frac n2\right\rfloor\right|=\lfloor k+\tfrac12\rfloor+\left|\lfloor-k-\tfrac12\rfloor\right|=k+|-k-1|=2k+1=n.$

3. ## Re: Integer part

Originally Posted by Sylvia104
You mean $\forall n\in\mathbb Z^+\cup\{0\}$
Thanks, you're right.

But I don't know if you use absolute value.

4. ## Re: Integer part

Without absolute value, $\left\lfloor\frac n2\right\rfloor+\left\lfloor-\frac n2\right\rfloor=0$ if $n$ is even and $-1$ if $n$ is odd.

5. ## Re: Integer part

Thanks, maybe the exercise has a little mistake.

6. ## Re: Integer part

Originally Posted by Fernando
Show that $\forall{x\in{\mathbb{Z^+}\cup{0}}}$ then $[\frac{n}{2}]+[-\frac{n}{2}]=n$
As pointed out that is false.
However $\forall{n\in{\mathbb{Z^+}\cup{0}}}$ then $[\frac{n}{2}]-[-\frac{n}{2}]=n$ is true.

7. ## Re: Integer part

Originally Posted by Plato
However $\forall{n\in{\mathbb{Z^+}\cup{0}}}$ then $[\frac{n}{2}]-[-\frac{n}{2}]=n$ is true.
Yes, You have the reason!

The proof is similar as it was done by Silvia104 , right?
Remark: I'm sorry for me grammar.
Thanks!