0% found this document useful (0 votes)
34 views6 pages

2022 Worksheet 2

The document is a tutorial worksheet for a discrete math course. It contains 8 problems for students to work through in groups. The problems cover topics like: logical statements, proofs involving divisibility and parity, propositional logic, and determining whether expressions are satisfiable. The brief solutions provided at the end summarize the key steps to answers for selected problems. These include: proving statements about divisibility using direct and contrapositive proofs, identifying a false statement and providing a counterexample, tracing the output of a for loop, and determining the primality of expressions.

Uploaded by

pzydf6wjxv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views6 pages

2022 Worksheet 2

The document is a tutorial worksheet for a discrete math course. It contains 8 problems for students to work through in groups. The problems cover topics like: logical statements, proofs involving divisibility and parity, propositional logic, and determining whether expressions are satisfiable. The brief solutions provided at the end summarize the key steps to answers for selected problems. These include: proving statements about divisibility using direct and contrapositive proofs, identifying a false statement and providing a counterexample, tracing the output of a for loop, and determining the primality of expressions.

Uploaded by

pzydf6wjxv
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

DISCRETE MATH 37181 TUTORIAL WORKSHEET 2

©MURRAY ELDER, UTS AUTUMN 2022

Instructions. Complete these problems in groups of 3-4 on the whiteboard (real or virtual). Partial
solutions at the end of the PDF. Your tutor will come around to each group throughout the tutorial and
check your progress/ask questions as you work together on the worksheet.

Recall:

Definition 1. Let a, b ∈ Z. We say a divides b if ∃s ∈ Z such that b = as.

For example, 3 divides −18 since there exists −6 such that −18 = 3 · (−6), and 3 does not
divide 14 since for all s ∈ Z 14 6= 3s.

Notation: a|b.

Definition 2. p ∈ N, p > 1 is called prime if s ∈ N divides p implies s = 1 or s = p.

1. Let the universe of discourse be all people, C(x) =“x likes cheese” and D(x) =“x cannot eat
dairy foods”.

(a) The logical statement ∀x[D(x) → ¬C(x)] has the following meaning in English:

A. All people either cannot eat dairy or C. For all people, if the person eats cheese
cannot eat cheese. then they like cheese.
D. If a person cannot eat dairy then they
B. If a person cannot eat dairy then they
don’t like cheese.
cannot eat cheese.
E. None of the above.

(b) What is the negation of the statement ∀x[D(x) → ¬C(x)]? Express in symbols, simplify
then write in English.

2. Using a direct proof, prove that if k, l ∈ Z have the same parity1 then k + l is even.

3. Consider the following statements (don’t try to prove/disprove them yet!):

(i) For all x ∈ Z, if 3 divides x then 3 divides x2 .

(ii) For all x ∈ Z, if 3 divides x2 then 3 divides x.

(iii) ∀x ∈ R ∀y ∈ R [(xy > 0) ∨ (x = 0) ∨ (y = 0)]

Date: Week 2 workshop (Wednesday 11, Thursday 12, Friday 13 August).


1parity means being even or odd. So your proof can be Case 1: both even. Case 2: both odd.
1
2 ©MURRAY ELDER, UTS AUTUMN 2022

(iv) For all n ∈ Z, n is divisible by some prime number p.

(v) For all n ∈ N, n2 + 5n + 5 is prime.

(vi) For all n ∈ Z, if n > 1 then n is divisible by some prime number p.

(a) Read each of the statements (i)–(vi) together as a group, and discuss between the group if
you think they are true or false. Write down your votes for true, false on the whiteboard.You
don’t have to agree, at the start. Don’t try to prove them yet.

(b) Next to any votes for true, write direct, contrapositive or contradiction as the approach you
think will be the best to prove it. Next to any votes for false, write down some ideas for a
counterexample.

(c) Now, either prove using either a direct, contrapositive or contradiction proof, or show that it
is false by giving a counterexample.

2
4. Write the output of the following (somewhat useless) code:

int j = 9;
for(int i=0; i<10; i++)
j--;
print j

5. Determine whether or not the following statements is true or false. If false, give a counterexample.
Assume the universe of discourse to be Z.

(a) ∀x∃y∃z [x = 7y + 5z] (b) ∀x∃y∃z [x = 4y + 6z]

6. Use the table on your formula sheet (last page of this worksheet) to simplify the expression
¬ (q → (p ∨ (q ∧ r))). Check your answer by drawing a truth table.

7. Is the formula (p ∨ q ∨ r) ∧ (p ∨ q ∨ ¬r) ∧ (p ∨ ¬q ∨ r) ∧ (p ∨ ¬q ∨ ¬r) ∧ (¬p ∨ q ∨ r) ∧ (¬p ∨ q ∨


¬r) ∧ (¬p ∨ ¬q ∨ r) ∧ (¬p ∨ ¬q ∨ ¬r) satisfiable?


8. (Bonus question) Prove that 2 is not rational by following these steps.

(a) Suppose (for contradiction) that 2 is rational. Then ∃a, b ∈ Z such that . . .

(b) If a, b have a common factor, we can divide top and bottom to get a smaller pair of numbers.
So assume (here is the thing we will contradict later) that . . .

(c) Now multiply both sides of your answer to (a) by b then square both sides to get

(d) It follows that a2 is even, so by Lemma 4.3 of the lecture notes this implies a is even. Then
2b2 = a2 = (2s)2 = 4s2 so divide both sides by 2 to get . . .

(e) What is the contradiction?

2 ++ means increment by 1, -- means decrement by 1


©MURRAY ELDER, UTS AUTUMN 2022 3

Sample formula sheet:

Some tautologies with names:


logic rule (tautology) name
¬(¬p) ↔ p double negative

¬(p ∨ q) ↔ ¬p ∧ ¬q DeMorgan
¬(p ∧ q) ↔ ¬p ∨ ¬q

p∨q ↔ q∨p commutative


p∧q ↔ q∧p

p ∨ (q ∨ r) ↔ (p ∨ q) ∨ r associative
p ∧ (q ∧ r) ↔ (p ∧ q) ∧ r

p ∨ (q ∧ r) ↔ (p ∨ q) ∧ (p ∨ r) distributive
p ∧ (q ∨ r) ↔ (p ∧ q) ∨ (p ∧ r)

p∨p ↔ p idempotent
p∧p ↔ p

p∨F ↔ p identity
p∧T ↔ p
p ∨ (p ∧ q) ↔ p adsorption
p ∧ (p ∨ q) ↔ p

p → q ↔ ¬p ∨ q useful ones
p ∨ ¬p ↔ T
p ∧ ¬p ↔ F

p → q ↔ ¬q → ¬p contrapositive
(¬p → F ) → p contradiction

Definition. Let a, b ∈ Z. Then a divides b if ∃s ∈ Z such that b = as. Notation: a|b.

Definition. Let p ∈ N, p > 1. Then p is called prime if s ∈ N divides p implies s = 1 or s = p.

For the Learning Progress Check (LPC), you are allowed to use a formula sheet that you create for
yourself. You can use this as a start, and keep adding to it each week. A formula sheet is much more
efficient during a test that scanning through lecture notes etc.LPC1 Question 1 asked you to prove (with
truth tables) double negative, distributive and adsorption.
4 ©MURRAY ELDER, UTS AUTUMN 2022

Brief solutions:
1. D. “If a person” in English means “if any person”, so the ∀ is hidden here. Literally, for all
people, if a person cannot eat dairy then that person does not like cheese.

2. Proof. We will prove two cases: k, l both even, and k, l both odd.

If k, l both even then ∃b, c ∈ Z with k = 2b, l = 2c. Then k + l = 2b + 2c = 2(b + c) is even since
b + c ∈ Z.

If k, l both odd then ∃b, c ∈ Z with k = 2b + 1, l = 2c + 1. Then k + l = 2b + 1 + 2c + 1 =


2(b + c) + 2 = 2(b + c + 1) is even since b + c + 1 ∈ Z. 

3. (i) Proof. Direct. By definition, if 3|x then x = 3c for some c ∈ Z so x2 = (3c)2 = 9c2 = 3(3c2 )
is divisible by 3. 

(ii) Proof. Contrapositive. Suppose 3 does not divide x. Then x = 3c+i for c ∈ Z and i ∈ {1, 2}
(that is, i = 1 or 2). Then x2 = (3c + i) = 9c2 + 6ci + i2 = 3(3c2 + 2c) + i2 .

If i = 1 then i2 = 1 and x2 = 3(3c2 + 2c) + 1 is not divisible by 3. If i = 2 then i2 = 4 and


x2 = 3(3c2 + 2c + 1) + 1is not divisible by 3. 

(iii) False, there exist x = −1, y = 1 such that xy 6 0 and x 6= 0 and y 6= 0


(i.e. the negation of the statement is true).

(iv) False, n = 1 is only divisible by ±1. Also −1 is a counterexample.

(v) False, if n = 5 then n2 + 5n + 5 = 55 = 5.10 is not prime (has two divisors 6= 1).

(vi) This is true. Here is a tricky proof using WOP. We will learn how to use WOP more in a
future lectures, so this is an advanced proof for today. Some tutorial questions are designed
to get your groups talking and arguing, so don’t worry if you all decide you don’t know how
to prove it and move on. This is a key part of learning proofs.
Proof: Given n > 1, let D = {s ∈ Z | s|n ∧ s > 1} be the set of integers that divide n.
Since n > 1 and n|n, D is non-empty, and also D ⊆ N. So I can use the WPO: D has a
first element p. If p is not prime then p = ab for two integers a, b > 1. Then n = sp = sab
so a|n and a > 1 so a ∈ D, but a is smaller than p (since b > 1) contradicting that p was
first. Thus p is prime. 

4. It just prints once after it finishes the loop. Here is a table showing the value of i, j during the
computation.

i j
9
0 8
1 7
2 6
3 5
4 4
5 3
6 2
7 1
8 0
9 −1
So the output is −1.
©MURRAY ELDER, UTS AUTUMN 2022 5

This question is here for the non-computer scientists in the class. Don’t be afraid of the syntax,
just ask someone or look it up. This is C or C++ code that I found somewhere. i++ means
decrease the value of i by 1 and j--, well, guess. Obviously this is not a programming course
(you should do one, or several!) but later in this course we will apply mathematics to understand
computer code, so that’s why we want to get familiar with pseudocode here. For the computer
programmers, we want you to be able to trace what the code does (draw a table like the one
here, on paper) not just hack without thinking what steps are happening.

5. (a) If x = 1 we need 7y + 5z = 1 so y = 1−5z


7
top should be a multiple of 7, yes z = 3 gives
1 − 15 = −14 so y = −2, z = 3. For any other value of x, we just multiply everything by x:
y = −2x, z = 3x. So its true.

(b) This time the right hand side is always even, since we have 4 and 6, so it is false for x = 1.

6. Simplify means try to get rid of nested brackets, and negations out the front of brackets, etc.
¬ (q → (p ∨ (q ∧ r)))
↔ ¬ (¬q ∨ (p ∨ (q ∧ r))) using useful fact a → b ↔ ¬a ∨ b
↔ ¬¬q ∧ ¬(p ∨ (q ∧ r)) using De Morgan
↔ q ∧ (¬p ∧ ¬(q ∧ r)) using double negative and De Morgan
↔ q ∧ (¬p ∧ (¬q ∨ ¬r)) using De Morgan
↔ ¬p ∧ (q ∧ (¬q ∨ ¬r)) using commutative, associative, commutative
↔ ¬p ∧ ((q ∧ ¬q) ∨ (q ∧ ¬r)) distributive
↔ ¬p ∧ (F ∨ (q ∧ ¬r)) useful fact a ∧ ¬a is always false
↔ ¬p ∧ q ∧ ¬r identity
Check we didn’t make a mistake by drawing the truth table for both statements:
p q r ¬ (q → (p ∨ (q ∧ r))) ¬p ∧ q ∧ ¬r
1 1 1
1 1 0
1 0 1
1 0 0
0 1 1
0 1 0
0 0 1
0 0 0
or by saying “¬p ∧ q ∧ ¬r is true only when p = 0, q = 1, r = 0, and ¬ (q → (p ∨ (q ∧ r))) is
true only when q → (p ∨ (q ∧ r)) is false, which happens only when q = 1 and p ∨ (q ∧ r) = 0
(implication only false when 1 → 0) which happens only when p = 0 and q ∨ r = 0 which, since
q = 1 already, means r = 0”. Hmm I think just drawing the truth table might be easier than
that!

7. No. To prove it, must check every possible value assignment (23 of them).

√ √
8. (a) Suppose (for contradiction) that 2 is rational. Then ∃a, b ∈ Z such that 2 = ab .

(b) If a, b have a common factor, we can divide top and bottom to get a smaller pair of numbers.
So assume (here is the thing we will contradict later) that the greatest common divisor 3 of
a and b is 1.

3gcd(a, b) =1
6 ©MURRAY ELDER, UTS AUTUMN 2022

(c) Now multiply both sides of your answer to (a) by b then square both sides to get b 2 = a,
2b2 = a2 .
(d) It follows that a2 is even, so by Lemma 4.3 of the lecture notes this implies a is even. Then
2b2 = a2 = (2s)2 = 4s2 so divide both sides by 2 to get b2 = 2s2 , which means b2 is even so
by Lemma 4.3 b is even as well.
(e) What is the contradiction? We assumed that we had reduced any common factors in a, b at
the start, that
√ is, gcd(a, b) = 1 but now 2 divides both a and b, which is a contradicition.
Therefore 2 is NOT rational.

You might also like