Upload
tong-worapol-ratanapan
View
1.078
Download
2
Tags:
Embed Size (px)
Citation preview
CS1231 Discrete Structures
Tong W. Ratanapan
Tutorial 2: Sep 2-6, 2013
slideshare.net/TongWR
Outline Tutorial 1 Revision
Discussion
CS1231 Tutorial 2 Tong W. Ratanapan
Correction
Consultation
Launchpad @ N-House (level 1, block 15, PGP)
Wednesday 1-2pm
Outline Tutorial 1 Revision
Discussion
CS1231 Tutorial 2 Tong W. Ratanapan
Outline
Outline Tutorial 1 Revision
Discussion
CS1231 Tutorial 2 Tong W. Ratanapan
0. Outline
1. Tutorial 1 1. Pigeon Hole Principle 2. Pure Existence Proof 3. Inclusion-Exclusion Principle
Outline Tutorial 1 Revision
Discussion
CS1231 Tutorial 2 Tong W. Ratanapan
0. Outline
1. Tutorial 1 1. Pigeon Hole Principle 2. Pure Existence Proof 3. Inclusion-Exclusion Principle
2. Revision 1. Propositional Logic 2. Predicate Logic 3. Model Semantics
Outline Tutorial 1 Revision
Discussion
CS1231 Tutorial 2 Tong W. Ratanapan
0. Outline
1. Tutorial 1 1. Pigeon Hole Principle 2. Pure Existence Proof 3. Inclusion-Exclusion Principle
2. Revision 1. Propositional Logic 2. Predicate Logic 3. Model Semantics
3. Discussion
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Tutorial 1
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Problems & Solutions: http://www.artofproblemsolving.com/Wiki/index.php/Pigeonhole_Principle Applications: http://mindyourdecisions.com/blog/2008/11/25/16-fun-applications-of-the-pigeonhole-principle
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Pure Existence Proof
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Pure Existence Proof
Q: Are there irrational π, π such that ππ is rational?
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Pure Existence Proof
Q: Are there irrational π, π such that ππ is rational? A: Yes!
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Pure Existence Proof
Q: Are there irrational π, π such that ππ is rational? A: Yes!
22
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Pure Existence Proof
Q: Are there irrational π, π such that ππ is rational? A: Yes!
22
rational
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Pure Existence Proof
Q: Are there irrational π, π such that ππ is rational? A: Yes!
22
rational π = π = 2 β ππ = 22
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Pure Existence Proof
Q: Are there irrational π, π such that ππ is rational? A: Yes!
22
rational π = π = 2 β ππ = 22
; rational by assumption
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Pure Existence Proof
Q: Are there irrational π, π such that ππ is rational? A: Yes!
22
irrational
rational π = π = 2 β ππ = 22
; rational by assumption
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Pure Existence Proof
Q: Are there irrational π, π such that ππ is rational? A: Yes!
22
irrational
rational π = π = 2 β ππ = 22
; rational by assumption
π = 22, π = 2 β ππ = 2
22
= 2 ; rational
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Pure Existence Proof
Q: Are there irrational π, π such that ππ is rational? A: Yes!
22
irrational
rational π = π = 2 β ππ = 22
; rational by assumption
π = 22, π = 2 β ππ = 2
22
= 2 ; rational
doesnβt matter, exists anyway!
Outline Tutorial 1 Revision
Discussion
Pigeonhole Principle Pure Existence Proof Inclusion-Exclusion Principle
CS1231 Tutorial 2 Tong W. Ratanapan
Inclusion-Exclusion Principle
Outline Tutorial 1 Revision
Discussion
Propositional Logic Predicate Logic Model Semantics
CS1231 Tutorial 2 Tong W. Ratanapan
Revision
Outline Tutorial 1 Revision
Discussion
Propositional Logic Predicate Logic Model Semantics
CS1231 Tutorial 2 Tong W. Ratanapan
Propositional Logic
Propositional Logic Formal Syntax of Propositional Logic Predicate Logic Formal Syntax of Predicate Logic
Formal Syntax of Propositional Logic
2.2. Formal Syntax of Propositional Logic
Definition 2.2.1
Let us consider a collection of symbols called propositions orstatements. Let us consider the collection of symbols{>,β₯,β¨,β§,Β¬,β,β,β}a. Let us consider the two parenthesissymbols ( and ).
F is a well formed formula (wff) (or atomic statementb) if F isa proposition.
The following are wff (or compound statements) iff F1 and F2are wff. >, β₯, (F1 β§ F2), (F1 β¨ F2), Β¬(F1), (F1 β F2),(F1 β F2), (F1 β F2).
the above are the only wff.
aThese are the standard connectives. There are more.bp and Β¬p are sometimes refer to as unit statements.
Propositional Logic Formal Syntax of Propositional Logic Predicate Logic Formal Syntax of Predicate Logic
Formal Syntax of Propositional Logic
Different Notations
> T , true, 1β₯ F , false, 0
(p β§ q) (p.q), p Γ q, (p&q), (p&&q)(p β¨ q) (p + q), (p | q), (pβq)(p β q) (pΛq)(p β q) (p β q), (p β‘ q)(p β q) (p β q), (p β q)Β¬p βΌ p, p, !p(p) [p]
Propositional Logic Formal Syntax of Propositional Logic Predicate Logic Formal Syntax of Predicate Logic
Precedence
Precedence and Parenthesis
In this module we do not assume any precedence rule andsystematically use parenthesis to avoid ambiguity.
Truth Tables Propositional Calculus Predicate Calculus
Truth Tables
Truth Table of Negation
F1 Β¬F1true falsefalse true
Truth Tables Propositional Calculus Predicate Calculus
Truth Tables
Truth Table of Conjunction
F1 F2 F1 β§ F2
true true truetrue false falsefalse true falsefalse false false
Truth Tables Propositional Calculus Predicate Calculus
Truth Tables
Truth Table of Disjunction
F1 F2 F1 β¨ F2
true true truetrue false truefalse true truefalse false false
Truth Tables Propositional Calculus Predicate Calculus
Truth Tables
Truth Table of Exclusive Disjunction
F1 F2 F1 β F2
true true falsetrue false truefalse true truefalse false false
Truth Tables Propositional Calculus Predicate Calculus
Truth Tables
Truth Table of Implication
F1 F2 F1 β F2
true true truetrue false falsefalse true truefalse false true
Truth Tables Propositional Calculus Predicate Calculus
Truth Tables
Truth Table of Equivalence
F1 F2 F1 β F2
true true truetrue false falsefalse true falsefalse false true
Outline Tutorial 1 Revision
Discussion
Propositional Logic Predicate Logic Model Semantics
CS1231 Tutorial 2 Tong W. Ratanapan
Predicate Logic
Propositional Logic Formal Syntax of Propositional Logic Predicate Logic Formal Syntax of Predicate Logic
Formal Syntax of Predicate Logic
Definition 2.4.5
Let us consider a collection of constants. Let us consider acollection of variables, let us consider a collection of predicates(each predicate is associated to a natural number n, called itsvalence or arity, we say that the predicate is n-ary). Let us considerthe corresponding Herbrandβs base. Let us consider the collectionof symbols {>,β₯,β¨,β§,Β¬,β,β,β}. Let us consider the twosymbols β (the existential quantifier; read βthere existsβ) and β(the universal quantifier; read βfor allβ) called quantifiers....
Propositional Logic Formal Syntax of Propositional Logic Predicate Logic Formal Syntax of Predicate Logic
Formal Syntax of Predicate Logic
Definition 2.4.5 Cont.
F is a well formed formula (wff) or compound statement if Fis an atom of BH .
The following are wffs if F1 and F2 are wffs.
>,β₯,(F1 β§ F2),(F1 β¨ F2),Β¬(F1),(F1 β F2),(F1 β F2),(F1 β F2).
The following are wffs if F is a wff and X is a variable.
(βX F ),(βX F ).
the above are the only wff.
Propositional Logic Formal Syntax of Propositional Logic Predicate Logic Formal Syntax of Predicate Logic
Formal Syntax of Predicate Logic
For example the following are wff.
βX (βY ((odd(X ) β§ Β¬(even(Y )))β even(X + Y ))).
βX (βY (X β Nβ (Y β N β§ Y = s(X )))).
βX (X β Nβ s(X ) β N).
For example the following are not wff.
βX (βY ((odd(X ) β§ β§ β§ Β¬(even(Y )))β even(X + Y ))).
βX β§ (βY (X β Nβ (Y β N β§ Y = s(X )))).
X (X β Nβ s(X ) β N.
Outline Tutorial 1 Revision
Discussion
Propositional Logic Predicate Logic Model Semantics
CS1231 Tutorial 2 Tong W. Ratanapan
Model Semantics
Truth Tables Propositional Calculus Predicate Calculus
Propositional Calculus
3.2. Propositional Calculus
Definition 3.2.1
An interpretation I is a mapping of the propositions to the truthvalues {true, false} such that:
I (>) = true
I (β₯) = false,
I (Β¬F1) = true if I (F1) = false , otherwise I (Β¬F1) = false,
I (F1 β§ F2) = true if I (F1) = true and I (F2) = true, otherwiseI (F1 β§ F2) = false,
I (F1 β¨ F2) = true if I (F1) = true or I (F2) = true (or both),otherwise I (F1 β¨ F2) = false,
...
Truth Tables Propositional Calculus Predicate Calculus
Propositional Calculus
Definition Cont.
I (F1 β F2) = false if I (F1) = true and I (F2) = false,otherwise I (F1 β F2) = true,
I (F1 β F2) = true if I (F1) = true = I (F2) = true orI (F1) = false = I (F2) = false, otherwise I (F1 β F2) = false,
I (F1 β F2) = true if I (F1) = true or I (F2) = true but notboth, otherwise I (F1 β F2) = false.
The above is best summarized in truth tables. A truth tablepresents all interpretations of a formula.
Truth Tables Propositional Calculus Predicate Calculus
Models
Definition 3.2.2
An interpretation I is a model of a formula F iff I (F ) = true.
Definition 3.2.3
An interpretation I is a counter-model of a formula F iffI (F ) = false.
Truth Tables Propositional Calculus Predicate Calculus
Models
Definition 3.2.4
A formula F is a tautology (or is valid) iff all interpretations aremodels.
Definition 3.2.5
A formula F is a contradiction iff no interpretation is model.
Definition 3.2.6
A formula F is a contingency iff it is neither a tautology nor acontradiction.
Truth Tables Propositional Calculus Predicate Calculus
Models
Definition 3.2.7
Let F1 and F2 be two formulae. F2 is a logical consequence of F1,we write F1 |= F2 iff all models of F1 are models of F2.
Definition 3.2.8
Let Fn be formulae. Fn is a logical consequence of F1, ...,Fnβ1, wewrite F1, ...,Fnβ1 |= Fn iff all models common to F1, ...,Fnβ1 aremodels of Fn.
Definition 3.2.9
Let F1 and F2 be two formulae F1 and F2 are logicaly equivalent,we write F1 β‘ F2, iff they have the same models.
Outline Tutorial 1 Revision
Discussion
Group activity
CS1231 Tutorial 2 Tong W. Ratanapan
Discussion
Outline Tutorial 1 Revision
Discussion
Group activity
CS1231 Tutorial 2 Tong W. Ratanapan
Divide into 5 groups
Each solves one from 2, 3, 4, 5.odd, 5.even