Discrete Mathematics
Ch t 2 F d t l f
- - Chapter 2: Fundamentals of
Logic
Hung-Yu Kao (高宏宇) Department of Computer Science and Information Engineering, N l Ch K U National Cheng Kung University
Discrete Mathematics -- Chapter 2: Fundamentals of Ch t 2 F d t - - PowerPoint PPT Presentation
Discrete Mathematics -- Chapter 2: Fundamentals of Ch t 2 F d t l f Logic Hung-Yu Kao ( ) Department of Computer Science and Information Engineering, N National Cheng Kung University l Ch K U Outline Basic Connectives and
Hung-Yu Kao (高宏宇) Department of Computer Science and Information Engineering, N l Ch K U National Cheng Kung University
Basic Connectives and Truth Tables Logical Equivalence: The Law of Logic Logical Equivalence: The Law of Logic Logical Implication: Rule of Inference The Use of Quantifiers Quantifiers Definitions and the Proofs of Quantifiers, Definitions, and the Proofs of
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
2
(1) A君可以搬動任何石頭 (1) A君可以搬動任何石頭 (2) A君可以製造出他無法搬動的石頭 (3) (1) (2) 相互矛盾 原命題為假 (3) (1), (2) 相互矛盾, 原命題為假
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
3
Statement 敘述 (Proposition 命題): are declarative
Primitive Statement (原始命題) Primitive Statement (原始命題)
Examples
p: ‘Discrete Mathematics’ is a required course for sophomores. p: Discrete Mathematics is a required course for sophomores. q: Margaret Mitchell wrote ‘Gone with the Wind’. r: 2+3=5. “What a beautiful evening!” (not a statement) ”Get up and do your exercises.” (not a statement)
No way to make them simpler No way to make them simpler
“The number x is an integer.” is a statement ?
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
4
g
New statements can be obtained from primitive
Transform a given statement p into the statement ¬p,
Combine two or more statements into a compound Combine two or more statements into a compound
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
5
Compound Statement (Logical Connectives)
Conjunction: p q (read “p and q”)
Disjunction : p v q (read “p or q”) Exclusive or : p v q.
p → q is also called
Exclusive or : p v q. Implication: p → q,
p → q is also called,
p: hypothesis l i
Biconditional: p ↔ q
“p if and only if q” (若且為若)
q: conclusion
“p iff q” “p is necessary and sufficient for q” q whenever p
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
6
The truth and falsity of the compound statements based
We do not want a true statement to lead us into believing something that is false. p ¬p p q p q p v q p v q p → q p ↔ q 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
7
Truth Tables
“True, False” is preferred (less ambiguous) than “1, 0”
List the elementary truth values in a consistent way
They get long: with n variables, the length is 2n. In the end we want to be able to reason about logic
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
8
p→q is equivalent with (¬p ∨ q) It’s not relative about the causal relationship
Margaret Mitchell wrote ‘Gone with the Wind’. is true
If 2 3 6 , then 2 4 7 is true
“Margaret Mitchell wrote ‘Gone with
the Wind’(q) and 2+3 5 (not r) the
1 2 3
the Wind (q), and 2+3 5 (not r), the ‘Discrete Mathematics’ is a required course for sophomores (p).
Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
9
r is true every day except Friday, even though 2+3=6 is false.
Th M h i l f i li i i i d d f The Mathematical concept of an implication is independent of a cause-and-effect relationship between hypothesis and conclusion.
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
10
Ex 2.1: Let s, t, and u denote the primitive statements.
English sentences for compound statements.
If th i t d it i t i th Ph lli t f lk
If the moon is out and it is not snowing, then Phyllis goes out for a walk.
If the moon is out, then if it is not snowing Phyllis goes out for a walk.
Same?
It is not the case that Phyllis goes out for a walk if and only if it is
snowing or the moon is out.
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
11
g
Let s, t, and u denote the primitive statements.
R l i th l i l f f i E li h t
Reversely, examine the logical form for given English sentences.
s ↔ t
a walk.”
(u ¬t ) → ¬ s
(u t ) → s
u s
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
12
Ex 2.3: Decision (selection) structure
In computer science, the if-then and if-then-else decision
structure arise in high-level programming languages such as Java and C++.
E.g., “if p then q else r,” q is executed when p is true and r
i d h i f l is executed when p is false.
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
13
Tautology, T0: If a compound statement is true for all
Example: p∨¬p
Contradiction, F0: If a compound statement is false for
Example: p∧¬p
Examples
“2 = 3–1” is not a tautology, but “2=1 or 2≠1” is; “1+1=3” is not a contradiction, but “1=1 and 1≠1” is.
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
14
An argument starts with a list of given
(p p
(p1 p2 ⋯ pn) → q
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
15
Logically equivalent, : When the statement s1 is
2 1
s s ⇔
q p p q q p ↔ ⇔ → ∧ → ) ( ) (
( ) ( )
q p p q q p ↔ ⇔ → ∧ → ) ( ) (
the same truth tables
p q ¬p ¬ p v q p → q q → p (p → q ) ( q → p) p ↔ q 1 1 1 1 1 1 1 1 1 1
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
16
1 1 1 1 1 1 1 1 1
Negation, v (exclusive)
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
17
Logically equivalent examples
p ⇔ (p∨p) p ⇔ (p∨p)
“1+1=2” ⇔ “1+1=2 or 1+1=2”
¬¬p ⇔ p ¬¬p ⇔ p
“He did not not do it” ⇔ “He did it”
¬(p∧q) ⇔ ¬p∨¬q “If p then not p” ⇔ “not p”
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
18
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
19
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
20
DeMorgan’s Laws:
p q p q ¬(p q) ¬p ¬q ¬ p ∨ ¬ q p ∨ q ¬(p ∨ q) ¬p ¬ q 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
21
1 1 1 1
Definition 2.3: Let s be a statement. Dual of s, denoted sd, is the
statement obtained from s by replacing each occurrence of ∧ and b d ti l d h f T d F b ∨ by ∨ and ∧, respectively, and each occurrence of T0 and F0 by F0 and T0, respectively.
) ( ) ( : T r q p s ∧ ∨ ∧
g
) ( ) ( : ) ( ) ( : F r q p s T r q p s
d
∨ ∧ ¬ ∨ ∧ ∨ ¬ ∧
Keep negation!
The Principle of Duality: Let s and t be statements that contain
no logical connectives other than ∧ and ∨. If t th
d
td If s ⇔ t , then sd ⇔ td.
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
22
Rule 1: Suppose that the compound statement P is a tautology.
f b th t t t th th lti
compound statement P1.is also a tautology.
Rule 2: Let P be a compound statement where p is an arbitrary
p p y statement that appears in P, and let q be a statement such that q ⇔ p.
S h i l f b
Then this replacement yields the compound statement P1. Under these circumstances P1 ⇔ P.
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
23
Ex 2.10: From the first of DeMorgan’s Laws
from the first substitution rule
replace each occurrence of q by t →u
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
24
Ex 2.11: P: (p → q) →r, and because (p → q) ⇔ ¬p ∨ q from the second substitution rule
Check 2.11 (b) for another example using the second rule
p →(p ∨ q), ¬ ¬ p ⇔ p
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
25
1.
(p ∨ q) → r ⇔ ¬(p ∨ q) ∨ r (First substitution rule)
2.
¬[(p ∨ q) → r] ⇔ ¬[¬(p ∨ q) ∨ r] (Negating)
3
¬[¬(p ∨ q) ∨ r] ⇔ ¬¬(p ∨ q) ∧ ¬r (DeMorgan’s Laws)
3.
¬[¬(p ∨ q) ∨ r] ⇔ ¬¬(p ∨ q) ∧ ¬r (DeMorgan s Laws)
4.
¬¬(p ∨ q) ∧ ¬r ⇔ (p ∨ q) ∧ ¬r (Law of double Negation)
5.
¬[(p ∨ q) → r] ⇔ (p ∨ q) ∧ ¬r [(p q) ] (p q)
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
26
Ex 2.13:
p: Joan goes to Lake George q: Mary pays for Joan’s shopping spree. p → q: If Joan goes to Lake George, then Mary will pay for
Joan’s shopping spree. Joan s shopping spree.
The negation of p → q :
G th M ill f J ’ h i George, then Mary will pay for Joan’s shopping spree.
pay for Joan’s shopping spree.
q p → ) ( q p q p q p ¬ ∧ ¬¬ ⇔ ∨ ¬ ¬ ⇔ → ¬ ) ( ) (
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
27
q p q p ¬ ∧ ⇔
p q p → q ¬ q → ¬ p q → p ¬ p → ¬ q
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
p → q ⇔ (¬ q → ¬ p)
→ ⇔ ( → )
1 1 1 1 1 1
q → p ⇔ (¬ p → ¬ q) Contrapositive of p → q : ¬ q → ¬ p Converse of p → q : q → p Converse of p → q : q → p Inverse of p → q : ¬ p → ¬ q
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
28
Ex 2.16: How to simply express the compound
Reasons ) ( ) ( q p q p ∧ ¬ ¬ ∧ ∨ Negation) Double
(Law ) ( ) ( Law) s (DeMorgan' ) ( ) ( q p q p q p q p ¬ ∨ ∧ ∨ ⇔ ¬ ∨ ¬¬ ∧ ∨ ⇔ Law) (Inverse )
Law ive (Distribut ) ( g ) ( ) ( ) ( F p q q p q p q p ∨ ⇔ ∧ ∨ ¬ ∧ ∨ ⇔ Law) (Identity Law) (Inverse p F p ⇔ ∨ ⇔
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
29
Ex 2 18: A switching network is made up of wires and Ex 2.18: A switching network is made up of wires and
p p p q t ¬t
¬q r q t t
T1 T2
r
T1 T2
t ¬q
)] ( [ ) ( ) ( ) ( t t t ⇔
P i !
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
30
)] ( [ ) ( ) ( ) ( q t r p r t p q t p r q p ¬ ∨ ∧ ∨ ⇔ ∨ ¬ ∨ ∧ ¬ ∨ ∨ ∧ ∨ ∨
Practice!
⇔ p ∨ [(q ∨ r) ∧ (t ∨ ¬q) ∧ (¬t ∨ r)] ⇔ p ∨ [(q ∨ r) ∧ (t ∨ ¬q) ∧ (¬t ∨ r)] ⇔ p ∨ [((q ∧ ¬t ) ∨ r) ∧ (t ∨ ¬q)] ⇔ p ∨ [((q ∧ ¬t ) ∨ r) ∧ ¬(¬t ∧ q)] ⇔ p ∨ [((q ∧ ¬t ) ∧ ¬(¬t ∧ q)) ∨ (¬(¬t ∧ q) ∧ r)] ⇔ p ∨ [((q ∧
⇔ p ∨ [F0 ∨ (¬(¬t ∧ q) ∧ r)]
p
⇔ p ∨ [r ∧ (t ∨ ¬q)]
t
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
31
r ¬q
Premiss: p1, p2,…, pn Conclusion: q
n → ∧ ⋅ ⋅ ⋅ ∧ ∧
2 1
q
p q p r p p → ¬ → : :
2 1
r p ¬ :
3
q p p p →
∧ ∧
) (
3 2 1
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
32
Examine the truth table for the implication
p
p1 p2 p3 (p1 p2p3) → q
q r p q r p → ¬ ∧ → ¬ ∧ → ] ) ( ) [(
r p p → :
1
p1 p2 p3 (p1 p2 p3) q p q r p → r ¬q → p ¬r [(p → r ) (¬q → p) ¬r] → q 1 1 1
r p p q p ¬ → ¬ : :
3 2
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
33
∧ ∧
3 2 1
Definition 2.4: p logically implies q, p ⇒ q.
Rules of inference
Using these techniques will enable us to consider only the
Use instead of constructing the huge truth table
cases wherein all the premises are true.
Development of a step-by-step validation of how the
concl sion logicall follo s from the premises conclusion q logically follows from the premises p1, p2,…, pn in an implication of the form
n → ∧ ⋅ ⋅ ⋅ ∧ ∧
2 1
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
34
Rule of Detachment (分離)
Example:
p q p → q p (p → q) [p (p → q)] → q
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
q p p →
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
35
q q p ∴
therefore
Law of the Syllogism (演繹推理)
Tabular form:
Modus Tollens: Method of Denying
Tabular form:
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
36
Rules of Inference
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
37
Ex 2.30:
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
38
If the band could not play rock music or the refreshments were
not delivered on time, then the New Year’s party would have been cancelled and Alicia would have been angry. been cancelled and Alicia would have been angry.
If the party were cancelled, then refunds would have had to be
made.
No refunds were made. Therefore the band could play rock music.
p: The band could play rock music. q: The refreshments were delivered
) ( ) ( t r s r q p → ∧ → ¬ ∨ ¬
r: The New Year’s party was cancelled . s: Alicia was angry. t: Refunds had to be made
p t ∴ ¬
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
39
t: Refunds had to be made.
) ( ) ( s r q p ∧ → ¬ ∨ ¬
Premise (1) t r → Reasons Steps
p t t r ∴ ¬ →
i A lifi Di j i f R l d (3) ) 4 ( Denying
Method and (2), and (1) (3) Premise ) 2 ( r t ¬ ¬
p ∴
Premise ) ( ) ( ) 6 ( Laws s DeMorgan' and (4) ) ( ) 5 ( ion Amplificat e Disjunctiv
Rule and (3) ) 4 ( s r q p s r s r ∧ → ¬ ∨ ¬ ∧ ¬ ¬ ∨ ¬ Negation Double
Law and Laws, s DeMorgan' , (7) ) 8 ( Denying
Method and (5), and (6) ) ( (7) Premise ) ( ) ( ) 6 ( q p q p s r q p ∧ ¬ ∨ ¬ ¬ ∧ → ¬ ∨ ¬ tion Simplifica e Conjunctiv
Rule and (8) ) 9 ( p ∴
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
40
Is the right argument valid or invalid? Let conclusion ¬p be false (the argument invalid)
⇒ p is true ⇒ q is true ⇒ q is true ⇒ s is true ⇒ r is false i t ( i t ) ⇒ r is true (¬p∨r, now p is true) ⇒ contradiction ⇒ argument is valid
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
41
A
習題A
習題A1
習題A
習題A2
如果不出A
請問哪一題會出哪一題不會出?
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
42
B
角頭老大A
角頭老大A
B
說: 如果A 被謀殺, 那肯定是C 幹的
B
說: 如果A 被謀殺, 那肯定是C 幹的
C
說: 如果A 不是自殺, 那就是被謀殺
警方不知B
警方不知B
A
死因只有三種: 意外, 自殺和謀殺
如果B
和C 都沒有說謊 那A 就死於一場意外
如果B
和C 都沒有說謊, 那A 就死於 場意外
如果B
和C 兩人中有一人說謊, 那麼A 就不是死於 意外
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
請問A
43
Definition 2.5: A declarative sentence is an open statement if Definition 2.5: A declarative sentence is an open statement if
certain allowable choices.
p(x): The number x+2 is an even integer p(x): The number x+2 is an even integer. q(x, y): The number y+2, x - y, and x+2y are even integers. For some x, p(x). For some x, y, q(x, y). For some x
p(x) For some x y q(x y)
For some x, ¬p(x). For some x, y, ¬q(x, y).
Existential quantifier: , “for some x”, “for at least one x” or
“th i t h th t”
“there exists an x such that”
Universal quantifier: , “for all x”, “for any x” “for every x” or
“for each x such that”
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
44
Given the open statements
3 : ) ( 4 3 : ) ( : ) ( , : ) (
2 2 2
> = ≥ ≥ x x s x x x r x x q x x p
The statement is true
For every real number x, if x ≥ 0, then x2 ≥ 0.
)] ( ) ( [ x q x p x → ∀
3 : ) ( , 4 3 : ) ( > − = − − x x s x x x r For every real number x, if x ≥ 0, then x ≥ 0.
Every nonnegative real number has a nonnegative square. The square of any nonnegative real number is a nonnegative
l b real number.
All nonnegative real numbers have nonnegative squares.
The statement is true. The statement is false.
Counterexample!
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
45
¬∃x: P(x) v.s. ∃x: ¬P(x)
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
46
x: (x) v.s. x: (x) ¬∀x: P(x) v.s. ∀x: ¬P(x)
For open statements p(x), q(x), the universally
Contrapositive: ∀x[¬q(x) → ¬p(x)] Converse: ∀x[q(x) → p(x)] Inverse: ∀x[¬p(x) → ¬q(x)]
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
47
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
48
Rules for negating statements with one quantifier
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
49
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
50
What is the negation of the following statement?
)] , ( )) , ( ) , ( [( y y x r y x q y x p x → ∧ ∃ ∀
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
51
show that for all n, n=2, 4, 6,…,24, 26, we can write n as the
f h f sum of at most three perfect squares.
Exhaustion method
2=1+1 4 4 10=9+1 12 4 4 4 20=16+4 22 9 9 4 4=4 6=4+1+1 8=4+4 12=4+4++4 14=9+4+1 16=16 22=9+9+4 24=16+4+4 26=25+1 8 4+4 16 16 18=16+1+1 26 25+1
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
52
Th R l f U i l S ifi ti If
The Rule of Universal Specification: If an open statement
becomes true for all replacements by the members in a given universe, then that open statement is true for each specific individual member in that universe.
) ( ) ( )] ( ) ( [ a c a m x c x m x ∴ → ∀ ) (a c ∴
Premise )] ( ) ( [ (1) → ∀ x c x m x Reasons Steps Detachment
Rule the and (3) and (2) c(a) ) 4 ( ion Specificat Universal
rule the and (1) c(a) (a) (3) Premise (a) ) 2 ( ∴ → m m
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
53
( ) ( ) ( ) ) (
Th R l f U i l G li ti If ( )
The Rule of Universal Generalization: If an open statement p(x)
is proved to be true when x is replaced by any arbitrarily chosen element c from our universe, then the universally quantified statement is true. Furthermore, the rule extends beyond a single variable.
) ( x p x ∀ )] ( ) ( [ x q x p x ∨ ∀ ))] ( ) ( ( ) ( [ x q x p x r ∧ ¬ ¬ → ¬ )] ( ) ( [ )] ( )) ( ) ( [( )] ( ) ( [ x p x r x x r x q x p x x q x p x → ¬ ∀ ∴ → ∧ ¬ ∀ ))] ( ) ( ) ( [ x q x p x r ¬ ∨ → ¬ )] ( ) ( [ p
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
54
)] ( )) ( ) ( [( )] ( ) ( [ x r x q x p x x q x p x → ∧ ¬ ∀ ∨ ∀
Ex 2.56:
)] ( ) ( [ x p x r x → ¬ ∀ ∴
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
55
) ( ) ( )] ( )) ( ) ( [( m s m p x p x s x j x ∴ ¬ → ∨ ∀
a physical education class. Mary is enrolled in a physical
) (m s ¬ ∴
Reasons Steps
education class.
Premise ) ( ) 2 Premise )] ( ) ( ) ( [ 1) m p x p x s x j x ¬ → ∨ ∀ Reasons Steps Negation Double
Law and ) ( ) ( (3), )) ( ) ( ( ) ( ) 4 ion Specificat Universal
Rule and (1) ) ( ) ( ) ( 3) q t t q m s m j m p m p m s m j ¬ → ¬ ⇔ → ∨ ¬ → ¬ → ∨ Detachment
Rule and (5) and (2) ) ( ) ( ) 6 Law s DeMorgan' and (4) )) ( ) ( ( ) ( ) 5 Negation Double
Law m s m j m s m j m p ¬ ∧ ¬ ¬ ∧ ¬ →
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
56
tion Simplifica e Conjunctiv
Rule and (6) ) ( ) 7 m s ¬ ∴
D fi iti 2 8
there exists an integer r so that n = 2r. If n is not even, then we call n odd and find for this case that there exists an integer s where n = n odd and find for this case that there exists an integer s where n = 2s +1.
k + l is even.
Si k d l dd i k 2 1 d l 2b 1 f
1.
Since k and l are odd, we may write k = 2a+1 and l = 2b+1, for some integers a, b. (the Rule of Universal Specification)
2.
Then k + l = (2a+1)+(2b+1) = 2(a+b+1), which hold for integers. (apply Commutative Associative and Distributive Laws) (apply Commutative, Associative, and Distributive Laws)
3.
Since a, b are integers, a+b+1 = c is an integer; with k + l = 2c, so k + l is even.
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
57
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
58
1.
Since m is even, we have m = 2a for some integer a. Then m + 7 =
1.
Since m is even, we have m 2a for some integer a. Then m 7 2a + 7 = 2a + 6 +1 = 2(a + 3) + 1. since a+3 is an integer, we know that m + 7 is odd.
2.
Suppose that m + 7 is not odd, hence even. Then m + 7 = 2b for pp some integer b, and m = 2b – 7 = 2b – 8 +1 = 2(b – 4) +1, where b – 4 is an integer. Hence m is odd. (contraposition method)
3.
Assume that m is even and m + 7 is also even. Then m + 7 even i li th t + 7 2 f i t C tl 2 implies that m + 7 = 2c for some integer c. Consequently, m = 2c – 7 = 2c – 8 +1 = 2(c – 4) +1 with c – 4 an integer, so m is odd. Now we have contradiction. So the assumption is false (m + 7 is even), and we have m + 7 odd. (contradiction method) and we have m 7 odd. (contradiction method)
Assumption Result Derived Contraposition ¬q(m) ¬p(m)
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
59
Contradiction p(m) and ¬q(m) F0
Prove (p and ¬ q) is false prove (¬p or q) is true Prove (p and ¬ q) is false prove (¬p or q) is true
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
60
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
61
2.1: 10 2 2: 16 20 2.2: 16, 20 2.3: 10 2.4: 14 2 5: 16 2.5: 16
Discrete Mathematics Discrete Mathematics – – CH2 CH2 2009 Spring 2009 Spring
62