# Integer part

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

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

Thanks so much.
• Apr 6th 2012, 11:17 PM
Sylvia104
Re: Integer part
You mean $\displaystyle \forall n\in\mathbb Z^+\cup\{0\},$ $\displaystyle \left\lfloor\frac n2\right\rfloor+\left|\left\lfloor-\frac n2\right\rfloor\right|=n?$

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

If $\displaystyle n$ is odd, say $\displaystyle n=2k+1,$ $\displaystyle \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, 12:54 PM
Fernando
Re: Integer part
Quote:

Originally Posted by Sylvia104
You mean $\displaystyle \forall n\in\mathbb Z^+\cup\{0\}$

Thanks, you're right.

But I don't know if you use absolute value.
• Apr 7th 2012, 01:03 PM
Sylvia104
Re: Integer part
Without absolute value, $\displaystyle \left\lfloor\frac n2\right\rfloor+\left\lfloor-\frac n2\right\rfloor=0$ if $\displaystyle n$ is even and $\displaystyle -1$ if $\displaystyle n$ is odd.
• Apr 9th 2012, 11:34 AM
Fernando
Re: Integer part
Thanks, maybe the exercise has a little mistake.
• Apr 9th 2012, 11:53 AM
Plato
Re: Integer part
Quote:

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

As pointed out that is false.
However $\displaystyle \forall{n\in{\mathbb{Z^+}\cup{0}}}$ then $\displaystyle [\frac{n}{2}]-[-\frac{n}{2}]=n$ is true.
• Apr 10th 2012, 02:50 AM
Fernando
Re: Integer part
Quote:

Originally Posted by Plato
However $\displaystyle \forall{n\in{\mathbb{Z^+}\cup{0}}}$ then $\displaystyle [\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!