SlideShare a Scribd company logo
 Logic!




Introduction to Mathematical Logic: MATH-105   Jan-May 2013   1
• Crucial for mathematical reasoning
• Important for program design
• Used for designing electronic circuitry

• (Propositional )Logic is a system based on
  propositions.
• A proposition or statement is a (declarative)
  sentence that is either true or false (not both).
• We say that the truth value of a proposition is
  either true (T) or false (F).
•   Corresponds to 1 and 0 in digital circuits


        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   2
   “Elephants are bigger than mice.”

Is this a sentence?                                                  yes

Is this a proposition?                                               yes

What is the truth value
of the proposition?                                                  true


       Introduction to Mathematical Logic: MATH-105   Jan-May 2013          3
     “520 < 111”

Is this a sentence?                                                 yes

Is this a proposition?                                              yes

What is the truth value
of the proposition?                                                 false


      Introduction to Mathematical Logic: MATH-105   Jan-May 2013           4
     “y > 5”

Is this a sentence?                                                 yes
Is this a proposition?                                              no

Its truth value depends on the value of y,
but this value is not specified.
We call this type of sentence a
propositional function or open sentence.

      Introduction to Mathematical Logic: MATH-105   Jan-May 2013         5
   “Today is January 27 and 99 < 5.”

Is this a sentence?                                                  yes

Is this a proposition?                                               yes

What is the truth value
of the proposition?                                                  false


       Introduction to Mathematical Logic: MATH-105   Jan-May 2013           6
     “Please do not fall asleep.”

Is this a sentence?                                                    yes
It’s a request.

Is this a proposition?                                                 no




         Introduction to Mathematical Logic: MATH-105   Jan-May 2013         7
   “If the moon is made of cheese,
              then I will be rich.”

Is this a sentence?                                                   yes

Is this a proposition?                                                yes

What is the truth value
of the proposition?                                                   probably true

        Introduction to Mathematical Logic: MATH-105   Jan-May 2013            8
“x < y if and only if y > x.”
Is this a sentence?           yes
Is this a proposition?        yes
… because its truth value
  does not depend on
  specific values of x and y.
What is the truth value
of the proposition?                                                  true

       Introduction to Mathematical Logic: MATH-105   Jan-May 2013          9
Aswe have seen in the previous
examples, one or more propositions can
be combined to form a single compound
proposition.

We  formalize this by denoting
propositions with letters such as p, q, r, s,
and introducing several logical operators
or logical connectives.


       Introduction to Mathematical Logic: MATH-105   Jan-May 2013   10
We will examine the following logical
operators:
• Negation                     (NOT, ¬ )
• Conjunction                  (AND, ∧ )
• Disjunction                  (OR, ∨ )
• Exclusive-or                 (XOR, ⊕ )
• Implication                  (if – then, → )
• Biconditional                (if and only if, ↔ )
Truth
     tables can be used to show how these
operators can combine propositions to
compound propositions.
         Introduction to Mathematical Logic: MATH-105   Jan-May 2013   11
   Unary Operator, Symbol: ¬

                         P                                    P
            true (T)                                false (F)
           false (F)                                 true (T)


     Introduction to Mathematical Logic: MATH-105   Jan-May 2013   12
   Binary Operator, Symbol: ∧
                       P                            Q              P Q
                       T                            T               T
                       T                            F               F
                       F                            T               F
                       F                            F               F

     Introduction to Mathematical Logic: MATH-105   Jan-May 2013          13
   Binary Operator, Symbol: ∨

                     P                       Q                P Q
                     T                       T                 T
                     T                        F                    T
                     F                        T                    T
                     F                        F                    F

     Introduction to Mathematical Logic: MATH-105   Jan-May 2013       14
   Binary Operator, Symbol: ⊕

                     P                       Q                     PQ
                     T                       T                      F
                     T                        F                    T
                     F                        T                    T
                     F                        F                    F

     Introduction to Mathematical Logic: MATH-105   Jan-May 2013         15
   Binary Operator, Symbol: →

                     P                       Q                     PQ
                     T                       T                      T
                     T                        F                    F
                     F                        T                    T
                     F                        F                    T

     Introduction to Mathematical Logic: MATH-105   Jan-May 2013         16
   Binary Operator, Symbol: ↔

                     P                       Q                     PQ
                     T                       T                      T
                     T                        F                    F
                     F                        T                    F
                     F                        F                    T

     Introduction to Mathematical Logic: MATH-105   Jan-May 2013         17
   Statements and operators can be combined
         in any way to form new statements.


     P             Q                P               Q             (P)(Q)
     T             T                F                 F                F
     T              F                F                T                T
     F              T                T                F                T
     F              F                T                T                T

      Introduction to Mathematical Logic: MATH-105   Jan-May 2013               18
   Statements and operators can be combined in
          any way to form new statements.


    P            Q              PQ (PQ) (P)(Q)
    T            T               T     F       F
    T             F                 F                    T            T
    F             T                 F                    T            T
    F             F                 F                    T            T

        Introduction to Mathematical Logic: MATH-105   Jan-May 2013       19
• Totake discrete mathematics, you must
 have taken calculus or a course in computer
 science.
• When you buy a new car from Acme Motor
 Company, you get $2000 back in cash or a
 2% car loan.
• School   is closed if more than 2 feet of snow
 falls or if the wind chill is below -100.




       Introduction to Mathematical Logic: MATH-105   Jan-May 2013   20
• To take discrete mathematics, you must have
  taken calculus or a course in computer science.
     › P: take discrete mathematics
     › Q: take calculus
     › R: take a course in computer science

•P   →Q∨R
• Problem        with proposition R



         Introduction to Mathematical Logic: MATH-105   Jan-May 2013   21
• When you buy a new car from Acme Motor
  Company, you get $2000 back in cash or a 2%
  car loan.
     › P: buy a car from Acme Motor Company
     › Q: get $2000 cash back
     › R: get a 2% car loan

•P   →Q⊕R
• Why use XOR here? – example of ambiguity
 of natural languages

         Introduction to Mathematical Logic: MATH-105   Jan-May 2013   22
• School is closed if more than 2 feet of snow
  falls or if the wind chill is below -100.
    › P: School is closed
    › Q: 2 feet of snow falls
    › R: wind chill is below -100

•Q   ∧R→P
• Precedence                among operators:
                 ¬, ∧, ∨, →, ↔

        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   23
P         Q             (PQ)               (P)(Q)               (PQ)(P)(Q)

    T          T                   F                       F                     T
    T           F                  T                       T                     T
    F          T                   T                       T                     T
    F           F                  T                       T                     T
    The statements ¬(P∧Q) and (¬P) ∨ (¬Q) are logically equivalent, since
    they have the same truth table, or put it in another way, ¬(P∧Q) ↔(¬P)
                            ∨ (¬Q) is always true.



            Introduction to Mathematical Logic: MATH-105   Jan-May 2013              24
   A tautology is a statement that is always true.
   Examples:
     › R∨(¬R)
     › ¬(P∧Q) ↔ (¬P)∨(¬ Q)
   A contradiction is a statement that is always false.
   Examples:
     › R∧(¬R)
     › ¬(¬(P ∧ Q) ↔ (¬P) ∨ (¬Q))
   The negation of any tautology is a contradiction, and
    the negation of any contradiction is a tautology.

   If A has the truth value, T for at least one combination
    of truth values of P1, P2 , P3 ,…, Pn then A is said to be
    satisfiable.

          Introduction to Mathematical Logic: MATH-105   Jan-May 2013   25
   Definition: two propositional
    statements S1 and S2 are said to be
    (logically) equivalent, denoted S1 ≡ S2
    if
      › They have the same truth table, or
      › S1 ⇔ S2 is a tautology
   Equivalence can be established by
      › Constructing truth tables
      › Using equivalence laws



         Introduction to Mathematical Logic: MATH-105   Jan-May 2013   26
   Equivalence laws
    › Identity laws,                           P ∧ T ≡ P,
    › Domination laws,                         P ∧ F ≡ F,
    › Idempotent laws,                         P ∧ P ≡ P,
    › Double negation law,                                  ¬ (¬ P) ≡ P
    › Commutative laws, P ∧ Q ≡ Q ∧ P,
    › Associative laws,                        P ∧ (Q ∧ R)≡ (P ∧ Q) ∧ R,
    › Distributive laws,                       P ∧ (Q ∨ R)≡ (P ∧ Q) ∨ (P ∧ R),
    › De Morgan’s laws,                        ¬ (P∧Q) ≡ (¬ P) ∨ (¬ Q)
    › Law with implication P → Q ≡ ¬ P ∨ Q


           Introduction to Mathematical Logic: MATH-105   Jan-May 2013     27
• Show    that P → Q ≡ ¬ P ∨ Q: by truth table
• Showthat (P → Q) ∧ (P → R) ≡ P → (Q ∧ R):
 by equivalence laws:
  › Law with implication on both sides
  › Distribution law on LHS




         Introduction to Mathematical Logic: MATH-105   Jan-May 2013   28
•Proposition
 › Statement, Truth value,
 › Proposition, Propositional symbol, Open proposition
•Operators
 › Define by truth tables
 › Composite propositions
 › Tautology and contradiction
•Equivalence                  of propositional statements
 › Definition
 › Proving equivalence (by truth table or equivalence
   laws)


     Introduction to Mathematical Logic: MATH-105   Jan-May 2013   29
Propositionalfunction (open sentence):
statement involving one or more variables,

     e.g.: x-3 > 5.
Let us call this propositional function P(x),
where P is the predicate and x is the variable.
What is the truth value of P(2) ? false
What is the truth value of P(8) ? false
What is the truth value of P(9) ? true
When a variable is given a value, it is said to be
instantiated
Truth value depends on value of variable
        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   30
Letus consider the propositional function
Q(x, y, z) defined as:
x   + y = z.
Here,Q is the predicate and x, y, and z are
the variables.
What is the truth value of Q(2, 3, 5) ?   true
What is the truth value of Q(0, 1, 2) ?   false
What is the truth value of Q(9, -9, 0) ? true
A propositional function (predicate) becomes a
proposition when all its variables are instantiated.

           Introduction to Mathematical Logic: MATH-105   Jan-May 2013   31
Other   examples of propositional functions

Person(x),
   Person(Socrates) = T x is a person
          which is true if
   Person(dog) = F
CSCourse(x), which is true if x is a
 computer science course
   CS Course(C-language) = T
   CS Course(MATH 102) = F




         Introduction to Mathematical Logic: MATH-105   Jan-May 2013   32
LetP(x) be a predicate (propositional
function).
Universally   quantified sentence:
For all x in the universe of discourse P(x) is true.

Using the universal quantifier ∀:
∀x P(x) “for all x P(x)” or “for every x P(x)”

(Note:∀x P(x) is either true or false, so it is a
proposition, not a propositional function.)


          Introduction to Mathematical Logic: MATH-105   Jan-May 2013   33
Example:         Let the universe of discourse be all people
       S(x): x is a Mathematics student.
       G(x): x is a genius.
What     does ∀x (S(x) → G(x)) mean ?
“If
   x is a mathematics student, then x is a genius.” or
“All Mathematics students are geniuses.”

Ifthe universe of discourse is all mathematics
students, then the same statement can be written as
       ∀x G(x)



            Introduction to Mathematical Logic: MATH-105   Jan-May 2013   34
Existentiallyquantified sentence:
There exists an x in the universe of discourse for
which P(x) is true.
Using the existential quantifier ∃:
∃x P(x) “There is an x such that P(x).”
         “There is at least one x such that P(x).”
(Note:∃x P(x) is either true or false, so it is a
proposition, but no propositional function.)


          Introduction to Mathematical Logic: MATH-105   Jan-May 2013   35
Example:
P(x):x is a Mathematics professor.
G(x): x is a genius.

What    does ∃x (P(x) ∧ G(x)) mean ?

“There is an x such that x is a Mathematics
professor and x is a genius.”
                       or
“At least one Mathematics professor is a
   genius.”

          Introduction to Mathematical Logic: MATH-105   Jan-May 2013   36
Another  example:
Let the universe of discourse be the real
numbers.
What    does ∀x∃y (x + y = 320) mean ?

“For   every x there exists a y so that x + y = 320.”
Is it true?                                                              yes

Is it true for the natural numbers?                                      no


           Introduction to Mathematical Logic: MATH-105   Jan-May 2013         37
A counterexample to ∀x P(x) is an object c so
that P(c) is false.

Statementssuch as ∀x (P(x) → Q(x)) can be
disproved by simply providing a
counterexample.

Statement: “All birds can fly.”
Disproved by counterexample: Penguin.


       Introduction to Mathematical Logic: MATH-105   Jan-May 2013   38
   ¬(∀x P(x)) is logically equivalent to ∃x (¬P(x)).

   ¬(∃x P(x)) is logically equivalent to ∀x (¬P(x)).


   This is de Morgan’s law for quantifiers




         Introduction to Mathematical Logic: MATH-105   Jan-May 2013   39
   Examples
   Not all roses are red
     ¬∀x (Rose(x) → Red(x))
     ∃x (Rose(x) ∧ ¬Red(x))
Nobody is perfect
    x (Person(x)  Perfect(x))
    x (Person(x)  Perfect(x))



        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   40
   A predicate can have more than one
    variables.
    › S(x, y, z): z is the sum of x and y
    › F(x, y): x and y are friends
   We can quantify individual variables in
    different ways
    › ∀x, y, z (S(x, y, z) → (x <= z ∧ y <= z))
    › ∃x ∀y ∀z (F(x, y) ∧ F(x, z) ∧ (y != z) → ¬F(y, z)




         Introduction to Mathematical Logic: MATH-105   Jan-May 2013   41
   Exercise: translate the following English
    sentence into logical expression
    “There is a rational number in between every
      pair of distinct rational numbers”

   Use predicate Q(x), which is true when
    x is a rational number
     ∀x,y (Q(x) ∧ Q (y) ∧ (x < y) →
       ∃u (Q(u) ∧ (x < u) ∧ (u < y)))


        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   42
• Propositional functions (predicates)
• Universal and existential quantifiers, and
  the duality of the two
• When predicates become propositions
    › All of its variables are instantiated
    › All of its variables are quantified
•   Nested quantifiers
    › Quantifiers with negation
•   Logical expressions formed by
    predicates, operators, and quantifiers


         Introduction to Mathematical Logic: MATH-105   Jan-May 2013   43
Mathematical
             Reasoning


Introduction to Mathematical Logic: MATH-105   Jan-May 2013   44
We need mathematical reasoning to determine
whether a mathematical argument is correct or
incorrect  and    construct    mathematical
arguments.




       Introduction to Mathematical Logic: MATH-105   Jan-May 2013   45
Argument: An argument is an assertion; that a
group of propositions called premises, yields an
other proposition, called the conclusion.

Let P1, P2 , P3 ,…, Pn is the group of propositions that
yields the conclusion Q. Then, it is denoted as P1, P2 ,
P3 ,…, Pn |- Q

 Valid Argument: An argument is called valid
argument if the conclusion is true whenever all the
premises are true
              or
The argument is valid iff the ANDing of the group of
propositions implies conclusion is a tautology
ie: P(P1, P2 , P3 ,…, Pn ) Q is a tautology    46
         Introduction to Mathematical Logic: MATH-105   Jan-May 2013
Fallacy Argument: An argument is called
fallacy or an invalid argument if it is not a valid
argument.




        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   47
 Translate the following into symbolic form and
test the validity of the argument:

1.“If I will select in IAS examination, then I will not
be able to go to London. Since, I am going to
London, I will not select in IAS examination”.

2. “If 6 is even then 2 does not divide 7. Either 5 is
not prime or 2 divides 7. But 5 is prime, therefore,
6 is not even”.



         Introduction to Mathematical Logic: MATH-105   Jan-May 2013   48
Ans-1:
p: I will select in IAS examination
q: I will go to London

Premises: 1. p                      ~q
           2. q

Conclusion: ~p

Verify: [(p            ~q) ∧(q)]                         ~p is a tautology



          Introduction to Mathematical Logic: MATH-105   Jan-May 2013    49
 Ans-2:
p: 6 is even
q: 2 divides 7
r: 5 is prime

Premises: 1. p     ~q
          2. ~r ∨ q
          3. r
Conclusion: ~p

Verify: [ (1) ∧ (2) ∧ (3) ]                              ~p is a tautology


         Introduction to Mathematical Logic: MATH-105   Jan-May 2013    50
   The problem of finding whether a given
    statement is tautology or contradiction or
    satisfiable in a finite number of steps, is
    called     as   decision   problem,    the
    construction of truth tables may not be
    often a practical solution. We therefore
    consider alternate procedure known as
    reduction to normal forms. The two such
    forms are:
   Disjunctive Normal Form (DNF)
   Conjunctive Normal Form (CNF)
        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   51
   A compound statement is said to be in dnf
    if it is disjunction of conjunction of the
    variables or their negations.
   Ex:(p ∧ q ∧ r) ∨ (~p ∧q ∧r) ∨ (~p ∧~q ∧ r)

   A compound statement is said to be in cnf
    if it is conjunction of disjunction of the
    variables or their negations.
   Ex:(p ∨ q ∨ ~r) ∧ (p ∨ ~q ∨ r) ∧ (~p ∨ ~q ∨ r)

        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   52
   The truth table for the given statement is:
     P   Q      P        Q      Q            P          (P        Q)  (Q
                                                                   P)
     T   T           T                  T                               T
     T   F           F                  T                               F
     F   T           T                  F                               F
     F   F           F                  T                               T




         Introduction to Mathematical Logic: MATH-105    Jan-May 2013       53
   DNF:




   DNF: (P ∧ Q) ∨ (~P ∧ ~Q)


        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   54
   CNF:




   CNF: ~(P ∧ ~Q) ∧ ~(~P ∧ Q)
        ≡ (~P ∨ Q) ∧ (P ∨ ~Q)

        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   55
•   Mathematical Reasoning
•   Terminology (argument, valid argument
    and fallacy argument)
•   Examples on valid arguments
•   Normal forms (DNF and CNF)
•   Truth table method to express the
    statements as dnf and cnf forms




        Introduction to Mathematical Logic: MATH-105   Jan-May 2013   56

More Related Content

PPT
Translating English to Propositional Logic
PPT
Propositional logic
PPTX
Truth table
PPTX
Unit 1 rules of inference
PPT
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
PDF
Formal Logic - Lesson 4 - Tautology, Contradiction and Contingency
PPT
Introduction to Item Response Theory
PDF
Poset in Relations(Discrete Mathematics)
Translating English to Propositional Logic
Propositional logic
Truth table
Unit 1 rules of inference
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Formal Logic - Lesson 4 - Tautology, Contradiction and Contingency
Introduction to Item Response Theory
Poset in Relations(Discrete Mathematics)

What's hot (20)

PPT
Predicates and Quantifiers
PPTX
Counting, mathematical induction and discrete probability
PPTX
Set Theory Presentation
PPTX
11 adaptive testing-irt
PDF
Math induction principle (slides)
PPTX
Inductive methods
PPTX
Graph theory introduction - Samy
PPTX
Pigeonhole Principle
DOCX
Rules of inference
PPTX
PPT
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
PPT
Naturalistic qualitative inquiry.
PPT
Introduction to lambda calculus
PPTX
Research Methodology
PDF
Relation matrix & graphs in relations
PPTX
Discrete math Truth Table
PPTX
Take-Grant Protection Model
PPTX
Algorithm Design and Complexity - Course 3
PPTX
Pre-experimental Research Design and It's Uses
PPTX
Topological sort
Predicates and Quantifiers
Counting, mathematical induction and discrete probability
Set Theory Presentation
11 adaptive testing-irt
Math induction principle (slides)
Inductive methods
Graph theory introduction - Samy
Pigeonhole Principle
Rules of inference
Discrete mathematics Ch1 sets Theory_Dr.Khaled.Bakro د. خالد بكرو
Naturalistic qualitative inquiry.
Introduction to lambda calculus
Research Methodology
Relation matrix & graphs in relations
Discrete math Truth Table
Take-Grant Protection Model
Algorithm Design and Complexity - Course 3
Pre-experimental Research Design and It's Uses
Topological sort
Ad

Viewers also liked (7)

PPTX
Ai 3
PDF
LOGIKA PROPOSISI & PREDIKATLogika proposisi & predikat
PDF
MDD and the Tautology Problem: Discussion Notes.
PPTX
8 logika predikat
PPT
CPSC 125 Ch 1 sec 1
PPT
Kecerdasan buatan
PPTX
Propositional logic
Ai 3
LOGIKA PROPOSISI & PREDIKATLogika proposisi & predikat
MDD and the Tautology Problem: Discussion Notes.
8 logika predikat
CPSC 125 Ch 1 sec 1
Kecerdasan buatan
Propositional logic
Ad

Similar to discreet mathematics (20)

PDF
Lecture notes in_discrete_mathematics
PDF
Notes discrete math
DOCX
DOCX
PDF
1-Discrete Mathematics - 1 - Unit - 1.pdf
PPTX
1. Introduction to math logic.pptx
PPTX
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
PDF
Chapter 1 Logic of Compound Statements
PPTX
Discrete_Mathematics_Chapter1_Part1.pptx
PDF
CBSE XII Boolean Algebra
PDF
Mathematical Logic
PPTX
Logic.pptx
PPTX
Foundation_Logic_1.pptx discrete mathematics
PPT
The propositional logic and its appl.ppt
PPTX
Math in the modern world math as a language.pptx
PPT
Propositional And First-Order Logic
PPT
1019Lec1.ppt
PPT
02-boolean.ppt
PPT
Nsu module 01-logic-final
Lecture notes in_discrete_mathematics
Notes discrete math
1-Discrete Mathematics - 1 - Unit - 1.pdf
1. Introduction to math logic.pptx
DisMath-lecture-2-Logic-and-Proofs-08032022-115009am.pptx
Chapter 1 Logic of Compound Statements
Discrete_Mathematics_Chapter1_Part1.pptx
CBSE XII Boolean Algebra
Mathematical Logic
Logic.pptx
Foundation_Logic_1.pptx discrete mathematics
The propositional logic and its appl.ppt
Math in the modern world math as a language.pptx
Propositional And First-Order Logic
1019Lec1.ppt
02-boolean.ppt
Nsu module 01-logic-final

More from Kumar (20)

PPT
Graphics devices
PPT
Fill area algorithms
PDF
region-filling
PDF
Bresenham derivation
PPT
Bresenham circles and polygons derication
PPTX
Introductionto xslt
PPTX
Extracting data from xml
PPTX
Xml basics
PPTX
XML Schema
PPTX
Publishing xml
PPTX
DTD
PPTX
Applying xml
PPTX
Introduction to XML
PDF
How to deploy a j2ee application
PDF
JNDI, JMS, JPA, XML
PDF
EJB Fundmentals
PDF
JSP and struts programming
PDF
java servlet and servlet programming
PDF
Introduction to JDBC and JDBC Drivers
PDF
Introduction to J2EE
Graphics devices
Fill area algorithms
region-filling
Bresenham derivation
Bresenham circles and polygons derication
Introductionto xslt
Extracting data from xml
Xml basics
XML Schema
Publishing xml
DTD
Applying xml
Introduction to XML
How to deploy a j2ee application
JNDI, JMS, JPA, XML
EJB Fundmentals
JSP and struts programming
java servlet and servlet programming
Introduction to JDBC and JDBC Drivers
Introduction to J2EE

Recently uploaded (20)

PDF
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
PDF
My India Quiz Book_20210205121199924.pdf
PPTX
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
PPTX
Introduction to Building Materials
PDF
Empowerment Technology for Senior High School Guide
PDF
What if we spent less time fighting change, and more time building what’s rig...
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PPTX
Computer Architecture Input Output Memory.pptx
PPTX
B.Sc. DS Unit 2 Software Engineering.pptx
PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
Practical Manual AGRO-233 Principles and Practices of Natural Farming
PPTX
Virtual and Augmented Reality in Current Scenario
PPTX
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PDF
Trump Administration's workforce development strategy
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Vision Prelims GS PYQ Analysis 2011-2022 www.upscpdf.com.pdf
My India Quiz Book_20210205121199924.pdf
ELIAS-SEZIURE AND EPilepsy semmioan session.pptx
Introduction to Building Materials
Empowerment Technology for Senior High School Guide
What if we spent less time fighting change, and more time building what’s rig...
History, Philosophy and sociology of education (1).pptx
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
Computer Architecture Input Output Memory.pptx
B.Sc. DS Unit 2 Software Engineering.pptx
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
Practical Manual AGRO-233 Principles and Practices of Natural Farming
Virtual and Augmented Reality in Current Scenario
Onco Emergencies - Spinal cord compression Superior vena cava syndrome Febr...
Paper A Mock Exam 9_ Attempt review.pdf.
Trump Administration's workforce development strategy
Unit 4 Computer Architecture Multicore Processor.pptx
TNA_Presentation-1-Final(SAVE)) (1).pptx
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc

discreet mathematics

  • 1.  Logic! Introduction to Mathematical Logic: MATH-105 Jan-May 2013 1
  • 2. • Crucial for mathematical reasoning • Important for program design • Used for designing electronic circuitry • (Propositional )Logic is a system based on propositions. • A proposition or statement is a (declarative) sentence that is either true or false (not both). • We say that the truth value of a proposition is either true (T) or false (F). • Corresponds to 1 and 0 in digital circuits Introduction to Mathematical Logic: MATH-105 Jan-May 2013 2
  • 3. “Elephants are bigger than mice.” Is this a sentence? yes Is this a proposition? yes What is the truth value of the proposition? true Introduction to Mathematical Logic: MATH-105 Jan-May 2013 3
  • 4. “520 < 111” Is this a sentence? yes Is this a proposition? yes What is the truth value of the proposition? false Introduction to Mathematical Logic: MATH-105 Jan-May 2013 4
  • 5. “y > 5” Is this a sentence? yes Is this a proposition? no Its truth value depends on the value of y, but this value is not specified. We call this type of sentence a propositional function or open sentence. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 5
  • 6. “Today is January 27 and 99 < 5.” Is this a sentence? yes Is this a proposition? yes What is the truth value of the proposition? false Introduction to Mathematical Logic: MATH-105 Jan-May 2013 6
  • 7. “Please do not fall asleep.” Is this a sentence? yes It’s a request. Is this a proposition? no Introduction to Mathematical Logic: MATH-105 Jan-May 2013 7
  • 8. “If the moon is made of cheese, then I will be rich.” Is this a sentence? yes Is this a proposition? yes What is the truth value of the proposition? probably true Introduction to Mathematical Logic: MATH-105 Jan-May 2013 8
  • 9. “x < y if and only if y > x.” Is this a sentence? yes Is this a proposition? yes … because its truth value does not depend on specific values of x and y. What is the truth value of the proposition? true Introduction to Mathematical Logic: MATH-105 Jan-May 2013 9
  • 10. Aswe have seen in the previous examples, one or more propositions can be combined to form a single compound proposition. We formalize this by denoting propositions with letters such as p, q, r, s, and introducing several logical operators or logical connectives. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 10
  • 11. We will examine the following logical operators: • Negation (NOT, ¬ ) • Conjunction (AND, ∧ ) • Disjunction (OR, ∨ ) • Exclusive-or (XOR, ⊕ ) • Implication (if – then, → ) • Biconditional (if and only if, ↔ ) Truth tables can be used to show how these operators can combine propositions to compound propositions. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 11
  • 12. Unary Operator, Symbol: ¬ P  P true (T) false (F) false (F) true (T) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 12
  • 13. Binary Operator, Symbol: ∧ P Q P Q T T T T F F F T F F F F Introduction to Mathematical Logic: MATH-105 Jan-May 2013 13
  • 14. Binary Operator, Symbol: ∨ P Q P Q T T T T F T F T T F F F Introduction to Mathematical Logic: MATH-105 Jan-May 2013 14
  • 15. Binary Operator, Symbol: ⊕ P Q PQ T T F T F T F T T F F F Introduction to Mathematical Logic: MATH-105 Jan-May 2013 15
  • 16. Binary Operator, Symbol: → P Q PQ T T T T F F F T T F F T Introduction to Mathematical Logic: MATH-105 Jan-May 2013 16
  • 17. Binary Operator, Symbol: ↔ P Q PQ T T T T F F F T F F F T Introduction to Mathematical Logic: MATH-105 Jan-May 2013 17
  • 18. Statements and operators can be combined in any way to form new statements. P Q P Q (P)(Q) T T F F F T F F T T F T T F T F F T T T Introduction to Mathematical Logic: MATH-105 Jan-May 2013 18
  • 19. Statements and operators can be combined in any way to form new statements. P Q PQ (PQ) (P)(Q) T T T F F T F F T T F T F T T F F F T T Introduction to Mathematical Logic: MATH-105 Jan-May 2013 19
  • 20. • Totake discrete mathematics, you must have taken calculus or a course in computer science. • When you buy a new car from Acme Motor Company, you get $2000 back in cash or a 2% car loan. • School is closed if more than 2 feet of snow falls or if the wind chill is below -100. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 20
  • 21. • To take discrete mathematics, you must have taken calculus or a course in computer science. › P: take discrete mathematics › Q: take calculus › R: take a course in computer science •P →Q∨R • Problem with proposition R Introduction to Mathematical Logic: MATH-105 Jan-May 2013 21
  • 22. • When you buy a new car from Acme Motor Company, you get $2000 back in cash or a 2% car loan. › P: buy a car from Acme Motor Company › Q: get $2000 cash back › R: get a 2% car loan •P →Q⊕R • Why use XOR here? – example of ambiguity of natural languages Introduction to Mathematical Logic: MATH-105 Jan-May 2013 22
  • 23. • School is closed if more than 2 feet of snow falls or if the wind chill is below -100. › P: School is closed › Q: 2 feet of snow falls › R: wind chill is below -100 •Q ∧R→P • Precedence among operators:  ¬, ∧, ∨, →, ↔ Introduction to Mathematical Logic: MATH-105 Jan-May 2013 23
  • 24. P Q (PQ) (P)(Q) (PQ)(P)(Q) T T F F T T F T T T F T T T T F F T T T  The statements ¬(P∧Q) and (¬P) ∨ (¬Q) are logically equivalent, since they have the same truth table, or put it in another way, ¬(P∧Q) ↔(¬P) ∨ (¬Q) is always true. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 24
  • 25. A tautology is a statement that is always true.  Examples: › R∨(¬R) › ¬(P∧Q) ↔ (¬P)∨(¬ Q)  A contradiction is a statement that is always false.  Examples: › R∧(¬R) › ¬(¬(P ∧ Q) ↔ (¬P) ∨ (¬Q))  The negation of any tautology is a contradiction, and the negation of any contradiction is a tautology.  If A has the truth value, T for at least one combination of truth values of P1, P2 , P3 ,…, Pn then A is said to be satisfiable. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 25
  • 26. Definition: two propositional statements S1 and S2 are said to be (logically) equivalent, denoted S1 ≡ S2 if › They have the same truth table, or › S1 ⇔ S2 is a tautology  Equivalence can be established by › Constructing truth tables › Using equivalence laws Introduction to Mathematical Logic: MATH-105 Jan-May 2013 26
  • 27. Equivalence laws › Identity laws, P ∧ T ≡ P, › Domination laws, P ∧ F ≡ F, › Idempotent laws, P ∧ P ≡ P, › Double negation law, ¬ (¬ P) ≡ P › Commutative laws, P ∧ Q ≡ Q ∧ P, › Associative laws, P ∧ (Q ∧ R)≡ (P ∧ Q) ∧ R, › Distributive laws, P ∧ (Q ∨ R)≡ (P ∧ Q) ∨ (P ∧ R), › De Morgan’s laws, ¬ (P∧Q) ≡ (¬ P) ∨ (¬ Q) › Law with implication P → Q ≡ ¬ P ∨ Q Introduction to Mathematical Logic: MATH-105 Jan-May 2013 27
  • 28. • Show that P → Q ≡ ¬ P ∨ Q: by truth table • Showthat (P → Q) ∧ (P → R) ≡ P → (Q ∧ R): by equivalence laws: › Law with implication on both sides › Distribution law on LHS Introduction to Mathematical Logic: MATH-105 Jan-May 2013 28
  • 29. •Proposition › Statement, Truth value, › Proposition, Propositional symbol, Open proposition •Operators › Define by truth tables › Composite propositions › Tautology and contradiction •Equivalence of propositional statements › Definition › Proving equivalence (by truth table or equivalence laws) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 29
  • 30. Propositionalfunction (open sentence): statement involving one or more variables,  e.g.: x-3 > 5. Let us call this propositional function P(x), where P is the predicate and x is the variable. What is the truth value of P(2) ? false What is the truth value of P(8) ? false What is the truth value of P(9) ? true When a variable is given a value, it is said to be instantiated Truth value depends on value of variable Introduction to Mathematical Logic: MATH-105 Jan-May 2013 30
  • 31. Letus consider the propositional function Q(x, y, z) defined as: x + y = z. Here,Q is the predicate and x, y, and z are the variables. What is the truth value of Q(2, 3, 5) ? true What is the truth value of Q(0, 1, 2) ? false What is the truth value of Q(9, -9, 0) ? true A propositional function (predicate) becomes a proposition when all its variables are instantiated. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 31
  • 32. Other examples of propositional functions Person(x), Person(Socrates) = T x is a person which is true if Person(dog) = F CSCourse(x), which is true if x is a computer science course CS Course(C-language) = T CS Course(MATH 102) = F Introduction to Mathematical Logic: MATH-105 Jan-May 2013 32
  • 33. LetP(x) be a predicate (propositional function). Universally quantified sentence: For all x in the universe of discourse P(x) is true. Using the universal quantifier ∀: ∀x P(x) “for all x P(x)” or “for every x P(x)” (Note:∀x P(x) is either true or false, so it is a proposition, not a propositional function.) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 33
  • 34. Example: Let the universe of discourse be all people S(x): x is a Mathematics student. G(x): x is a genius. What does ∀x (S(x) → G(x)) mean ? “If x is a mathematics student, then x is a genius.” or “All Mathematics students are geniuses.” Ifthe universe of discourse is all mathematics students, then the same statement can be written as ∀x G(x) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 34
  • 35. Existentiallyquantified sentence: There exists an x in the universe of discourse for which P(x) is true. Using the existential quantifier ∃: ∃x P(x) “There is an x such that P(x).” “There is at least one x such that P(x).” (Note:∃x P(x) is either true or false, so it is a proposition, but no propositional function.) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 35
  • 36. Example: P(x):x is a Mathematics professor. G(x): x is a genius. What does ∃x (P(x) ∧ G(x)) mean ? “There is an x such that x is a Mathematics professor and x is a genius.” or “At least one Mathematics professor is a genius.” Introduction to Mathematical Logic: MATH-105 Jan-May 2013 36
  • 37. Another example: Let the universe of discourse be the real numbers. What does ∀x∃y (x + y = 320) mean ? “For every x there exists a y so that x + y = 320.” Is it true? yes Is it true for the natural numbers? no Introduction to Mathematical Logic: MATH-105 Jan-May 2013 37
  • 38. A counterexample to ∀x P(x) is an object c so that P(c) is false. Statementssuch as ∀x (P(x) → Q(x)) can be disproved by simply providing a counterexample. Statement: “All birds can fly.” Disproved by counterexample: Penguin. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 38
  • 39. ¬(∀x P(x)) is logically equivalent to ∃x (¬P(x)).  ¬(∃x P(x)) is logically equivalent to ∀x (¬P(x)).  This is de Morgan’s law for quantifiers Introduction to Mathematical Logic: MATH-105 Jan-May 2013 39
  • 40. Examples  Not all roses are red  ¬∀x (Rose(x) → Red(x))  ∃x (Rose(x) ∧ ¬Red(x)) Nobody is perfect x (Person(x)  Perfect(x)) x (Person(x)  Perfect(x)) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 40
  • 41. A predicate can have more than one variables. › S(x, y, z): z is the sum of x and y › F(x, y): x and y are friends  We can quantify individual variables in different ways › ∀x, y, z (S(x, y, z) → (x <= z ∧ y <= z)) › ∃x ∀y ∀z (F(x, y) ∧ F(x, z) ∧ (y != z) → ¬F(y, z) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 41
  • 42. Exercise: translate the following English sentence into logical expression “There is a rational number in between every pair of distinct rational numbers”  Use predicate Q(x), which is true when x is a rational number  ∀x,y (Q(x) ∧ Q (y) ∧ (x < y) →  ∃u (Q(u) ∧ (x < u) ∧ (u < y))) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 42
  • 43. • Propositional functions (predicates) • Universal and existential quantifiers, and the duality of the two • When predicates become propositions › All of its variables are instantiated › All of its variables are quantified • Nested quantifiers › Quantifiers with negation • Logical expressions formed by predicates, operators, and quantifiers Introduction to Mathematical Logic: MATH-105 Jan-May 2013 43
  • 44. Mathematical Reasoning Introduction to Mathematical Logic: MATH-105 Jan-May 2013 44
  • 45. We need mathematical reasoning to determine whether a mathematical argument is correct or incorrect and construct mathematical arguments. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 45
  • 46. Argument: An argument is an assertion; that a group of propositions called premises, yields an other proposition, called the conclusion. Let P1, P2 , P3 ,…, Pn is the group of propositions that yields the conclusion Q. Then, it is denoted as P1, P2 , P3 ,…, Pn |- Q  Valid Argument: An argument is called valid argument if the conclusion is true whenever all the premises are true or The argument is valid iff the ANDing of the group of propositions implies conclusion is a tautology ie: P(P1, P2 , P3 ,…, Pn ) Q is a tautology 46 Introduction to Mathematical Logic: MATH-105 Jan-May 2013
  • 47. Fallacy Argument: An argument is called fallacy or an invalid argument if it is not a valid argument. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 47
  • 48.  Translate the following into symbolic form and test the validity of the argument: 1.“If I will select in IAS examination, then I will not be able to go to London. Since, I am going to London, I will not select in IAS examination”. 2. “If 6 is even then 2 does not divide 7. Either 5 is not prime or 2 divides 7. But 5 is prime, therefore, 6 is not even”. Introduction to Mathematical Logic: MATH-105 Jan-May 2013 48
  • 49. Ans-1: p: I will select in IAS examination q: I will go to London Premises: 1. p ~q 2. q Conclusion: ~p Verify: [(p ~q) ∧(q)] ~p is a tautology Introduction to Mathematical Logic: MATH-105 Jan-May 2013 49
  • 50.  Ans-2: p: 6 is even q: 2 divides 7 r: 5 is prime Premises: 1. p ~q 2. ~r ∨ q 3. r Conclusion: ~p Verify: [ (1) ∧ (2) ∧ (3) ] ~p is a tautology Introduction to Mathematical Logic: MATH-105 Jan-May 2013 50
  • 51. The problem of finding whether a given statement is tautology or contradiction or satisfiable in a finite number of steps, is called as decision problem, the construction of truth tables may not be often a practical solution. We therefore consider alternate procedure known as reduction to normal forms. The two such forms are:  Disjunctive Normal Form (DNF)  Conjunctive Normal Form (CNF) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 51
  • 52. A compound statement is said to be in dnf if it is disjunction of conjunction of the variables or their negations.  Ex:(p ∧ q ∧ r) ∨ (~p ∧q ∧r) ∨ (~p ∧~q ∧ r)  A compound statement is said to be in cnf if it is conjunction of disjunction of the variables or their negations.  Ex:(p ∨ q ∨ ~r) ∧ (p ∨ ~q ∨ r) ∧ (~p ∨ ~q ∨ r) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 52
  • 53. The truth table for the given statement is: P Q P Q Q P (P Q)  (Q P) T T T T T T F F T F F T T F F F F F T T Introduction to Mathematical Logic: MATH-105 Jan-May 2013 53
  • 54. DNF:  DNF: (P ∧ Q) ∨ (~P ∧ ~Q) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 54
  • 55. CNF:  CNF: ~(P ∧ ~Q) ∧ ~(~P ∧ Q) ≡ (~P ∨ Q) ∧ (P ∨ ~Q) Introduction to Mathematical Logic: MATH-105 Jan-May 2013 55
  • 56. Mathematical Reasoning • Terminology (argument, valid argument and fallacy argument) • Examples on valid arguments • Normal forms (DNF and CNF) • Truth table method to express the statements as dnf and cnf forms Introduction to Mathematical Logic: MATH-105 Jan-May 2013 56