Download presentation
Presentation is loading. Please wait.
Published byMeghan Gardner Modified over 9 years ago
1
CSCI 2110 Discrete Mathematics Tutorial 10 Chin 1
2
About me Name: Chin Office: SHB 117 Email: chlee@cse.cuhk.edu.hkchlee@cse.cuhk.edu.hk Office Hour: Friday 10:00 – 12:00 – Outside office hour? Email me first 2
3
Proposition A statement that can be true or false, but not both Examples – I hate discrete maths – The quizzes are difficult – 1 + 1 = 3 – All primes are odd – No one likes this tutorial 3
4
Predicate A function that maps elements from a domain to {true, false} A claim with variables Examples – ocamp(x) := x went to ocamp – attend(y) := y attends 2110 lecture – odd(a, b) := a is odd and b is odd – compare(x, y) := x < y – female(p) := p is female 4
5
Domain of a predicate A set that contains the values a variable can take attend(y) := y attends 2110 lecture Domain can be the set of 2110 students – then attend(Chin) is undefined (neither true, nor false) – because Chin is not in the domain Sometimes, we omit the domain when the context is clear 5
6
Quantifiers for ∀ ll, – for any, for every, for each, given any, … – P(x) := x goes to tutorial – ∀ x, P(x) there ∃ xists, – (for) some, at least one, (for) one, … – P(x) := x teaches tutorial – ∃ x, P(x) 6
7
Domain is important Let P be a predicate from the domain D – P(x) := x loves discrete maths Is it true that ∀ x ∈ D, P(x)? When D is the set of – 2110 tutors, yes – 2110 students, no 7
8
Negation De Morgan’s laws for first order logic: ¬( ∀ x, P(x)) is equivalent to ∃ x, ¬P(x) ¬( ∃ x, P(x)) is equivalent to ∀ x, ¬P(x) 8
9
De Morgan’s laws Let P(x) := x is female ∀ x, P(x) means everyone is female Which one is its negation, i.e. ¬( ∀ x, P(x)) ? – No one is female, i.e. ¬( ∃ x, P(x)) – Everyone is not female, i.e. ( ∀ x, ¬P(x)) – Someone is female, i.e. ∃ x, P(x) – Someone is not female, i.e. ∃ x, ¬P(x) 9
10
Express the following using predicates Every one goes to lectures Let attend(x) := x goes to lectures ∀ x, attend(x) What is its negation? 10
11
More quantifiers Every one goes to some lectures Let attend(x, y) := x attend lecture y ∀ x, ∃ y attend(x, y) What is its negation? 11
12
More quantifiers What is the negation of ∀ x, ∃ y attend(x, y)? ¬( ∀ x, ∃ y attend(x, y)) ∃ x, ¬( ∃ y attend(x, y)) ∃ x, ∀ y ¬attend(x, y) Some students don’t attend any lectures 12
13
Order of quantifiers are important Every one goes to some lectures Let attend(x, y) := x attend lecture y ∀ x, ∃ y attend(x, y) – Everyone goes to some lectures – Alice can go to first lecture, Bob can go to the second ∃ y, ∀ x attend(x, y) – There exist some lectures that everyone attends – Everyone goes to the same lectures 13
14
More quantifiers Every year, someone goes to every lecture attend(x, y, z) := x goes to lecture y in year z ∀ z, ∃ x, ∀ y attend(x, y, z) What is its negation? 14
15
More quantifiers What is the negation of ∀ z, ∃ x, ∀ y, attend(x, y, z)? ¬( ∀ z, ∃ x, ∀ y, attend(x, y, z)) ∃ z, ¬( ∃ x, ∀ y, attend(x, y, z)) ∃ z, ∀ x, ¬( ∀ y, attend(x, y, z)) ∃ z, ∀ x, ∃ y, ¬attend(x, y, z) In some years, every student does not go to some lectures. 15
16
More and more quantifiers For every d, there exists x and y, so that for every f, f(x) – f(y) < d Let P(f, x, y, d) := f(x) – f(y) < d ∀ d, ∃ x, ∃ y, ∀ f, P(f, x, y, d) What is its negation? 16
17
More and more quantifiers What is the negation of – ∀ d, ∃ x, ∃ y, ∀ f, P(f, x, y, d) ¬( ∀ d, ∃ x, ∃ y, ∀ f, P(f, x, y, d)) ∃ d, ¬( ∃ x, ∃ y, ∀ f, P(f, x, y, d)) ∃ d, ∀ x, ¬( ∃ y, ∀ f, P(f, x, y, d)) ∃ d, ∀ x, ∀ y, ¬( ∀ f, P(f, x, y, d)) ∃ d, ∀ x, ∀ y, ∃ f, ¬P(f, x, y, d) 17
18
Statements in First Order Logic Every odd prime can be written as a sum of the square of two integers What are the predicates? – Let P(p) := p is an odd prime and can be written as a sum of the square of two integers – ∀ p, P(p). Correct, but … In the quiz and exam, you have to break predicates down whenever it is possible 18
19
Mathematical Statements ∀ p, P(p) – P(p) := p is an odd prime and can be written as a sum of the square of two integers P(p) := oddprime(p) ∧ sumoftwo(p) Can we do more? 19
20
Mathematical Statements P(p) := oddprime(p) ∧ sumoftwo(p) oddprime(p) := odd(p) ∧ prime(p) – odd(p) := ∃ k ∈ ℤ, p = 2k + 1 – prime(p) := (p > 1) ∧ ( ∀ a ∈ ℤ, ∀ b ∈ ℤ, ((a > 1) ∧ (b > 1) → ab ≠ p)) 20
21
Mathematical Statements P(p) := oddprime(p) ∧ sumoftwo(p) – sumoftwo(p) := p = x 2 + y 2 for some integers x, y sumoftwo(p) := p = x 2 + y 2 for some integers x, y sumoftwo(p) := ∃ x ∈ ℤ, ∃ y ∈ ℤ, p = x 2 + y 2 21
22
Mathematical Statements P(p) := oddprime(p) ∧ sumoftwo(p) oddprime(p) := odd(p) ∧ prime(p) – odd(p) := ∃ k ∈ ℤ, p = 2k + 1 – prime(p) := (p > 1) ∧ ( ∀ a ∈ ℤ, ∀ b ∈ ℤ, ((a > 1) ∧ (b > 1) → ab ≠ p)) sumoftwo(p) := ∃ x ∈ ℤ, ∃ y ∈ ℤ, p = x 2 + y 2 ∀ p, P(p) 22
23
Method of proofs Direct proof Proof by contradiction Proof by cases 23
24
Direct Proof Let a be an even number and b be an odd. Show that ab is an even number Write a = 2s, and b = 2t + 1 for some integers s and t Then ab = 2s(2t + 1) = 4st + 2s = 2(2st + s) Therefore ab is an even number because 2st+s is an integer. 24 cannot use the same letter
25
Proof by contradiction Show that if 2x + 45 < 85, then x < 20 Suppose x ≥ 20 2x ≥ 40 2x + 40 ≥ 85 Contradiction! 25
26
Proof by contradiction Show that 3 is not rational. How to say 3 is a rational number? – 3 = p/q for some integers p and q 26 √ √ √
27
Proof by contradiction 3 = p/q for some integers p and q We choose p and q so that have no common factors that are greater than 1. – 12/64 → 3/16 – You can always reduce a fraction If we can show p and q have 3 as their common factor, done. But how? 27 √
28
Proof by contradiction 3 = p/q for some integers p and q – Where p and q have no common factors that are > 1 3q 2 = p 2 If p 2 = 3s, p = 3t for some integer t – Prove by contradiction 28 √
29
Proof by contradiction If p 2 = 3s for some integer s, p = 3t for some integer t – Prove by contradiction Suppose p ≠ 3t for any t – Case 1: p = 3t + 1 for some t – Case 2: p = 3t + 2 for some t 29
30
Proof by contradiction If p 2 = 3s for some integer s, p = 3t for some integer t Suppose p 2 = 3s for some integer s but p ≠ 3t for any t – Case 1: p = 3t + 1, p 2 = 9t 2 + 6t + 1 = 3(3t 2 + 2t) + 1 p 2 ≠ 3s for any s – Case 2: p = 3t + 2, p 2 = 9t 2 + 12t + 4 = 3(3t 2 + 4t + 1) + 1 p 2 ≠ 3s for any s Contradiction. 30
31
Proof by contradiction 3q 2 = p 2 – If p 2 = 3s for some integer s, p = 3t for some integer t p = 3t for some integer t 3q 2 = p 2 = 9t – q 2 = 3t – If p 2 = 3t for some integer t, p = 3u for some integer u q = 3u for some integer u 31
32
Proof by contradiction p = 3t for some integer t q = 3u for some integer u So p and q have 3 as their common factor. Contradiction because we begin with the fact that p and q do not have common factor > 1. 32
33
Proof by contradiction Suppose 100 students took a quiz and the mean is 80 (out of 100). Show that at least 50 students score greater than 60. What is the negation of at least 50 students score > 60? – At most 49 students score > 60 – (or at least 51 score ≤ 60) 33
34
Proof by contradiction What is the highest mean we can get? The 49 students who score > 60 get 100 The rest of the 51 students who score ≤ 60 get 60 Then the mean is (# people who score 100) × 100 + (# people who score 60) × 60 = (49 × 100 + 51 × 60) / 100 = (4900 + 3060) / 100 = 79.6 < 80 Contradiction! 34 (total number of students)
35
Proof by cases Prove that max(x, y) + min(x, y) = x + y. If y > x – max(x, y) = y and min(x, y) = x – max(x, y) + min(x, y) = y + x = x + y If y ≤ x – max(x, y) = x and min(x, y) = y – max(x, y) + min(x, y) = x + y done, since either x < y or y <= x must be true. 35
36
Proof by cases Suppose x > 0 and y > 0. Prove that (|x + y| - |x – y|)/2 = min(x, y) If x > y – min(x, y) = y – |x + y| = x + y, |x – y| = x – y – |x + y| - |x – y| = (x + y) – (x – y) = 2y – (|x + y| - |x – y|)/2 = y = min(x, y) 36
37
Proof by cases Suppose x > 0 and y > 0. Prove that (|x + y| - |x – y|)/2 = min(x, y) If x ≤ y – min(x, y) = x – |x + y| = x + y, |x – y| = y – x – (because |a| = -a if a ≤ 0, and (x – y) ≤ 0) – |x + y| - |x – y| = (x + y) – (y – x) = 2x – (|x + y| - |x – y|)/2 = x = min(x, y) 37
38
End Questions? 38
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.