SlideShare a Scribd company logo
1 of 40
DISCRETE
MATHEMATICS
AND
ITS APPLICATIONS
Book: Discrete Mathematics and Its Applications
Author: Kenneth H. Rosen
Sixth 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
* 1+5 < 4
* What time is it?
* X+Y=Z
OK
No OK
1.1.1- Definitions…
 Truth table
– I am a girl
p
True/ T / 1
False / F / 0
1.1.1- Definitions…
p
1 0
0 1
 Negation of propositions p is the statement “ It is
not case that p”.
 Notation: p (or )
p
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 v 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
 q
p q p  q
0 0 0
0 1 1
1 0 1
1 1 0
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
0 0 1
0 1 1
1 0 0
1 1 1
“If 1 + 1 = 3, then dogs can fly”
TRUE
(p  q)
p=0, q=0 ,
so (pq) is true.
1.1.1- Definitions…
 Biconditional statement p q is the proposition “ p if and
only if q”
 p → q (p only if q) and p q (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) v
(5) →
(6) ↔
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 p v F ≡ p Identity laws- Luật đồng nhất
p v T ≡ T p ^ F ≡ F Domination Laws – Luật chi phối
p v p ≡ p p ^ p ≡ p Idempotent Laws – Luật bất biến
¬(¬p) ≡ p Double Negation Laws – Luật đảo kép
p v q ≡ q v p p ^ q ≡ q ^ p Commutative Laws – Luật giao hoán
(p v q) v r ≡ p v (q v r)
(p ^ q) ^ r ≡p^(q^r)
Associative Laws – Luật kết hợp
pv (q^r) ≡ (pvq) ^ (pvr)
p^ (qvr) ≡ (p^q) v (p^r)
Distributive Laws – Luật phân phối
¬ (p^q) ≡ ¬pv¬q ¬(pvq) ≡ ¬p^¬q De Morgan Laws
pv (p^q)≡ p p^(pvq)≡ p Absorption Laws – Luật hấp thụ
pv¬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
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
 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 – vị từ
1.3.2- Predicates…
 Predicates are pre-conditions and post-
conditions of a program.
 If x>0 then x:=x+1
– Predicate: “x>0”  P(x)
– Pre-condition: P(x)
– Post-condition: P(x)
 T:=X;
X:=Y;
Y:=T;
- Pre-condition: “x=a and y=b”  P(x, y)
- Post-condition: “x=b and y=a”  Q(x, y)
Pre-condition (P(…)) : condition describes
valid input.
Post-condition (Q(…)) : condition
describe valid output of the codes.
Show the verification that a program
always produces the desired output:
P(…) is true
Executing Step 1.
Executing Step 2.
…..
Q(…) is true
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 : xP(x)
 Uniqueness quantifier: !x P(x) or 1xP(x)
 xP(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.
 xP(x) v Q(x)  (xP(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))
Negating nested quantifiers
¬ xy(xy=1) ≡ x ¬y (xy=1) // De Morgan laws
≡ (x) (y) ¬(xy=1)
≡ (x) (y) (xy  1)
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
 Proposition 3
 Proposition 4
 Proposition 5
 ………
 Conclusion
Argument s– suy luận
Propositional
Equivalences
Arguments 2,3,4 are
premises (tiên đề) of
argument 5
1.5.2- Rules Inferences
Rule Tautology Name
p
p →q
q
[p^ (p→q)] → q
You work hard
If you work hard then you will pass the examination
you will pass the examination
Modus ponen
¬q
p → q
¬p
[¬q ^(p → q)] → ¬p
She did not get a prize
If she is good at learning she will get a prize
She is not good at learning
Modus tollen
p →q
q →r
p →r
[(p →q) ^(q →r)] →(p→r)
If the prime interest rate goes up then the stock prices go
down.
If the stock prices go down then most people are
unhappy.
If the prime interest rate goes up then most people are
unhappy.
Hypothetical
syllolism – Tam
đoạn luận giả
thiết,
Quy tắc bắc cầu
Một ngôi nhà rẻ thì hiếm
Cái gì hiếm thì đắt
 Một ngôi nhà rẻ thì đắt.
If Socrates is human, then Socrates is mortal.
Socrates is human.
 Socrates is mortal.
Rules Inferences…
Rule Tautology Name
pvq
¬p
q
[(pvq) ^¬p] → q
Power puts off or the lamp is malfunctional
Power doesn’t put off
the lamp is malfunctional
Disjunctive syllogism
p
pvq
p →(pvq)
It is below freezing now
It is below freezing now or raining now
Addition
p^q
p
(p^q) →p
It is below freezing now and raining now
It is below freezing now
Simplication
p
q
p^q
[(p) ^(q)) → (p^q) Conjunction
pvq
¬pvr
qvr
[(pvq) ^(¬pvr)] →(qvr)
Jasmin is skiing OR it is not snowing
It is snowing OR Bart is playing hockey
Jasmin is skiing OR Bart is playing hockey
Resolution
1.5.3- Fallacies – ngụy biện – sai logic
 If you do every problem in this book then you will learn discrete
mathematic
You learned mathematic
(p → q) ^q
=(¬ p v q) ^ q
(absorption law)
= q
 No information for p
p can be true or false  You may learn discrete mathematic but you
might do some problems only.
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)
P(c)
Universal Instantiation
Cụ thể hóa lượng từ phổ dụng
P(c) for arbitrary c
xP(x)
Universal generalization
Tổng quát hóa bằng lượng từ phổ dụng
xP(x)
P(c) for some element c
Existential instantiation
Chuyên biệt hóa
P(c) for some element c
xP(x)
Existential generalization
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))
 P(HB) → Q(HB)
 P(HB)
 Q(HB) // conclusion
Premise
Universal Instantiation
Modus ponens
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

More Related Content

Similar to 1. Logic and Proofs.ppt

Discrete-Chapter 04 Logic Part II
Discrete-Chapter 04 Logic Part IIDiscrete-Chapter 04 Logic Part II
Discrete-Chapter 04 Logic Part IIWongyos Keardsri
 
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...mathsjournal
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDr. Khaled Bakro
 
lassomodel, sparsity, multivariate modeling, NIR spectroscopy, biodiesel from...
lassomodel, sparsity, multivariate modeling, NIR spectroscopy, biodiesel from...lassomodel, sparsity, multivariate modeling, NIR spectroscopy, biodiesel from...
lassomodel, sparsity, multivariate modeling, NIR spectroscopy, biodiesel from...mathsjournal
 
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and ProofsDiscrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and ProofsAmr Rashed
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicManjula V
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prologbaran19901990
 
UGC NET Computer Science & Application book.pdf [Sample]
UGC NET Computer Science & Application book.pdf  [Sample]UGC NET Computer Science & Application book.pdf  [Sample]
UGC NET Computer Science & Application book.pdf [Sample]DIwakar Rajput
 
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...mathsjournal
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
Unit 1-logic
Unit 1-logicUnit 1-logic
Unit 1-logicraksharao
 
Delayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsDelayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsChristian Robert
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 

Similar to 1. Logic and Proofs.ppt (20)

dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
 
Discrete-Chapter 04 Logic Part II
Discrete-Chapter 04 Logic Part IIDiscrete-Chapter 04 Logic Part II
Discrete-Chapter 04 Logic Part II
 
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
 
Formal Logic - Lesson 8 - Predicates and Quantifiers
Formal Logic - Lesson 8 - Predicates and QuantifiersFormal Logic - Lesson 8 - Predicates and Quantifiers
Formal Logic - Lesson 8 - Predicates and Quantifiers
 
chapter9.ppt
chapter9.pptchapter9.ppt
chapter9.ppt
 
Raices primitivas
Raices primitivasRaices primitivas
Raices primitivas
 
lassomodel, sparsity, multivariate modeling, NIR spectroscopy, biodiesel from...
lassomodel, sparsity, multivariate modeling, NIR spectroscopy, biodiesel from...lassomodel, sparsity, multivariate modeling, NIR spectroscopy, biodiesel from...
lassomodel, sparsity, multivariate modeling, NIR spectroscopy, biodiesel from...
 
Logic
LogicLogic
Logic
 
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and ProofsDiscrete Math Chapter 1 :The Foundations: Logic and Proofs
Discrete Math Chapter 1 :The Foundations: Logic and Proofs
 
L03 ai - knowledge representation using logic
L03 ai - knowledge representation using logicL03 ai - knowledge representation using logic
L03 ai - knowledge representation using logic
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prolog
 
UGC NET Computer Science & Application book.pdf [Sample]
UGC NET Computer Science & Application book.pdf  [Sample]UGC NET Computer Science & Application book.pdf  [Sample]
UGC NET Computer Science & Application book.pdf [Sample]
 
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
Fractional Newton-Raphson Method and Some Variants for the Solution of Nonlin...
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
Unit 1-logic
Unit 1-logicUnit 1-logic
Unit 1-logic
 
Delayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithmsDelayed acceptance for Metropolis-Hastings algorithms
Delayed acceptance for Metropolis-Hastings algorithms
 
Logic
LogicLogic
Logic
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
DS Lecture 2.ppt
DS Lecture 2.pptDS Lecture 2.ppt
DS Lecture 2.ppt
 

Recently uploaded

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 

Recently uploaded (20)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 

1. Logic and Proofs.ppt

  • 1. DISCRETE MATHEMATICS AND ITS APPLICATIONS Book: Discrete Mathematics and Its Applications Author: Kenneth H. Rosen Sixth Edition McGraw-Hill International Edition
  • 3. Objectives  Explain what makes up a correct mathematical argument  Introduce tools to construct arguments
  • 4. 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
  • 5. 1.1- Propositional Logic 1.1.1- Definitions and Truth Table 1.1.2- Precedence of Logical Operators
  • 6. 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 * 1+5 < 4 * What time is it? * X+Y=Z OK No OK
  • 7. 1.1.1- Definitions…  Truth table – I am a girl p True/ T / 1 False / F / 0
  • 8. 1.1.1- Definitions… p 1 0 0 1  Negation of propositions p is the statement “ It is not case that p”.  Notation: p (or ) p
  • 9. 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
  • 10. 1.1.1- Definitions…  Disjunction of propositions p and q is the proposition “ p or q” and denoted by p v q p q p q 0 0 0 0 1 1 1 0 1 1 1 1
  • 11. 1.1.1- Definitions…  Exclusive-or (xor) of propositions p and q, denoted by p  q  q p q p  q 0 0 0 0 1 1 1 0 1 1 1 0
  • 12. 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 0 0 1 0 1 1 1 0 0 1 1 1 “If 1 + 1 = 3, then dogs can fly” TRUE (p  q) p=0, q=0 , so (pq) is true.
  • 13. 1.1.1- Definitions…  Biconditional statement p q is the proposition “ p if and only if q”  p → q (p only if q) and p q (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
  • 14. 1.1.2- Precedence of Logical Operators (1) Parentheses from inner to outer (2) ¬ (3) ^ (4) v (5) → (6) ↔
  • 15. 1.2- Propositional Equivalences 1.2.1- Tautology and Contradiction 1.2.2- Logical Equivalences 1.2.3- De Morgan’s Laws
  • 16. 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
  • 17. Example 3 p.23  Show that p  q and ¬p v q are logically equivalent.
  • 18. 1.2.2- Logical Equivalences… Equivalence Name p ^ T ≡ p p v F ≡ p Identity laws- Luật đồng nhất p v T ≡ T p ^ F ≡ F Domination Laws – Luật chi phối p v p ≡ p p ^ p ≡ p Idempotent Laws – Luật bất biến ¬(¬p) ≡ p Double Negation Laws – Luật đảo kép p v q ≡ q v p p ^ q ≡ q ^ p Commutative Laws – Luật giao hoán (p v q) v r ≡ p v (q v r) (p ^ q) ^ r ≡p^(q^r) Associative Laws – Luật kết hợp pv (q^r) ≡ (pvq) ^ (pvr) p^ (qvr) ≡ (p^q) v (p^r) Distributive Laws – Luật phân phối ¬ (p^q) ≡ ¬pv¬q ¬(pvq) ≡ ¬p^¬q De Morgan Laws pv (p^q)≡ p p^(pvq)≡ p Absorption Laws – Luật hấp thụ pv¬p ≡ T p^¬p≡ F Negation Laws - Luật nghịch đảo
  • 19. 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
  • 20. 1.3- Predicates and Quantifiers  Introduction  Predicates  Quantifiers
  • 21. 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.
  • 22. 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
  • 23.  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 – vị từ
  • 24. 1.3.2- Predicates…  Predicates are pre-conditions and post- conditions of a program.  If x>0 then x:=x+1 – Predicate: “x>0”  P(x) – Pre-condition: P(x) – Post-condition: P(x)  T:=X; X:=Y; Y:=T; - Pre-condition: “x=a and y=b”  P(x, y) - Post-condition: “x=b and y=a”  Q(x, y) Pre-condition (P(…)) : condition describes valid input. Post-condition (Q(…)) : condition describe valid output of the codes. Show the verification that a program always produces the desired output: P(…) is true Executing Step 1. Executing Step 2. ….. Q(…) is true
  • 25. 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 : xP(x)  Uniqueness quantifier: !x P(x) or 1xP(x)  xP(x) v Q(y) :  x is a bound variable  y is a free variable
  • 26. 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
  • 27. 1.3.5- Precedence of Quantifiers  Quantifier have higher precedence than all logical operators from propositional calculus.  xP(x) v Q(x)  (xP(x)) v Q(x)   has higher precedence. So,  affects on P(x) only.
  • 28. 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)
  • 29. 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))
  • 30. Negating nested quantifiers ¬ xy(xy=1) ≡ x ¬y (xy=1) // De Morgan laws ≡ (x) (y) ¬(xy=1) ≡ (x) (y) (xy  1)
  • 31. 1.5- Rules of Inference – Quy tắc diễn dịch  Definitions  Rules of Inferences
  • 32. 1.5.1- Definitions  Proposition 1 // Hypothesis – giả thiết  Proposition 2  Proposition 3  Proposition 4  Proposition 5  ………  Conclusion Argument s– suy luận Propositional Equivalences Arguments 2,3,4 are premises (tiên đề) of argument 5
  • 33. 1.5.2- Rules Inferences Rule Tautology Name p p →q q [p^ (p→q)] → q You work hard If you work hard then you will pass the examination you will pass the examination Modus ponen ¬q p → q ¬p [¬q ^(p → q)] → ¬p She did not get a prize If she is good at learning she will get a prize She is not good at learning Modus tollen p →q q →r p →r [(p →q) ^(q →r)] →(p→r) If the prime interest rate goes up then the stock prices go down. If the stock prices go down then most people are unhappy. If the prime interest rate goes up then most people are unhappy. Hypothetical syllolism – Tam đoạn luận giả thiết, Quy tắc bắc cầu Một ngôi nhà rẻ thì hiếm Cái gì hiếm thì đắt  Một ngôi nhà rẻ thì đắt. If Socrates is human, then Socrates is mortal. Socrates is human.  Socrates is mortal.
  • 34. Rules Inferences… Rule Tautology Name pvq ¬p q [(pvq) ^¬p] → q Power puts off or the lamp is malfunctional Power doesn’t put off the lamp is malfunctional Disjunctive syllogism p pvq p →(pvq) It is below freezing now It is below freezing now or raining now Addition p^q p (p^q) →p It is below freezing now and raining now It is below freezing now Simplication p q p^q [(p) ^(q)) → (p^q) Conjunction pvq ¬pvr qvr [(pvq) ^(¬pvr)] →(qvr) Jasmin is skiing OR it is not snowing It is snowing OR Bart is playing hockey Jasmin is skiing OR Bart is playing hockey Resolution
  • 35. 1.5.3- Fallacies – ngụy biện – sai logic  If you do every problem in this book then you will learn discrete mathematic You learned mathematic (p → q) ^q =(¬ p v q) ^ q (absorption law) = q  No information for p p can be true or false  You may learn discrete mathematic but you might do some problems only.
  • 36. 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
  • 37. 1.5.4- Rules of Inference for Quantified Statements Rule Name xP(x) P(c) Universal Instantiation Cụ thể hóa lượng từ phổ dụng P(c) for arbitrary c xP(x) Universal generalization Tổng quát hóa bằng lượng từ phổ dụng xP(x) P(c) for some element c Existential instantiation Chuyên biệt hóa P(c) for some element c xP(x) Existential generalization Khái quát hóa bằng lượng từ tồn tại
  • 38. 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))  P(HB) → Q(HB)  P(HB)  Q(HB) // conclusion Premise Universal Instantiation Modus ponens
  • 39. 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

Editor's Notes

  1. Aristotle (384 B.C – 322 B.C)