# Integer part

• Apr 6th 2012, 05:55 PM
Fernando
Integer part
Hi everyone.

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

Thanks so much.
• Apr 7th 2012, 12:17 AM
Sylvia104
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.$
• Apr 7th 2012, 01:54 PM
Fernando
Re: Integer part
Quote:

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.
• Apr 7th 2012, 02:03 PM
Sylvia104
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.
• Apr 9th 2012, 12:34 PM
Fernando
Re: Integer part
Thanks, maybe the exercise has a little mistake.
• Apr 9th 2012, 12:53 PM
Plato
Re: Integer part
Quote:

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.
• Apr 10th 2012, 03:50 AM
Fernando
Re: Integer part
Quote:

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!