SlideShare a Scribd company logo
1 of 30
Foundations of Logic
1.1
Logic of Statements
 Logical Form
 Conditional statement
 Logical Equivalence
Recall: Logical Form
 Statement (proposition)
 is a sentence that is true or false but not both
 Connectives
 And, or, xor,…
 Compound statement
 is a statement built out of simple statements using
logical operations or connectives: negation,
conjunction, disjunction
Recall: Some Popular Boolean
Operators
Formal Name Nickname Arity Symbol
Negation operator NOT Unary ¬
Conjunction operator AND Binary 
Disjunction operator OR Binary 
Exclusive-OR operator XOR Binary 
Implication operator IMPLIES Binary 
Biconditional operator IFF Binary ↔
Topic #1.0 – Propositional Logic: Operators
Recall Truth Tables
Formal Name Nickname Arity Symbol
Negation operator NOT Unary ¬
Conjunction operator AND Binary 
Disjunction operator OR Binary 
Exclusive-OR operator XOR Binary 
Topic #1.0 – Propositional Logic: Operators
Recall: Translating Sentences to
Propositional logic
Problem: Translate the following sentence into
propositional logic:
“If you can access the Internet from campus only if
you are a computer science major or you are not a
freshman.”
One Solution: Let a, c, and f represent
respectively “You can access the internet from
campus,” “You are a computer science major,” and
“You are a freshman.”  
a c f
  
Tips for Translating English Sentences
Steps to convert an English sentence to a
statement in propositional logic
• Identify atomic propositions and represent using
propositional variables.
• Determine appropriate logical connectives
“If I go to Harry’s or to the country, I will not
go shopping.”
• p: I go to Harry’s
• q: I go to the country.
• r: I will go shopping.
If p or q then not r.
 
p q r
  
Logic of Statements
 Logical Form
 Conditional statement
 Logical Equivalence
Conditional Operator 
 You play football in the evening, if you study in the afternoon.
 p=you study in the afternoon
 q=you play football in the evening
 The order of p and q is important, what is it?
 p is the antecedent. q is the consequent.
 There are four possible outcomes of this:
 you study in the afternoon, and play football in the evening
(p is true and q is true)
 p q is true.
Conditional Operator 
 you study on the afternoon, but do not play football on the
evening (p is true and q is false)
 p  q is false. This means that, the condition (You play football on
the evening, if you study on the afternoon. ) is violated.
 you do not study on the afternoon, yet you play football on the
evening. (p is false and q is true)
 p q is true. The conditional statement (that You play football on
the evening, if you study on the afternoon.) has not been violated,
because violation only occurs if the antecedent is true.
 You do not play football on the evening, and you do not study
on the afternoon. (p is false and q is false)
 p q is true. The conditional statement (that You play football on
the evening, if you study on the afternoon. ) has not been violated,
because violation only occurs if the antecedent is true.
1/21/2024
10
Conditional Operator : Truth
Table
p q p  q
T T T
T F F
F T T
F F T
1/21/2024
11
Examples of Implications
 “If this lecture ever ends, then the sun will rise
tomorrow.” True or False?
 “If 2+1=6, then Rashed Elmajed is a singer.”
True or False?
 “If the moon is made of green cheese, then I will
never get old.” True or False?
Topic #1.0 – Propositional Logic: Operators
Converse, Inverse, Contrapositive
 Some terminology, for an implication p  q:
 Its converse is: q  p.
 Its inverse is: ¬p  ¬q.
 Its contrapositive: ¬q  ¬ p.
Topic #1.0 – Propositional Logic: Operators
Example on contrapositive and
converse
 Write down English sentences for the converse and the
contrapositive of: ‘If 250 is divisible by 4 then 250 is an even
number.’
 The sentence can be written as pq, where
 p denotes ‘250 is divisible by 4’
 and q denotes ‘250 is an even number’.
 The converse is q p, which we can write in English as
follows:
 ‘If 250 is an even number then 250 is divisible by 4.’
 The contrapositive is ¬q ¬p, which we write as follows:
 ‘If 250 is not an even number then 250 is not divisible by 4.’
 The Inverse? (Homework) 1/21/2024
14
Converse, Inverse, Contrapositive
 Some terminology, for an implication p  q:
 Its converse is: q  p.
 Its inverse is: ¬p  ¬q.
 Its contrapositive: ¬q  ¬ p.
 One of these three has the same meaning (same
truth table) as p  q. Can you figure out which?
Topic #1.0 – Propositional Logic: Operators
Logic of Statements
 Logical Form
 Conditional Statements
 Logical Equivalence
Logical Equivalence: p ↔ q
 The bi-conditional operator ↔ :
 It is called Logical Equivalence
 Also called if and only if
 Logical equivalence means that the truth values of two statements are the
same.
 This means that p ↔ q TRUE means that the truth values of p and q are
the same.
 When is the following an equivalence
 "You will see the magazine if and only if someone show it to you”
 If someone shows you the magazine and you see it, the statement is true.
 If someone shows you the magazine and you do not see it, the statement
is false because it is violated.
 If no one shows you the magazine and you see it, the biconditional
statement is false because it is violated.
 If no one shows you the magazine and you do not see it, the statement is
true.
1/21/2024
17
Logical Equivalence p ↔ q: truth
table
p q p ↔ q
T T T
T F F
F T F
F F T
1/21/2024
18
Contrapositive
 Is
p  q ↔ ¬q  ¬ p
How can we prove it?
 Homework: What about the converse?
1/21/2024
19
How do we know for sure?
 Proving the equivalence of p  q and its
contrapositive using truth tables:
p q q p pq q p
F F T T T T
F T F T T T
T F T F F F
T T F F T T
Topic #1.0 – Propositional Logic: Operators
Summary
1/21/2024
21
Conditional Inverse Converse Contrapositive
p q p q pq pq qp qp
T T F F T T T T
T F F T F T T F
F T T F T F F T
F F T T T T T T
Homework
 The bi-conditional statement ↔ is logically
equivalent to
1/21/2024
22
Boolean Operations Summary
 We have seen
1 unary operator and
5 binary operators
Their truth tables are below.
p q p pq pq pq pq pq
F F T F F F T T
F T T F T T T F
T F F F T T F F
T T F T T F T T
Topic #1.0 – Propositional Logic: Operators
Compound propositions
 Compound = More than one operation.
 Find truth table
 (pVq)(~p^ ~q)
Topic #1.0 – Propositional Logic: Operators
Nested Propositional Expressions
 Use parentheses to group sub-expressions:
“I just saw my old friend, and either he’s grown or
I’ve shrunk.”
 f  (g  s)
 (f  g)  s would mean something different
 f  g  s would be ambiguous
Topic #1.0 – Propositional Logic: Operators
Precedence of operators
 Just as in algebra, operators have precedence
 4+3*2 = 4+(3*2), not (4+3)*2
 Precedence order (from highest to lowest):
¬   → ↔
 The first three are the most important
 How to interpret: p  q  ¬r → s ↔ t
 yields: (p  (q  (¬r)) → s) ↔ (t)
 Not is always performed before any other
operation
1/21/2024
26
A Simple Exercise
 Let
p=“It rained last night”,
q=“The sprinklers came on last night,”
r=“The lawn was wet this morning.”
 Translate each of the following into English:
 ¬p =
 r  ¬p =
 ¬ r  p  q =
“It didn’t rain last night.”
“The lawn was wet this morning, and
it didn’t rain last night.”
“Either the lawn wasn’t wet this
morning, or it rained last night, or the
sprinklers came on last night.”
Topic #1.0 – Propositional Logic: Operators
 Ex. Prove that pq  (p  q).
p q p
p
q
q 
p
p 
q
q 
p
p 
 
q
q 
(
(
p
p 
 
q
q)
)
F F
F T
T F
T T
In class exercise: Proving
Equivalence
via Truth Tables
F
T
T
T
T
T
T
T
T
T
F
F
F
F
F
F
F
F
T
T
Topic #1.1 – Propositional Logic: Equivalences
Homework: Prove the following
 pT  p
 pF  F
 pp  p
 p  p
 (pq)r  p(qr)
 (pq)  p  q
 p  p  T p  p  F
Topic #1.1 – Propositional Logic: Equivalences
Homework 1.1
 4,10, 13, 14, 19, 25, 28, 29, 30, 31,33-41
 43
1/21/2024
30

More Related Content

Similar to Propositional logic in Discretes tructures.pptx

MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdfjayarao21
 
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
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptNandiniSR2
 
Basic Connectives and Truth Tables.ppt
Basic Connectives and Truth Tables.pptBasic Connectives and Truth Tables.ppt
Basic Connectives and Truth Tables.pptsamalaramesh4
 
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
 
Laws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applicationsLaws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applicationsZenLooper
 
logicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdflogicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdfPradeeshSAI
 
Mathematical Logic
Mathematical LogicMathematical Logic
Mathematical LogicJoey Valdriz
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicTaymoor Nazmy
 

Similar to Propositional logic in Discretes tructures.pptx (20)

logic_lec4.ppt
logic_lec4.pptlogic_lec4.ppt
logic_lec4.ppt
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdf
 
CS202Ch1.ppt
CS202Ch1.pptCS202Ch1.ppt
CS202Ch1.ppt
 
02-boolean.ppt
02-boolean.ppt02-boolean.ppt
02-boolean.ppt
 
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 د. خالد بكرو
 
Dscrete structure
Dscrete  structureDscrete  structure
Dscrete structure
 
Discrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.pptDiscrete mathematics Chapter1 presentation.ppt
Discrete mathematics Chapter1 presentation.ppt
 
Basic Connectives and Truth Tables.ppt
Basic Connectives and Truth Tables.pptBasic Connectives and Truth Tables.ppt
Basic Connectives and Truth Tables.ppt
 
Logic&proof
Logic&proofLogic&proof
Logic&proof
 
L2.pdf
L2.pdfL2.pdf
L2.pdf
 
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]
 
Laws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applicationsLaws of Logic in Discrete Structures and their applications
Laws of Logic in Discrete Structures and their applications
 
Logic
LogicLogic
Logic
 
DS Lecture 2.ppt
DS Lecture 2.pptDS Lecture 2.ppt
DS Lecture 2.ppt
 
logicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdflogicproof-141212042039-conversion-gate01.pdf
logicproof-141212042039-conversion-gate01.pdf
 
DISMATH_Part1
DISMATH_Part1DISMATH_Part1
DISMATH_Part1
 
Mathematical Logic
Mathematical LogicMathematical Logic
Mathematical Logic
 
AppTheories_L3
AppTheories_L3AppTheories_L3
AppTheories_L3
 
Per3 logika&pembuktian
Per3 logika&pembuktianPer3 logika&pembuktian
Per3 logika&pembuktian
 
Artificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logicArtificial intelligent Lec 5-logic
Artificial intelligent Lec 5-logic
 

Recently uploaded

Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

Propositional logic in Discretes tructures.pptx

  • 2. Logic of Statements  Logical Form  Conditional statement  Logical Equivalence
  • 3. Recall: Logical Form  Statement (proposition)  is a sentence that is true or false but not both  Connectives  And, or, xor,…  Compound statement  is a statement built out of simple statements using logical operations or connectives: negation, conjunction, disjunction
  • 4. Recall: Some Popular Boolean Operators Formal Name Nickname Arity Symbol Negation operator NOT Unary ¬ Conjunction operator AND Binary  Disjunction operator OR Binary  Exclusive-OR operator XOR Binary  Implication operator IMPLIES Binary  Biconditional operator IFF Binary ↔ Topic #1.0 – Propositional Logic: Operators
  • 5. Recall Truth Tables Formal Name Nickname Arity Symbol Negation operator NOT Unary ¬ Conjunction operator AND Binary  Disjunction operator OR Binary  Exclusive-OR operator XOR Binary  Topic #1.0 – Propositional Logic: Operators
  • 6. Recall: Translating Sentences to Propositional logic Problem: Translate the following sentence into propositional logic: “If you can access the Internet from campus only if you are a computer science major or you are not a freshman.” One Solution: Let a, c, and f represent respectively “You can access the internet from campus,” “You are a computer science major,” and “You are a freshman.”   a c f   
  • 7. Tips for Translating English Sentences Steps to convert an English sentence to a statement in propositional logic • Identify atomic propositions and represent using propositional variables. • Determine appropriate logical connectives “If I go to Harry’s or to the country, I will not go shopping.” • p: I go to Harry’s • q: I go to the country. • r: I will go shopping. If p or q then not r.   p q r   
  • 8. Logic of Statements  Logical Form  Conditional statement  Logical Equivalence
  • 9. Conditional Operator   You play football in the evening, if you study in the afternoon.  p=you study in the afternoon  q=you play football in the evening  The order of p and q is important, what is it?  p is the antecedent. q is the consequent.  There are four possible outcomes of this:  you study in the afternoon, and play football in the evening (p is true and q is true)  p q is true.
  • 10. Conditional Operator   you study on the afternoon, but do not play football on the evening (p is true and q is false)  p  q is false. This means that, the condition (You play football on the evening, if you study on the afternoon. ) is violated.  you do not study on the afternoon, yet you play football on the evening. (p is false and q is true)  p q is true. The conditional statement (that You play football on the evening, if you study on the afternoon.) has not been violated, because violation only occurs if the antecedent is true.  You do not play football on the evening, and you do not study on the afternoon. (p is false and q is false)  p q is true. The conditional statement (that You play football on the evening, if you study on the afternoon. ) has not been violated, because violation only occurs if the antecedent is true. 1/21/2024 10
  • 11. Conditional Operator : Truth Table p q p  q T T T T F F F T T F F T 1/21/2024 11
  • 12. Examples of Implications  “If this lecture ever ends, then the sun will rise tomorrow.” True or False?  “If 2+1=6, then Rashed Elmajed is a singer.” True or False?  “If the moon is made of green cheese, then I will never get old.” True or False? Topic #1.0 – Propositional Logic: Operators
  • 13. Converse, Inverse, Contrapositive  Some terminology, for an implication p  q:  Its converse is: q  p.  Its inverse is: ¬p  ¬q.  Its contrapositive: ¬q  ¬ p. Topic #1.0 – Propositional Logic: Operators
  • 14. Example on contrapositive and converse  Write down English sentences for the converse and the contrapositive of: ‘If 250 is divisible by 4 then 250 is an even number.’  The sentence can be written as pq, where  p denotes ‘250 is divisible by 4’  and q denotes ‘250 is an even number’.  The converse is q p, which we can write in English as follows:  ‘If 250 is an even number then 250 is divisible by 4.’  The contrapositive is ¬q ¬p, which we write as follows:  ‘If 250 is not an even number then 250 is not divisible by 4.’  The Inverse? (Homework) 1/21/2024 14
  • 15. Converse, Inverse, Contrapositive  Some terminology, for an implication p  q:  Its converse is: q  p.  Its inverse is: ¬p  ¬q.  Its contrapositive: ¬q  ¬ p.  One of these three has the same meaning (same truth table) as p  q. Can you figure out which? Topic #1.0 – Propositional Logic: Operators
  • 16. Logic of Statements  Logical Form  Conditional Statements  Logical Equivalence
  • 17. Logical Equivalence: p ↔ q  The bi-conditional operator ↔ :  It is called Logical Equivalence  Also called if and only if  Logical equivalence means that the truth values of two statements are the same.  This means that p ↔ q TRUE means that the truth values of p and q are the same.  When is the following an equivalence  "You will see the magazine if and only if someone show it to you”  If someone shows you the magazine and you see it, the statement is true.  If someone shows you the magazine and you do not see it, the statement is false because it is violated.  If no one shows you the magazine and you see it, the biconditional statement is false because it is violated.  If no one shows you the magazine and you do not see it, the statement is true. 1/21/2024 17
  • 18. Logical Equivalence p ↔ q: truth table p q p ↔ q T T T T F F F T F F F T 1/21/2024 18
  • 19. Contrapositive  Is p  q ↔ ¬q  ¬ p How can we prove it?  Homework: What about the converse? 1/21/2024 19
  • 20. How do we know for sure?  Proving the equivalence of p  q and its contrapositive using truth tables: p q q p pq q p F F T T T T F T F T T T T F T F F F T T F F T T Topic #1.0 – Propositional Logic: Operators
  • 21. Summary 1/21/2024 21 Conditional Inverse Converse Contrapositive p q p q pq pq qp qp T T F F T T T T T F F T F T T F F T T F T F F T F F T T T T T T
  • 22. Homework  The bi-conditional statement ↔ is logically equivalent to 1/21/2024 22
  • 23. Boolean Operations Summary  We have seen 1 unary operator and 5 binary operators Their truth tables are below. p q p pq pq pq pq pq F F T F F F T T F T T F T T T F T F F F T T F F T T F T T F T T Topic #1.0 – Propositional Logic: Operators
  • 24. Compound propositions  Compound = More than one operation.  Find truth table  (pVq)(~p^ ~q) Topic #1.0 – Propositional Logic: Operators
  • 25. Nested Propositional Expressions  Use parentheses to group sub-expressions: “I just saw my old friend, and either he’s grown or I’ve shrunk.”  f  (g  s)  (f  g)  s would mean something different  f  g  s would be ambiguous Topic #1.0 – Propositional Logic: Operators
  • 26. Precedence of operators  Just as in algebra, operators have precedence  4+3*2 = 4+(3*2), not (4+3)*2  Precedence order (from highest to lowest): ¬   → ↔  The first three are the most important  How to interpret: p  q  ¬r → s ↔ t  yields: (p  (q  (¬r)) → s) ↔ (t)  Not is always performed before any other operation 1/21/2024 26
  • 27. A Simple Exercise  Let p=“It rained last night”, q=“The sprinklers came on last night,” r=“The lawn was wet this morning.”  Translate each of the following into English:  ¬p =  r  ¬p =  ¬ r  p  q = “It didn’t rain last night.” “The lawn was wet this morning, and it didn’t rain last night.” “Either the lawn wasn’t wet this morning, or it rained last night, or the sprinklers came on last night.” Topic #1.0 – Propositional Logic: Operators
  • 28.  Ex. Prove that pq  (p  q). p q p p q q  p p  q q  p p    q q  ( ( p p    q q) ) F F F T T F T T In class exercise: Proving Equivalence via Truth Tables F T T T T T T T T T F F F F F F F F T T Topic #1.1 – Propositional Logic: Equivalences
  • 29. Homework: Prove the following  pT  p  pF  F  pp  p  p  p  (pq)r  p(qr)  (pq)  p  q  p  p  T p  p  F Topic #1.1 – Propositional Logic: Equivalences
  • 30. Homework 1.1  4,10, 13, 14, 19, 25, 28, 29, 30, 31,33-41  43 1/21/2024 30

Editor's Notes

  1. 1/21/2024
  2. 1/21/2024
  3. Only if is different from if. We will discuss this in class next time.
  4. 1/21/2024
  5. 1/21/2024
  6. 1/21/2024
  7. 1/21/2024
  8. 1/21/2024
  9. 1/21/2024
  10. 1/21/2024
  11. 1/21/2024
  12. 1/21/2024
  13. 1/21/2024