COMP 1000-Lab 4

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

COMP1000: Key Concepts in Computer Science—Lab 4

Instructions: You must submit this lab. It worth 10% of your final mark. Submit a single PDF
file less than 1MB into Brightspace. Email submissions will NOT be accepted. The deadline is
Saturday, October 28. Late submissions will NOT be accepted.

1. (3 points) Suppose you wish to prove “if x is odd then x2 is odd”.

(a) For a direct proof, what do you assume and what do you prove?
(b) For an indirect proof, what do you assume and what do you prove?
(c) For a proof by contradiction, what do you assume and what do you prove?

2. (4 points) Prove, by cases, that for every integer x, x2 + x + 1 is odd.


3. (4 points) Let x be an element of {3, 4}, y be an element of {5, 6}, and Q(x, y) be a predicate.
Rewrite each of the following propositions using disjunctions, conjunctions, and negations
(your answer should not contain ∀ and ∃).

(a) ∀x∀yQ(x, y)
(b) ∃x∀yQ(x, y)

4. (4 points) Prove by contradiction that 8 is irrational.
5. (4 points) Prove that for every integer x, x + 2 is odd if and only if x + 5 is even.
6. (6 points) Prove directly that for every odd integer x there exists an integer y such that
x2 = 8y + 1. (You can use any proof given in the lectures.)
7. (4 points) Prove directly that the difference of every two rational numbers is rational. (You
can show that if x and y are rational then x − y is rational.)
8. (6 points) Prove by contradiction that for every real numbers x and y if x is rational and y
is irrational, then x + y is irrational. (Use the result of previous question.)

You might also like