SlideShare a Scribd company logo
1 of 28
Discrete Mathematics
 Propositional Logic
        Harshit Kumar




Slides borrowed from Wong Chung Hoi of CUHK
Agenda
•   Proposition (Statement)
•   Logic Operators
•   Logical formula
•   Problems
    – Proofing formula
    – Constructing formula from truth table
    – Simplifying formula
Proposition (Statement)
• A sentence that is either TURE or FALSE
   –   1 + 1 = 2.
   –   1 + 1 = 3.
   –   Let’s end the tutorial now.
   –   This tutorial is boring.
   –   Wake up and listen to me!
   –   There are no aliens.
   –   x > 0.
   –   He is handsome.        ?
• Tautology – proposition that is always true
• Contradiction – proposition that is always false
He has courage!
                 ?
This man has courage!
I love bowling!
You are doing it wrong!
                                      ?
Your way of pretending to be a penguin is wrong!
Agenda
•   Proposition (Statement)
•   Logic Operators
•   Logical formula
•   Problems
    – Proofing formula
    – Constructing formula from truth table
    – Simplifying formula
Logic Operators
• Let p and q be a proposition.
• Operators:
  – Negation
  – Conjunction
  – Disjunction
  – Conditional
  – Bi-conditional
Negation (NOT)
• Negation (NOT)
  – Flip the truth value.




• Example:
  – p: My car is blue.      ¬p: My car is not blue.
  – p: Peter is good.       ¬p: Peter is not good.
  – p: 10 > 15.             ¬p: 10 < 15 or 10 = 15
p: 49% different is a lot
¬p: 49% different is not a lot
p: Elephants are larger than the moon

¬p: Elephants are smaller than or equal size to the moon
Conjunction (AND)
• Conjunction (AND)
  – True only when p and q are True




• Example:
  – Quiz one is easy and quiz two is difficult.
  – Peter is so handsome and smart.
  – Peter is so handsome and Peter is so smart.
Disjunction (OR)
• Disjunction (OR)
  – True when either p or q or both are true.




• Example
  – I will go with my sister or I will go with my brother.
Exclusive Or (XOR)
• Exclusive Or (XOR)
  – True only when either p or q is true but not both




• Example
  – Tomorrow is Thursday or tomorrow is Friday.
Conditional (If … then …)
• Conditional (If… then…)
   – “If p then q” can only be disproved to be false when p
     really happens but q doesn’t.
   – p is sufficient condition q.
   – q is necessary condition p.
   – “p if q” = “if q then p”
   – “p only if q” = “if p then q”

• Example
   – If tomorrow is hot, I will go swimming.
     (If tomorrow is cold, you can’t disprove the statement.)
Bi-Conditional (If and only if)
• Bi-Conditional (If and only if)
   – “p if and only if q” can only be disproved when p
     happens but not q or vice versa.
   – p (q) is necessary and sufficient condition for q (p)
   –

• Example:
   – A computer program is correct
     if and only if it produces correct
     answer for all possible sets of
     input data
Agenda
•   Proposition (Statement)
•   Logic Operators
•   Logical formula
•   Problems
    – Proofing formula
    – Constructing formula from truth table
    – Simplifying formula
Logical Formula
• Distribution Laws:



• De Morgan’s Laws:



• Absorption Laws:
Agenda
•   Proposition (Statement)
•   Logic Operators
•   Logical formula
•   Problems
    – Proofing formula
    – Constructing formula from truth table
    – Simplifying formula
Proofing logical equivalent 1
• By truth table
• E.g. Show that            De Morgan’s law
Proofing logical equivalent 2
• By logical rules
• E.g. Show that



                     De Morgan’s Law

                     De Morgan’s Law
Constructing Formula 1
• By using only
• Find the logical formula for
   1. Truth table
   2. When will this formula
      be True?
   3. Simplify



• Exercise: Try to construct an logical formula for
             ,       ,
Constructing Formula 2
• Find the logical formula for
  1. Truth table
  2. When will this formula be True?
  3. Simplify




• Exercise: Verify the above
  formula.
Constructing Formula 3
• Find the logical formula for
  1. Truth table
  2. When is this formula True?
Constructing Formula 3
3. Simplify

                               De Morgan’s law


                               Distribution Laws


                               Distribution Laws



                               Distribution Laws



                               De Morgan’s law
Simplifying Formula
• Simplify
                           De Morgan’s law

                           Distribution Laws
Summary
•   What is proposition?
•   Common logical operator.
•   Proving Equivalent of formula.
•   Constructing formula from truth table.
•   Simplifying formula.

More Related Content

Viewers also liked

Logic (slides)
Logic (slides)Logic (slides)
Logic (slides)IIUM
 
Mathematical Logic Part 2
Mathematical Logic Part 2Mathematical Logic Part 2
Mathematical Logic Part 2blaircomp2003
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logicJanet Stemwedel
 
Chapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound StatementsChapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound Statementsguestd166eb5
 
Discrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicDiscrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicUniversity of Potsdam
 
Nsu module 01-logic-final
Nsu module 01-logic-finalNsu module 01-logic-final
Nsu module 01-logic-finalSOURAV
 
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
 
Translating English to Propositional Logic
Translating English to Propositional LogicTranslating English to Propositional Logic
Translating English to Propositional LogicJanet Stemwedel
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheLeslie Samuel
 

Viewers also liked (12)

Logic (slides)
Logic (slides)Logic (slides)
Logic (slides)
 
Mathematical Logic Part 2
Mathematical Logic Part 2Mathematical Logic Part 2
Mathematical Logic Part 2
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logic
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Chapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound StatementsChapter 1 Logic of Compound Statements
Chapter 1 Logic of Compound Statements
 
Discrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional LogicDiscrete Mathematics - Propositional Logic
Discrete Mathematics - Propositional Logic
 
Logic
LogicLogic
Logic
 
Nsu module 01-logic-final
Nsu module 01-logic-finalNsu module 01-logic-final
Nsu module 01-logic-final
 
Logical Connectors
Logical ConnectorsLogical Connectors
Logical Connectors
 
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 د. خالد بكرو
 
Translating English to Propositional Logic
Translating English to Propositional LogicTranslating English to Propositional Logic
Translating English to Propositional Logic
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 

Similar to Logic

Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negationLogic, contrapositive, converse, Discrete Mathematics, conjunction, negation
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negationZaidAly1
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
unit1rulesofinference-170113152312.pdf
unit1rulesofinference-170113152312.pdfunit1rulesofinference-170113152312.pdf
unit1rulesofinference-170113152312.pdfBhanuCharan9
 
Unit 1 rules of inference
Unit 1  rules of inferenceUnit 1  rules of inference
Unit 1 rules of inferenceraksharao
 
lecture011712 (1).ppt
lecture011712 (1).pptlecture011712 (1).ppt
lecture011712 (1).pptabdulali6457
 
Logic in Predicate and Propositional Logic
Logic in Predicate and Propositional LogicLogic in Predicate and Propositional Logic
Logic in Predicate and Propositional LogicArchanaT32
 
Introduction iii
Introduction iiiIntroduction iii
Introduction iiichandsek666
 
- Logic - Module 1B - Logic and Propositions course lactur .pdf
- Logic - Module 1B - Logic and Propositions course lactur .pdf- Logic - Module 1B - Logic and Propositions course lactur .pdf
- Logic - Module 1B - Logic and Propositions course lactur .pdfMehdiHassan67
 
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptxDisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptxAdeel Saifee
 
Knowledge based agent
Knowledge based agentKnowledge based agent
Knowledge based agentShiwani Gupta
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfARMANVERMA7
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdfjayarao21
 

Similar to Logic (20)

Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negationLogic, contrapositive, converse, Discrete Mathematics, conjunction, negation
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
unit1rulesofinference-170113152312.pdf
unit1rulesofinference-170113152312.pdfunit1rulesofinference-170113152312.pdf
unit1rulesofinference-170113152312.pdf
 
Unit 1 rules of inference
Unit 1  rules of inferenceUnit 1  rules of inference
Unit 1 rules of inference
 
lecture011712 (1).ppt
lecture011712 (1).pptlecture011712 (1).ppt
lecture011712 (1).ppt
 
Logic in Predicate and Propositional Logic
Logic in Predicate and Propositional LogicLogic in Predicate and Propositional Logic
Logic in Predicate and Propositional Logic
 
Introduction iii
Introduction iiiIntroduction iii
Introduction iii
 
1019Lec1.ppt
1019Lec1.ppt1019Lec1.ppt
1019Lec1.ppt
 
Logic
LogicLogic
Logic
 
4535092.ppt
4535092.ppt4535092.ppt
4535092.ppt
 
02-boolean.ppt
02-boolean.ppt02-boolean.ppt
02-boolean.ppt
 
Logic.ppt
Logic.pptLogic.ppt
Logic.ppt
 
DM 1.pptx
DM 1.pptxDM 1.pptx
DM 1.pptx
 
- Logic - Module 1B - Logic and Propositions course lactur .pdf
- Logic - Module 1B - Logic and Propositions course lactur .pdf- Logic - Module 1B - Logic and Propositions course lactur .pdf
- Logic - Module 1B - Logic and Propositions course lactur .pdf
 
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptxDisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
 
PropositionalLogic.ppt
PropositionalLogic.pptPropositionalLogic.ppt
PropositionalLogic.ppt
 
Knowledge based agent
Knowledge based agentKnowledge based agent
Knowledge based agent
 
AI NOTES ppt 4.pdf
AI NOTES ppt 4.pdfAI NOTES ppt 4.pdf
AI NOTES ppt 4.pdf
 
Logic agent
Logic agentLogic agent
Logic agent
 
MFCS PPT.pdf
MFCS PPT.pdfMFCS PPT.pdf
MFCS PPT.pdf
 

More from H K

Assignment4
Assignment4Assignment4
Assignment4H K
 
Assignment3
Assignment3Assignment3
Assignment3H K
 
Induction
InductionInduction
InductionH K
 
Solution3
Solution3Solution3
Solution3H K
 
Solution2
Solution2Solution2
Solution2H K
 
Mid-
Mid-Mid-
Mid-H K
 
Assignment4
Assignment4Assignment4
Assignment4H K
 
Assignment4
Assignment4Assignment4
Assignment4H K
 
Dm assignment3
Dm assignment3Dm assignment3
Dm assignment3H K
 
Proof
ProofProof
ProofH K
 
Resolution
ResolutionResolution
ResolutionH K
 
Assignment description
Assignment descriptionAssignment description
Assignment descriptionH K
 
Dm assignment2
Dm assignment2Dm assignment2
Dm assignment2H K
 
Set
SetSet
SetH K
 
Dm assignment1
Dm assignment1Dm assignment1
Dm assignment1H K
 
Introduction
IntroductionIntroduction
IntroductionH K
 
Assignment 2 sol
Assignment 2 solAssignment 2 sol
Assignment 2 solH K
 
Assignment sw solution
Assignment sw solutionAssignment sw solution
Assignment sw solutionH K
 
Violinphoenix
ViolinphoenixViolinphoenix
ViolinphoenixH K
 
Ie project
Ie projectIe project
Ie projectH K
 

More from H K (20)

Assignment4
Assignment4Assignment4
Assignment4
 
Assignment3
Assignment3Assignment3
Assignment3
 
Induction
InductionInduction
Induction
 
Solution3
Solution3Solution3
Solution3
 
Solution2
Solution2Solution2
Solution2
 
Mid-
Mid-Mid-
Mid-
 
Assignment4
Assignment4Assignment4
Assignment4
 
Assignment4
Assignment4Assignment4
Assignment4
 
Dm assignment3
Dm assignment3Dm assignment3
Dm assignment3
 
Proof
ProofProof
Proof
 
Resolution
ResolutionResolution
Resolution
 
Assignment description
Assignment descriptionAssignment description
Assignment description
 
Dm assignment2
Dm assignment2Dm assignment2
Dm assignment2
 
Set
SetSet
Set
 
Dm assignment1
Dm assignment1Dm assignment1
Dm assignment1
 
Introduction
IntroductionIntroduction
Introduction
 
Assignment 2 sol
Assignment 2 solAssignment 2 sol
Assignment 2 sol
 
Assignment sw solution
Assignment sw solutionAssignment sw solution
Assignment sw solution
 
Violinphoenix
ViolinphoenixViolinphoenix
Violinphoenix
 
Ie project
Ie projectIe project
Ie project
 

Recently uploaded

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structuredhanjurrannsibayan2
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 

Recently uploaded (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

Logic

  • 1. Discrete Mathematics Propositional Logic Harshit Kumar Slides borrowed from Wong Chung Hoi of CUHK
  • 2. Agenda • Proposition (Statement) • Logic Operators • Logical formula • Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
  • 3. Proposition (Statement) • A sentence that is either TURE or FALSE – 1 + 1 = 2. – 1 + 1 = 3. – Let’s end the tutorial now. – This tutorial is boring. – Wake up and listen to me! – There are no aliens. – x > 0. – He is handsome. ? • Tautology – proposition that is always true • Contradiction – proposition that is always false
  • 4. He has courage! ? This man has courage!
  • 6. You are doing it wrong! ? Your way of pretending to be a penguin is wrong!
  • 7. Agenda • Proposition (Statement) • Logic Operators • Logical formula • Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
  • 8. Logic Operators • Let p and q be a proposition. • Operators: – Negation – Conjunction – Disjunction – Conditional – Bi-conditional
  • 9. Negation (NOT) • Negation (NOT) – Flip the truth value. • Example: – p: My car is blue. ¬p: My car is not blue. – p: Peter is good. ¬p: Peter is not good. – p: 10 > 15. ¬p: 10 < 15 or 10 = 15
  • 10.
  • 11. p: 49% different is a lot ¬p: 49% different is not a lot
  • 12. p: Elephants are larger than the moon ¬p: Elephants are smaller than or equal size to the moon
  • 13. Conjunction (AND) • Conjunction (AND) – True only when p and q are True • Example: – Quiz one is easy and quiz two is difficult. – Peter is so handsome and smart. – Peter is so handsome and Peter is so smart.
  • 14. Disjunction (OR) • Disjunction (OR) – True when either p or q or both are true. • Example – I will go with my sister or I will go with my brother.
  • 15. Exclusive Or (XOR) • Exclusive Or (XOR) – True only when either p or q is true but not both • Example – Tomorrow is Thursday or tomorrow is Friday.
  • 16. Conditional (If … then …) • Conditional (If… then…) – “If p then q” can only be disproved to be false when p really happens but q doesn’t. – p is sufficient condition q. – q is necessary condition p. – “p if q” = “if q then p” – “p only if q” = “if p then q” • Example – If tomorrow is hot, I will go swimming. (If tomorrow is cold, you can’t disprove the statement.)
  • 17. Bi-Conditional (If and only if) • Bi-Conditional (If and only if) – “p if and only if q” can only be disproved when p happens but not q or vice versa. – p (q) is necessary and sufficient condition for q (p) – • Example: – A computer program is correct if and only if it produces correct answer for all possible sets of input data
  • 18. Agenda • Proposition (Statement) • Logic Operators • Logical formula • Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
  • 19. Logical Formula • Distribution Laws: • De Morgan’s Laws: • Absorption Laws:
  • 20. Agenda • Proposition (Statement) • Logic Operators • Logical formula • Problems – Proofing formula – Constructing formula from truth table – Simplifying formula
  • 21. Proofing logical equivalent 1 • By truth table • E.g. Show that De Morgan’s law
  • 22. Proofing logical equivalent 2 • By logical rules • E.g. Show that De Morgan’s Law De Morgan’s Law
  • 23. Constructing Formula 1 • By using only • Find the logical formula for 1. Truth table 2. When will this formula be True? 3. Simplify • Exercise: Try to construct an logical formula for , ,
  • 24. Constructing Formula 2 • Find the logical formula for 1. Truth table 2. When will this formula be True? 3. Simplify • Exercise: Verify the above formula.
  • 25. Constructing Formula 3 • Find the logical formula for 1. Truth table 2. When is this formula True?
  • 26. Constructing Formula 3 3. Simplify De Morgan’s law Distribution Laws Distribution Laws Distribution Laws De Morgan’s law
  • 27. Simplifying Formula • Simplify De Morgan’s law Distribution Laws
  • 28. Summary • What is proposition? • Common logical operator. • Proving Equivalent of formula. • Constructing formula from truth table. • Simplifying formula.