0% found this document useful (0 votes)
61 views

01-Introduction-Chapter01-Propositional Logic

This document provides an overview of Chapter 1 from the textbook "Discrete Mathematics and Its Applications" by Kenneth H. Rosen. The chapter introduces propositional logic, predicates, quantifiers, and proofs. It defines logical operators and their truth tables. Key concepts covered include logical equivalences, De Morgan's laws, predicates, universal and existential quantification, and translating statements between natural language and logical notation. Exercises are provided to help readers practice applying these foundational logical concepts.
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)
61 views

01-Introduction-Chapter01-Propositional Logic

This document provides an overview of Chapter 1 from the textbook "Discrete Mathematics and Its Applications" by Kenneth H. Rosen. The chapter introduces propositional logic, predicates, quantifiers, and proofs. It defines logical operators and their truth tables. Key concepts covered include logical equivalences, De Morgan's laws, predicates, universal and existential quantification, and translating statements between natural language and logical notation. Exercises are provided to help readers practice applying these foundational logical concepts.
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/ 49

DISCRETE

MATHEMATICS
AND
ITS APPLICATIONS
Book: Discrete Mathematics and Its Applications
Author: Kenneth H. Rosen
Seventh Edition
McGraw-Hill International Edition
Chapter 1
The Foundations:
Logic and Proofs
Objectives
⚫ Explain what makes up a correct
mathematical argument
⚫ Introduce tools to construct arguments
Contents
1.1-Propositional Logic – Logic mệnh đề
1.2-Propositonal Equivalences
1.3-Predicates and Quantifiers (vị từ và lượng từ)
1.4-Nested Quantifiers
1.5-Rules of Inference – Các quy tắc suy diễn
1.1- Propositional Logic

1.1.1- Definitions and Truth Table


1.1.2- Precedence of Logical Operators
1.1.1- Definitions and Truth Table

⚫ Proposition is a declarative sentence that is either


true or false but not both.
⚫ Proposition is a sentence that declares a fact.
⚫ Examples:
* I am a girl
* Ha Noi is not the capital of Vietnam OK
* 1+5 < 4
* What time is it?
Not OK
* X+Y=Z
1.1.1- Definitions…

⚫ Truth table
– I am a girl

p
True/ T / 1
False / F / 0
1.1.1- Definitions…
⚫ Negation of propositions p is the statement “ It is
not case that p”.
⚫ Notation: ¬p (or p )

p
1 0

0 1
1.1.1- Definitions…
⚫ Conjunction of propositions p and q is the
proposition “ p and q” and denoted by p∧q

p q p∧q
0 0 0
0 1 0
1 0 0
1 1 1
1.1.1- Definitions…

⚫ Disjunction of propositions p and q is the proposition


“ p or q” and denoted by p ∨ q

p q p∨q
0 0 0
0 1 1
1 0 1
1 1 1
1.1.1- Definitions…

⚫ Exclusive-or (xor) of propositions p and q, denoted


by p  q

p q pq
0 0 0
0 1 1
1 0 1
1 1 0
q
1.1.1- Definitions…
⚫ Implication: p → q (p implies q)
⚫ p: hypothesis / antecedent / premise
⚫ q: conclusion / consequence
⚫ p → q can be expressed as:
- q if p
- If p, then q
- p is sufficient condition for q
- q is necessary condition for p

p q p→q
“If 1 + 1 = 3, then dogs can fly”
0 0 1 → TRUE
0 1 1 (p → q)
p=0, q=0 ,
1 0 0 so (p→q) is true.
1 1 1
1.1.1- Definitions…
⚫ Biconditional statement p↔q is the proposition “ p if and
only if q”
⚫ p → q (p only if q) and q → p (p if q)

p q p→q q→p (p→q) ∧ (q→p) p↔q


0 0 1 1 1 1
0 1 1 0 0 0
1 0 0 1 0 0
1 1 1 1 1 1
1.1.2- Precedence of Logical Operators

(1) Parentheses from inner to outer


(2) ¬
(3) ∧
(4) ∨
(5) →
(6) ↔
A logical puzzle
⚫ On an island, there are 2 kinds of people:
knights who always tells the truth, and
knaves who always lies. You meet 2
people A and B. Determine which kind
each one of them is if they say
⚫ (i) A: "at least one of us is a knave", B
says nothing.
⚫ (ii) A: "We are both knights" and B: "A is a
knave".
Examples - Exercises
⚫ Construct truth tables: 3&,33,35,37 p.15
⚫ Smullyan logic puzzles: 19-31 p.23
1.2- Propositional Equivalences

1.2.1- Tautology and Contradiction


1.2.2- Logical Equivalences
1.2.3- De Morgan’s Laws
1.2.1- Tautology and Contradiction

⚫ Tautology is a proposition that is always true


⚫ Contradiction is a proposition that is always false
⚫ When p ↔ q is tautology, we say “p and q are called logically
equivalence”. Notation: p ≡ q
Example 3 p.23

⚫ Show that p → q and ¬p v q are


logically equivalent.
1.2.2- Logical Equivalences…
Equivalence Name
p∧T≡p pvF≡p Identity laws- Luật đồng nhất
pvT≡ T p ∧F ≡ F Domination Laws – Luật chi phối
pvp≡ p p∧p ≡ p Idempotent Laws – Luật bất biến
¬(¬p) ≡ p Double Negation Laws – Luật đảo kép
pvq≡qvp p∧q ≡q∧p Commutative Laws – Luật giao hoán
(p v q) v r ≡ p v (q v r) Associative Laws – Luật kết hợp
(p ∧ q) ∧ r ≡p ∧ (q ∧ r)
p v (q ∧ r) ≡ (p v q) ∧ (p v r) Distributive Laws – Luật phân phối
p ∧ (q v r) ≡ (p ∧ q) v (p ∧ r)
¬ (p ∧ q) ≡ ¬p v ¬q ¬(p v q) ≡ ¬p ∧ ¬q De Morgan Laws
p v (p ∧ q) ≡ p p ∧ (p v q)≡ p Absorption Laws – Luật hấp thụ
p v ¬p ≡ T p ∧ ¬p≡ F Negation Laws - Luật nghịch đảo
1.2.2- Logical Equivalences…
Equivalences Equivalences
p→q ≡ ¬pvq p↔q ≡ (p→q) ∧ (q→p)
p→q ≡ ¬q → ¬p p↔q ≡ ¬p ↔ ¬q
pvq ≡ ¬ p → q p↔q ≡ (p ∧ q) v (¬p∧ ¬q)
p^q ≡ ¬ (p → ¬q) ¬ (p↔q) ≡ p↔ ¬q
¬(p→q) ≡ p∧¬q
(p→q) ∧ (p→r) ≡ p → (q∧r)
(p→r) ∧ (q→r) ≡ (pvq) → r
(p→q) v (p→r) ≡ p→ (qvr)
(p→r) v (q→r) ≡ (p∧q) → r
Exercises - Examples
⚫ Using truth tables to prove equivalence: 9,
10 p.35
⚫ Using fundamental laws to prove
equivalene: 16-28 p.35
1.3- Predicates and Quantifiers

⚫ Introduction
⚫ Predicates
⚫ Quantifiers
1.3.1- Introduction

⚫ A type of logic used to express the meaning of a wide


range of statements in mathematics and computer
science in ways that permit us to reason and
explore relationships between objects.
1.3.2- Predicates – vị từ

⚫ X>0
⚫ P(X)=“X is a prime number” , called
propositional function at X.
⚫ P(2)=”2 is a prime number” ≡True
⚫ P(4)=“4 is a prime number” ≡False
1.3.2- Predicates – vị từ
⚫ Q(X1,X2,…,Xn) , n-place/ n-ary predicate
⚫ Example: “x=y+3” ➔ Q(x,y)
Q(1,2) ≡ “1=2+3” ≡ false
Q(5,2) ≡ “5=2+3” ≡ true
1.3.2- Predicates…
⚫ Predicates are pre-conditions and post-
conditions of a program.
Pre-condition (P(…)) : condition describes
⚫ If x>0 then x:=x+1 valid input.
Post-condition (Q(…)) : condition
– Predicate: “x>0” ➔ P(x) describe valid output of the codes.
– Pre-condition: P(x) Show the verification that a program
always produces the desired output:
– Post-condition: P(x) P(…) is true
Executing Step 1.
⚫ T:=X;
Executing Step 2.
X:=Y; …..
Q(…) is true
Y:=T;
- Pre-condition: “x=a and y=b” ➔ P(x, y)
- Post-condition: “x=b and y=a” ➔ Q(x, y)
1.3.3- Quantifiers – Lượng từ
⚫ The words in natural language: all, some, many, none,
few, ….are used in quantifications.
⚫ Predicate Calculus : area of logic that deals with
predicates and quantifiers.
⚫ The universal quantification (lượng từ phổ dụng) of
P(x) is the statement “P(x) for all values of x in the
domain”. Notation : xP(x)
⚫ The existential quantification (lượng từ tồn tại) of P(x)
is the statement “There exists an element x in the
domain such that P(x)”. Notation : x P(x)
⚫ Uniqueness quantifier: !x P(x) or 1xP(x)
⚫ x P(x) v Q(y) :
⚫ x is a bound variable
⚫ y is a free variable
1.3.4- Quantifiers and Restricted
Domains
x<0(x2 > 0), y  0(y3  0), z>0(z2 =2)
➔
x(x<0 ∧ x2 > 0), y(y  0 ∧ y3  0), z(z>0 ∧ z2 =2)

Restricted domains
1.3.5- Precedence of Quantifiers

⚫ Quantifier have higher precedence than all


logical operators from propositional
calculus.
⚫ x P(x) v Q(x) ➔ (x P(x)) v Q(x)
⚫  has higher precedence. So,  affects on
P(x) only.
1.3.6- Logical Equivalences
Involving Quantifiers
Statements involving predicates and quantifiers are
logically equivalent if and only if they have the same
truth value no matter which predicates are substituted
into the statements and which domain of discourse is
used for the variables in these propositional functions.
⚫ x (P(x) ∧ Q(x)) ≡ xP(x) ∧ xQ(x)
– Proof: page 39

Expression Equivalence Expression Negation


¬xP(x) x ¬P(x) xP(x) x ¬P(x)
¬ xP(x) x ¬P(x) xP(x) x ¬P(x)
1.3.7- Translating

⚫ For every student in the class has studied


calculus
⚫ For every student in the class, that student
has studied calculus
⚫ For every student x in the class, x has
studied calculus
⚫ x (S(x) → C(x))
Examples and exercises
⚫ Proposition function, truth value at
particular values: Ex 13,15, 17 p.53
⚫ Translate propositions using quantifiers:
Ex 27,29,31,33 p.54, 55
⚫ Logical equivalence of propositions
containing quantifiers: Ex 49,51,53 p.56
Nested quantifiers
⚫ Very often, we have to use many
quantifiers to state a proposition. One
quantifier is within the scope of another.
They are called nested.
⚫ E.g: For every real number a, there is
exactly one real number b such that a =
b^3.
∀a ∃!b (a = b^3).
Two quantifiers
More examples
⚫ Every natural number can be written as a
product of prime numbers in a unique way.
⚫ The sum of two even numbers is an even
number.
⚫ There are infinitely many prime numbers.
⚫ Every odd number greater than 5 can be
expressed as the sum of three primes.
How do you translate these into logical
propositions?
Negating nested quantifiers

Example: ¬ xy(xy=1) ≡ x ¬y (xy=1) // De Morgan laws


≡ (x) (y) ¬(xy=1)
≡ (x) (y) (xy  1)

⚫ The rule is simply to apply consecutively, from left to right,


the negation rule for one quantifier.
Examples and exercises
⚫ Translate from logic to English: 5,7 p.64,65
⚫ Translate from English to logic: 9,11,13
p.65,66
⚫ Translate mathematical propositions: 23,
25, 27 p.67
⚫ Negation: 31,33 p.67
1.5- Rules of Inference – Quy tắc
diễn dịch

⚫ Definitions
⚫ Rules of Inferences
1.5.1- Definitions

⚫ Proposition 1 // Hypothesis – giả thiết


⚫ Proposition 2
Arguments 2,3,4 are
⚫ Proposition 3 premises (tiên đề) of
argument 5
⚫ Proposition 4
⚫ Proposition 5 Argument s– suy luận
Propositional
⚫ ……… Equivalences

⚫ Conclusion
1.5.2- Rules Inferences
Rule Tautology Name
p [p∧ (p→q)] → q Modus ponen
p →q You work hard If Socrates is human, then Socrates is mortal.
q If you work hard then you will pass the examination
Socrates is human.
you will pass the examination  Socrates is mortal.
¬q [¬q ∧(p → q)] → ¬p Modus tollen
p→q She did not get a prize
¬p If she is good at learning she will get a prize
She is not good at learning
p →q [(p →q) ∧(q →r)] →(p→r) Hypothetical
q →r If the prime interest rate goes up then the stock prices go syllolism – Tam
p →r down. đoạn luận giả
If the stock prices go down then most people are thiết,
unhappy. Quy tắc bắc cầu
If the prime interest rate goes up then most people are
unhappy. Một ngôi nhà rẻ thì hiếm
Cái gì hiếm thì đắt
 Một ngôi nhà rẻ thì đắt.
Rules Inferences…
Rule Tautology Name
pvq [(pvq)∧¬p] → q Disjunctive syllogism
¬p Power puts off or the lamp is malfunctional
q Power doesn’t put off
the lamp is malfunctional
p p →(pvq) Addition
pvq It is below freezing now
It is below freezing now or raining now
p∧q (p∧q) →p Simplication
p It is below freezing now and raining now
It is below freezing now
p [(p)∧(q)) → (p∧q) Conjunction
q
p∧q
pvq [(pvq)∧(¬pvr)] →(qvr) Resolution
¬pvr Jasmin is skiing OR it is not snowing
qvr It is snowing OR Bart is playing hockey
Jasmin is skiing OR Bart is playing hockey
1.5.3- Fallacies – ngụy biện – sai logic
⚫ If you do every problem in this book then you will understand
discrete mathematics
You understood discrete mathematics
(p → q) ∧q
=(¬ p v q) ∧ q
(absorption law)
=q
No information for p
p can be true or false ➔ You may have understood discrete
mathematics but you might have done just a few problems.
Fallacies…
⚫ (p → q)∧q → p is not a tautology
( it is false when p = 0, q = 1)
⚫ (p → q)∧¬p → ¬q is not a tautology
(it is false when p = 0, q = 1)

Hắn chửi như những người say rượu hát. Giá hắn biết hát
thì hắn có lẽ hắn không cần chửi. Khổ cho hắn và khổ cho
người, hắn lại không biết hát. Thì hắn chửi, cũng như
chiều nay hắn chửi….. (Nam Cao, Chí Phèo, trang 78)
p→¬q
¬p
➔ ¬(¬q) = q là không hợp logic
1.5.4- Rules of Inference for
Quantified Statements
Rule Name
xP(x) Universal Instantiation
P(c) Cụ thể hóa lượng từ phổ dụng
P(c) for arbitrary c Universal generalization
xP(x) Tổng quát hóa bằng lượng từ phổ dụng
xP(x) Existential instantiation
P(c) for some element c Chuyên biệt hóa
P(c) for some element c Existential generalization
xP(x) Khái quát hóa bằng lượng từ tồn tại
Rules of Inference for Quantified Statements…

⚫ “All student are in this class had taken the


course PFC”
⚫ “HB is in this class”
⚫ “Had HB taken PFC?”
⚫ x(P(x) → Q(x)) Premise

⚫ P(HB) → Q(HB) Universal Instantiation

Modus ponens
⚫ P(HB)
⚫ Q(HB) // conclusion
Examples - Exercises
⚫ Recognize rules: 3,4 p.78
⚫ Recognize rules for quantified statements:
13,14,15 p.79
⚫ Work with rules in formal notations: 23-29
p.80
Summary
⚫ Propositional Logic – Luận lý mệnh đề
⚫ Propositional Equivalences
⚫ Predicates and Quantifiers
⚫ Nested Quantifiers
⚫ Rules and Inference – Quy tắc và diễn
dịch
THANK YOU

You might also like