In: Computer Science
Provide a proof of the following statement:
For all integers ? and ?, if ? + ? is odd, then ? − ? is odd.
Solution:
To prove: for all integers x and y, if x + y is odd then x - y is odd
Explanation:
Proving the statement given:
=>If x + y is odd then there will be 2 cases-
Case 1: x is odd and y is even
Case 2: x is even and y is odd
=>As sum of even and odd numbers can only by odd. If we add 2 odd numbers then it wil always be even and if we add 2 even numbers then it will be always even hence above 2 cases are only possible.
Proving that x - y is odd:
Case 1: when x is odd and y is even.
=>x - y = odd - even
=>x - y = odd number
=>As subtraction of odd and even number always returns odd number hence x - y is odd for case 1.
Case 2: When x is even and y is odd.
=>As subtraction of even and odd number always returns odd number hence x - y is odd for case 2.
=>Hence we have proved our statement on the basis of above statements given.
I have explained each and every part with the help of statements attached to it.