Tran Vinh TanContents Propositional Logic Chapter 1 Logics Discrete Mathematics I on 13 March 2012 Tran Vinh TanFaculty of Computer Science and Engineering University of Technology - VNU
Trang 1Some applications
Discrete mathematics I Introduction
Huynh Tuong Nguyen
Faculty of Computer Science and Engineering
Ho Chi Minh City University of Technology htnguyen@cse.hcmut.edu.vn
February 22, 2012
Trang 3Some applications Document
Trang 4Some applications Document
Subjects in general discrete mathematics course
Trang 5Some applications Document
Topics relational to discrete mathematics
1 Theoretical computer science
13 Operations research: scheduling
15 Discretization
16 Discrete analogues of continuous mathematics
17 .
Trang 6Some applications Document
directed, undirected, isomorphism
Weighted graphs, algorithm for finding shortest paths
Trees: features, binary trees, minimum spanning trees in connected and weighted graphs
Probabilistics Modelling
introductory random variables.
Trang 7Some applications Document
Document
Book
Discrete mathematics and applications - Kenneth H Rosen (Vietnamesetranslation - NXB KHKT 1997)
Discrete mathematics - Richard Johnsonbaugh, Willey, 1997
Discrete mathematics with algorithms - Micheal O Albertson & Joan P.Hutchinson, Willey, 1998
Trang 8today there is a remarkable variety of applications of mathematics in industry and government, such as materials processing, design, medical diagnosis, development of financial products, network management, weather prediction, etc.
Trang 9today there is a remarkable variety of applications of mathematics in industry and government, such as materials processing, design, medical diagnosis, development of financial products, network management, weather prediction, etc.
Engineers use technology, mathematics
and scientific knowledge to solve
practical problems (wikipedia.org)
Science
Technology
Engineering
Trang 10Some applications
Computing of algorithm complexity
Know results
Trang 13Some applications
Mathematical model
Exercise
A bookseller A buys books from two publishers B, and C.
Publisher B offers a package of 5 mysteries and 5 romance novels for $50, and publisher C offers a package of 5 mysteries and 10 romance novels for $150 The bookseller A wants to buy at least 2,500 mysteries and 3,500 romance novels, and he has promised C (who has influence on the Senate Textbook Committee) that at least 25% of the total number of books he purchases will come from publisher C.
Question How many packages should A order from each publisher
in order to minimize his cost and satisfy C ? What will the novels cost him?
Trang 15Some applications
Graph
Shortest path problem
Min cut and maximum flow
Vehicle Routing Problem
Trang 16Some applications
Graph
Shortest path problem
Min cut and maximum flow
Vehicle Routing Problem
Trang 17Some applications
Scheduling
Trang 18LetCi be completion time of jobJi and letTi = max(0,Ci− di)its tardiness.
Question How to minimizeTmax= maxiTi ? What is the minimum value of
Tmax ?
Trang 19an edge between Pi and Jj.
Trang 20an edge between Pi and Jj.
Trang 21Some applications
Game and simulation
Sally Salon Game
Trang 23Tran Vinh Tan
Contents Propositional Logic
Chapter 1
Logics
Discrete Mathematics I on 13 March 2012
Tran Vinh TanFaculty of Computer Science and Engineering
University of Technology - VNUHCM
Trang 24Tran Vinh Tan
Contents Propositional Logic
Contents
1 Propositional Logic
Trang 25Logics Tran Vinh Tan
Contents Propositional Logic
Logic
Definition (Averroes)
The tool for distinguishing between the trueand thefalse
Definition (Penguin Encyclopedia)
The formal systematic study of theprinciplesofvalid inference
andcorrect reasoning
Definition (Discrete Mathematics - Rosen)
Rules of logic are used to distinguish between valid and invalidmathematical arguments
Trang 26Logics Tran Vinh Tan
Contents Propositional Logic
Logic
Definition (Averroes)
The tool for distinguishing between the trueand thefalse
Definition (Penguin Encyclopedia)
The formal systematic study of theprinciplesofvalid inference
andcorrect reasoning
Definition (Discrete Mathematics - Rosen)
Rules of logic are used to distinguish between valid and invalidmathematical arguments
Trang 27Tran Vinh Tan
Contents Propositional Logic
Logic
Definition (Averroes)
The tool for distinguishing between the trueand thefalse
Definition (Penguin Encyclopedia)
The formal systematic study of theprinciplesofvalid inference
andcorrect reasoning
Definition (Discrete Mathematics - Rosen)
Rules of logic are used to distinguish between valid and invalid
mathematical arguments
Trang 28Logics Tran Vinh Tan
Contents Propositional Logic
Applications in Computer Science
• Design of computer circuits
• Construction of computer programs
• Verification of the correctness of programs
• Constructing proofs automatically
• Artificial intelligence
• Many more
Trang 29Logics Tran Vinh Tan
Contents Propositional Logic
Applications in Computer Science
• Design of computer circuits
• Construction of computer programs
• Verification of the correctness of programs
• Constructing proofs automatically
• Artificial intelligence
• Many more
Trang 30Logics Tran Vinh Tan
Contents Propositional Logic
Applications in Computer Science
• Design of computer circuits
• Construction of computer programs
• Verification of the correctness of programs
• Constructing proofs automatically
• Artificial intelligence
• Many more
Trang 31Logics Tran Vinh Tan
Contents Propositional Logic
Applications in Computer Science
• Design of computer circuits
• Construction of computer programs
• Verification of the correctness of programs
• Constructing proofs automatically
• Artificial intelligence
• Many more
Trang 32Logics Tran Vinh Tan
Contents Propositional Logic
Applications in Computer Science
• Design of computer circuits
• Construction of computer programs
• Verification of the correctness of programs
• Constructing proofs automatically
• Artificial intelligence
• Many more
Trang 33Tran Vinh Tan
Contents Propositional Logic
Applications in Computer Science
• Design of computer circuits
• Construction of computer programs
• Verification of the correctness of programs
• Constructing proofs automatically
• Artificial intelligence
• Many more
Trang 34Tran Vinh Tan
Contents Propositional Logic
Propositional Logic
Definition
Apropositionis a declarative sentence that is either true or false,
but not both
Examples
• Hanoi is the capital of Viet Nam
• New York City is the capital of USA
• 1 + 1 = 2
• 2 + 2 = 3
Trang 35Logics Tran Vinh Tan
Contents Propositional Logic
Examples
Examples (Which of these are propositions?)
• How easy is logic!
• Read this carefully
• H1 building is in Ho Chi Minh City
Trang 36Logics Tran Vinh Tan
Contents Propositional Logic
Examples
Examples (Which of these are propositions?)
• How easy is logic!
• Read this carefully
• H1 building is in Ho Chi Minh City
Trang 37Logics Tran Vinh Tan
Contents Propositional Logic
Examples
Examples (Which of these are propositions?)
• How easy is logic!
• Read this carefully
• H1 building is in Ho Chi Minh City
Trang 38Logics Tran Vinh Tan
Contents Propositional Logic
Examples
Examples (Which of these are propositions?)
• How easy is logic!
• Read this carefully
• H1 building is in Ho Chi Minh City
Trang 39Logics Tran Vinh Tan
Contents Propositional Logic
Examples
Examples (Which of these are propositions?)
• How easy is logic!
• Read this carefully
• H1 building is in Ho Chi Minh City
Trang 40Logics Tran Vinh Tan
Contents Propositional Logic
Examples
Examples (Which of these are propositions?)
• How easy is logic!
• Read this carefully
• H1 building is in Ho Chi Minh City
Trang 41Logics Tran Vinh Tan
Contents Propositional Logic
Examples
Examples (Which of these are propositions?)
• How easy is logic!
• Read this carefully
• H1 building is in Ho Chi Minh City
Trang 42Tran Vinh Tan
Contents Propositional Logic
Examples
Examples (Which of these are propositions?)
• How easy is logic!
• Read this carefully
• H1 building is in Ho Chi Minh City
Trang 43Logics Tran Vinh Tan
Contents Propositional Logic
Notations
• Propositions are denoted byp, q,
• Thetruth value(”chân trị”) istrue(T) orfalse(F)
Trang 44Tran Vinh Tan
Contents Propositional Logic
Notations
• Propositions are denoted byp, q,
• Thetruth value(”chân trị”) istrue(T) orfalse(F)
Trang 45Tran Vinh Tan
Contents Propositional Logic
Trang 46Logics Tran Vinh Tan
Contents Propositional Logic
Trang 47Tran Vinh Tan
Contents Propositional Logic
Trang 48Logics Tran Vinh Tan
Contents Propositional Logic
Operators
Exclusive OR- Tuyển loại : p ⊕ q
“p or q (but not both)”
Trang 49Tran Vinh Tan
Contents Propositional Logic
Operators
Exclusive OR- Tuyển loại : p ⊕ q
“p or q (but not both)”
Trang 50Logics Tran Vinh Tan
Contents Propositional Logic
More Expressions for Implication p → q
• If you get 100% on the final, you will get 10 grade
• If you feel asleep this afternoon, then 2 + 3 = 5
Trang 51Logics Tran Vinh Tan
Contents Propositional Logic
More Expressions for Implication p → q
• If you get 100% on the final, you will get 10 grade
• If you feel asleep this afternoon, then 2 + 3 = 5
Trang 52Logics Tran Vinh Tan
Contents Propositional Logic
More Expressions for Implication p → q
• If you get 100% on the final, you will get 10 grade
• If you feel asleep this afternoon, then 2 + 3 = 5
Trang 53Logics Tran Vinh Tan
Contents Propositional Logic
More Expressions for Implication p → q
• If you get 100% on the final, you will get 10 grade
• If you feel asleep this afternoon, then 2 + 3 = 5
Trang 54Logics Tran Vinh Tan
Contents Propositional Logic
More Expressions for Implication p → q
• If you get 100% on the final, you will get 10 grade
• If you feel asleep this afternoon, then 2 + 3 = 5
Trang 55Tran Vinh Tan
Contents Propositional Logic
More Expressions for Implication p → q
• If you get 100% on the final, you will get 10 grade
• If you feel asleep this afternoon, then 2 + 3 = 5
Trang 56Logics Tran Vinh Tan
Contents Propositional Logic
Conditional Statements From p → q
• q → p (converse- đảo)
• ¬q → ¬p (contrapositive- phản đảo)
• Prove that only contrapositive have the same truth table with
p → q
Trang 57Logics Tran Vinh Tan
Contents Propositional Logic
Conditional Statements From p → q
• q → p (converse- đảo)
• ¬q → ¬p (contrapositive- phản đảo)
• Prove that only contrapositive have the same truth table with
p → q
Trang 58Tran Vinh Tan
Contents Propositional Logic
Conditional Statements From p → q
• q → p (converse- đảo)
• ¬q → ¬p (contrapositive- phản đảo)
• Prove that only contrapositive have the same truth table with
p → q
Trang 59Logics Tran Vinh Tan
Contents Propositional Logic
Exercise
What are theconverseandcontrapositiveof the following
conditional statement
“If he plays online games too much, his girlfriend leaves him.”
• Converse:If his girlfriend leaves him, then he plays online
games too much
• Contrapositive:If his girlfriend does not leave him, then hedoes not play online games too much
Trang 60Tran Vinh Tan
Contents Propositional Logic
Exercise
What are theconverseandcontrapositiveof the following
conditional statement
“If he plays online games too much, his girlfriend leaves him.”
• Converse:If his girlfriend leaves him, then he plays online
games too much
• Contrapositive:If his girlfriend does not leave him, then he
does not play online games too much
Trang 61Logics Tran Vinh Tan
Contents Propositional Logic
• “p isnecessary and sufficientfor q”
• “if p then q, andconversely”
• “piffq”
Trang 62Logics Tran Vinh Tan
Contents Propositional Logic
• “p isnecessary and sufficientfor q”
• “if p then q, andconversely”
• “piffq”
Trang 63Logics Tran Vinh Tan
Contents Propositional Logic
• “p isnecessary and sufficientfor q”
• “if p then q, andconversely”
• “piffq”
Trang 64Logics Tran Vinh Tan
Contents Propositional Logic
• “p isnecessary and sufficientfor q”
• “if p then q, andconversely”
• “piffq”
Trang 65Logics Tran Vinh Tan
Contents Propositional Logic
• “p isnecessary and sufficientfor q”
• “if p then q, andconversely”
• “piffq”
Trang 66Tran Vinh Tan
Contents Propositional Logic
• “p isnecessary and sufficientfor q”
• “if p then q, andconversely”
• “piffq”
Trang 67Logics Tran Vinh Tan
Contents Propositional Logic
Translating Natural Sentences
Exercise
I will buy a new phone only ifI have enough money to buy iPhone
4 ormy phone is not working
• p: I will buy a new phone
• q: I have enough money to buy iPhone 4
• r: My phone is working
• p → (q ∨ ¬r)
Trang 68Logics Tran Vinh Tan
Contents Propositional Logic
Translating Natural Sentences
Exercise
I will buy a new phone only ifI have enough money to buy iPhone
4 ormy phone is not working
• p: I will buy a new phone
• q: I have enough money to buy iPhone 4
• r: My phone is working
• p → (q ∨ ¬r)
Trang 69Logics Tran Vinh Tan
Contents Propositional Logic
Translating Natural Sentences
Exercise
I will buy a new phone only ifI have enough money to buy iPhone
4 ormy phone is not working
• p: I will buy a new phone
• q: I have enough money to buy iPhone 4
• r: My phone is working
• p → (q ∨ ¬r)
Trang 70Logics Tran Vinh Tan
Contents Propositional Logic
Translating Natural Sentences
Exercise
I will buy a new phone only ifI have enough money to buy iPhone
4 ormy phone is not working
• p: I will buy a new phone
• q: I have enough money to buy iPhone 4
• r: My phone is working
• p → (q ∨ ¬r)
Trang 71Tran Vinh Tan
Contents Propositional Logic
Translating Natural Sentences
Exercise
I will buy a new phone only ifI have enough money to buy iPhone
4 ormy phone is not working
• p: I will buy a new phone
• q: I have enough money to buy iPhone 4
• r: My phone is working
• p → (q ∨ ¬r)
Trang 72Tran Vinh Tan
Contents Propositional Logic
Translating Natural Sentences
Exercise
He will not run the red light if he sees the police unless he is too
risky
Trang 73Logics Tran Vinh Tan
Contents Propositional Logic
Construct Truth Table
Trang 74Tran Vinh Tan
Contents Propositional Logic
Construct Truth Table
Trang 75Logics Tran Vinh Tan
Contents Propositional Logic
• type “dai hoc bach khoa” in Google
• means “daiANDhocANDbachANDkhoa”
Trang 76Logics Tran Vinh Tan
Contents Propositional Logic
• type “dai hoc bach khoa” in Google
• means “daiANDhocANDbachANDkhoa”
Trang 77Logics Tran Vinh Tan
Contents Propositional Logic
• type “dai hoc bach khoa” in Google
• means “daiANDhocANDbachANDkhoa”
Trang 78Tran Vinh Tan
Contents Propositional Logic
• type “dai hoc bach khoa” in Google
• means “daiANDhocANDbachANDkhoa”
Trang 79Tran Vinh Tan
Contents Propositional Logic
• type “dai hoc bach khoa” in Google
• means “daiANDhocANDbachANDkhoa”
Trang 80Logics Tran Vinh Tan
Contents Propositional Logic
Applications (cont.)
• Logic puzzles
• There are two kinds of inhabitants on an island,knights, who
always tell the truth, and their opposites,knaves, who always
lie You encounter two people A and B What are A and B if
A says“ B is a knight” and B says”The two of us are
opposite types”?
• Bit operations
• 101010011is a bit string of length nine
Trang 81Tran Vinh Tan
Contents Propositional Logic
Applications (cont.)
• Logic puzzles
• There are two kinds of inhabitants on an island,knights, who
always tell the truth, and their opposites,knaves, who always
lie You encounter two people A and B What are A and B if
A says“ B is a knight” and B says”The two of us are
opposite types”?
• Bit operations
• 101010011is a bit string of length nine
Trang 82Logics Tran Vinh Tan
Contents Propositional Logic
Tautology and Contradiction
Trang 83Logics Tran Vinh Tan
Contents Propositional Logic
Tautology and Contradiction
Trang 84Logics Tran Vinh Tan
Contents Propositional Logic
Tautology and Contradiction
Trang 85Tran Vinh Tan
Contents Propositional Logic
Tautology and Contradiction
Trang 86Logics Tran Vinh Tan
Contents Propositional Logic
Trang 87Tran Vinh Tan
Contents Propositional Logic
Trang 88Logics Tran Vinh Tan
Contents Propositional Logic