How to prove the following numbers odd and even respectively?

Question:If a and b are two odd positive integers such that a>b, then prove that one of the two numbers (a+b)/2 and (a-b)/2 is odd and the other is even.

My answer: since a and b are odd positive integers they have to be in the form 2q + 1;

so a = 2m + 1 b = 2n + 1

so,

(a+b)/2 = (2m+2m+1+1)/2

= (2m+2n+2)/2

= 2*{(m+n+1)/2}

= 2k where k is {(m+n+1)/2}


therefore (a+b)/2 is even

in the case of (a-b)/2

 (a-b)/2 = {(2m+1)-(2n+1)}/2

= (2m-2n)/2

= 2*{(m-n)}/2

= 2k where k = {(m-n)}/2


therefore (a-b)/2 is also even

But the question says that one of the numbers have to be odd, so is my solution wrong or is there a problem in the question itself(the question is from my reference textbook).

-
How familiar are you with modular arithmetic? Would it help you if I told you to work $\pmod 4$? If not, then I have the following suggestion: Instead of writing $a$ and $b$ as $2m + 1$ and $2n + 1$, divide into cases depending on whether $a$ and $b$ are of the form $4m + 1$ or $4m + 3$ (that is four cases total). – Arthur Apr 30 '14 at 9:40
Sure, I'll try that – user2468338 Apr 30 '14 at 9:43
I tried the mod 4 but the problem still persists, 4m + 1 and 4m + 3 are still getting the conclusion as even. – user2468338 Apr 30 '14 at 9:47
You've already accepted my answer, but here's an attempt to fix your solution. In both cases you've factored out a $2$ (in one case it's $\color{red}{2}\cdot\left(\frac{m + n + 1}{2}\right)$ and in the other it's $\color{red}{2}\cdot\left(\frac{a - b}{2}\right)$). Use that $2$ to cancel the fraction, so you're left with determining the pairity of the two numbers $m + n + 1$ and $m-n$. – Arthur Apr 30 '14 at 10:09
If you check your work with an example, say with $a=1, b=3$ or $a=1,b=5$, it will be immediately apparent where your argument fails and what your mistake is. – MJD Apr 30 '14 at 13:19

Working $\pmod 4$, we get that $a$ and $b$ are each congruent to either $1$ or $3$.

Case 1: $a \equiv b \pmod 4$. In this case, $a - b \equiv 0\pmod 4$, so $\frac{a - b}{2}$ is necessary even (the numerator is divisible by $4$). We also have $a + b \equiv 2\pmod 4$, so $\frac{a + b}{2}$ is an odd number (the numerator is an even number not divisible by $4$).

Case 2: $a \not \equiv b \pmod 4$. In this case $a + b \equiv 0 \pmod 4$, so $\frac{a + b}{2}$ must be even. Similarily, $\frac{a - b}{2}$ must be odd.

The other solution I hinted at:

Rewrite $a$ as $4m+1$ or $4m+3$ depending on which one works. Do the same for $b$ and $n$.

Case 1: $a = 4m+1$ and $b = 4n+1$. We have that $$\frac{a + b}{2} = \frac{4m + 1 + 4n + 1}{2} = \frac{4(m+n) + 2}{2} = 2(m + n) + 1$$ is odd. Completely analogously we get that $$\frac{a - b}{2} = \frac{4m + 1 - 4n - 1}{2} = \frac{4(m-n)}{2} = 2(m-n)$$ is even.

Can you do the other three cases?

-
Thanks a lot for the other solution, I get why you told me to use mod 4 so that the common 2 could be cancelled. – user2468338 Apr 30 '14 at 10:02
@user2468338 When it is clear that a fraction with $2$ in the denominator is an integer (as in this case), determining whether it is odd or even requires knowledge of whether there is exactly one or more than one factors of $2$ in the numerator. That is what mod 4 does. – Arthur Apr 30 '14 at 10:04

Subtract the two numbers: $\dfrac{a+b}{2} - \dfrac{a-b}{2} = \dfrac{2b}{2} = b$ which is odd by definition.

And if two numbers differ by an odd amount they cannot both be even or both be odd.

-
that's a really great logic but I don't think my examiners would approve this. Thanks anyways – user2468338 Apr 30 '14 at 18:32

Hint:

• You do not know that $\dfrac{m+n+1}{2}$ is an integer or that $\dfrac{m-n}{2}$ is an integer. So your conclusions that double each of them is even are wrong.

• You could show one of them is and one is not, and thus be able to answer the question.

1. If $m$ and $n$ are both even, or if $m$ and $n$ are both odd then $\dfrac{a+b}{2}= m+n+1$ is odd and $\dfrac{a-b}{2}= m-n$ is even.
2. If one of $m$ and $n$ is even and the other is odd then $\dfrac{a+b}{2}= m+n+1$ is even and $\dfrac{a-b}{2}= m-n$ is odd.
3. Either way, one of $\dfrac{a+b}{2}$ and $\dfrac{a-b}{2}$ is even and the other is odd.