SlideShare uma empresa Scribd logo
1 de 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.

Mais conteúdo relacionado

Destaque

Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligencemailmerk
 
Discrete maths tutorials
Discrete maths tutorialsDiscrete maths tutorials
Discrete maths tutorialsDIT University
 
Logical Operators in Brief with examples
Logical Operators in Brief with examplesLogical Operators in Brief with examples
Logical Operators in Brief with examplesMujtaBa Khan
 
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
 

Destaque (16)

Artificial intelligence
Artificial intelligenceArtificial intelligence
Artificial intelligence
 
Discrete maths tutorials
Discrete maths tutorialsDiscrete maths tutorials
Discrete maths tutorials
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Logical Operators in Brief with examples
Logical Operators in Brief with examplesLogical Operators in Brief with examples
Logical Operators in Brief with examples
 
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
 

Semelhante a 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
 

Semelhante a 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
 

Mais de 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
 

Mais de 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
 

Último

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
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
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
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
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
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
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
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
 
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
 
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
 

Último (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
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
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
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
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
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
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
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Ữ Â...
 
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...
 
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
 

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.