Discrete Mathematics: Chapter 1 The Foundations: Logic and Proofs: Propositional Logic

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 26

Instructor:

Discrete Mathematics  Dr Ghulam Mustafa

Chapter 1 The Foundations: Logic and Proofs:


Propositional Logic 
Propositional Logic

• The rules of logic give precise meaning to


mathematical statements.
• Distinguish between valid and invalid
mathematical arguments
• Logic has numerous applications to computer
science. These rules are used in the design of
computer circuits, the construction of computer
programs, the verification of the correctness of
programs, and in many other ways.
Propositions

• A proposition is a declarative sentence that


is either true or false, but not both.
Washington, D.C., is the capital of the United States
of America.
Toronto is the capital of Canada.
1 + 1 = 2.
2 + 2 = 3.
Propositions

1. What time is it?


2. Read this carefully.
3. x + 1 = 2.
4. x + y = z.
Proposition

• We can use variables to denote


propositions 
• p: “1 + 1 = 2.” 
• q: “You get an A in this course.” 
• Truth Value 
• If a proposition is true, we say its truth value is
true, and is denoted by T 
• Else, its truth value is false, and is denoted by F 
Compound Propositions using Logical Operators 

• We can create new proposition from the existing


ones, by using logical operators known as
compound propositions
1. Negation 
• Let p be a proposition. The negation of p, denoted by
⌝ p, is the statement  “It is not the case that p.” 
• The truth value of ⌝ p is the opposite of the truth
value of p. 
Test Your Understanding 

• What is the negation of the following


propositions? Express them in simple
English. 
• Ali’s PC runs Windows 10. 
• Ali’s PC has at least 32GB of memory. 
Compound Propositions using Logical Operators 

2. Conjunction 
Let p and q be propositions. 
The conjunction of p and q, 
denoted by p ⌃ q, is the proposition 
“p and q.” 
The truth value of p ⌃ q is true if both p and q
are true. Otherwise, it is false. 
Test Your Understanding 

• What is the conjunction of the following


propositions? Express them in simple
English. 
• Kai is the lecturer of this course. 
• This course is held on Monday and Friday 
Compound Propositions using Logical Operators 

3. Disjunction 
Let p and q be propositions. 
The disjunction of p and q, 
denoted by p ⌄ q, is the proposition 
“p or q.” 
The truth value of p ⌄ q is false if both p and q are
false. Otherwise, it is true. 
Test Your Understanding 

• What is the disjunction of the following


propositions? Express them in simple
English. 
• Students from PUGC can take this class. 
• Students from PUCIT can take this class. 
Compound Propositions using Logical Operators 

4. Exclusive Or 
Let p and q be propositions. 
The exclusive or of p and q, 
denoted by p ⊕ q, is the proposition 
“either p or q, but not both.” 
The truth value of p ⊕ q is true if exactly one of p
and q is true. Else, it is false. 
Truth Table 

• A convenient way to see the effect of the logical operators is by


using a truth table 
• •The truth table for negation of p is as follows: 

p ⌝p
T F
F T
Truth Table 

• The truth table for p ⌃ q is as follows: 

p q p⌃q
T T T
T F F
F T F
F F F
Truth table

• How about p ⌄ q and p ⊕ q? 

p q p⌄q p q p⊕q
T T T T T F
T F T T F T
F T T F T T
F F F F F F
Compound Propositions using Logical Operators 

5. Conditional Statement 
Let p and q be propositions. 
• The conditional statement p → q , is the
proposition
“if p, then q.”
•  The truth value of p → q is false if p is true and
q is false. Else, it is true. 
More on Conditional Statement 

• In the proposition p → q, 


• p is called the hypothesis, or the premise 
• q is called the conclusion 

• Many arguments in mathematical reasoning involve conditional


statements, and there are many “if p, then q” “a sufficient condition for q is p”
equivalent ways to express p → q  “if p, q” “q if p”
“p is sufficient for q” “q whenever p”
“p implies q” “q when p”
“p only if q” “q is necessary for p”
“a necessary condition for p is q”
“q follows from p”
“q unless ⌝p”
Truth Table 

• The truth table for p → q is as follows: 

p  q  p → q 
T  T  T 
T  F  F 
F  T  T 
F  F  T 
Test Your Understanding 

•  Let p be the statement “Maria learns discrete


mathematics” and q the statement “Maria will find a good
job.” Express the statement p → q as a statement in
English.
• “If Maria learns discrete mathematics, then she will find a good job.”
• “Maria will find a good job when she learns discrete mathematics.”
• “For Maria to get a good job, it is sufficient for her to learn discrete
mathematics.”
• “Maria will find a good job unless she does not learn discrete
mathematics.”
More on Conditional Statement 

• Three special propositions are related to the conditional


statement p → q 
1.The converse of p → q : q → p 
2.The contrapositive of p → q : ⌝ q → ⌝ p 
3.The inverse of p → q : ⌝ p → ⌝ q 

• What are the converse, contrapositive, and inverse of


the following conditional statement? 
• “If it rains, Ali orders pizza as his lunch” 
Compound Propositions using Logical Operators 

6. Bi-conditional Statement 
Let p and q be propositions. 
• The bi-conditional statement p ↔ q, is the proposition 
“p if and only if q.” 
• The truth value of p ↔ q is true if p and q have the same
truth value. Else, false. 
• Some common ways to represent bi-conditional statement
• “p is necessary and sufficient for q”
• “if p then q, and conversely”
• “p iff q.”
Test Your Understanding

• Let p be the statement “You can take the


flight,” and let q be the statement “You buy
a ticket.”
• Then p ↔ q is the statement
• “You can take the flight if and only if you
buy a ticket.”
Truth Table

• The truth table for p ↔ q is as follows: 

p q p↔q
T T T
T F F
F T F
F F T
Compound Propositions 

• Using the logical operators, we can build up


complicated compound propositions that involves
any number of propositions 
• Again, we can use truth table to see the truth
values of a compound proposition, under all
possible combinations of the truth values of the
basic simple propositions
Example

• The truth table for the compound proposition 


• ( p ⌄ ⌝q ) → ( p ⌃ q ) 

p q ⌝q ( p ⌄ ⌝q ) p⌃q ( p ⌄ ⌝q ) → ( p ⌃ q ) 

T T F T T T
T F T T F F
F T F F F T
F F T T F F
Precedence of Logical Operators 

Operator Precedence
⌝ 1
⌃ 2
⌄ 3
→ 4
↔ 5

Examples: p ∧ q ∨ r means (p ∧ q) ∨ r
, p ∨ q → r is the same as (p ∨ q) → r

You might also like