Chapter 2 Fundamentals of Logic - PowerPoint PPT Presentation

About This Presentation
Title:

Chapter 2 Fundamentals of Logic

Description:

Assertions, called statements or propositions, are declarative ... New statements can be obtained from existing ones in two ways. ... The principle of duality. ... – PowerPoint PPT presentation

Number of Views:102
Avg rating:3.0/5.0
Slides: 65
Provided by: ncu3
Category:

less

Transcript and Presenter's Notes

Title: Chapter 2 Fundamentals of Logic


1
Chapter 2 Fundamentals of Logic
  • Dept of Information management
  • National Central University
  • Yen-Liang Chen

2
2.1 Basic connectives and truth table
  • Assertions, called statements or propositions,
    are declarative sentences that are either true or
    false
  • New statements can be obtained from existing ones
    in two ways.
  • Transform a given statement p into the statement
    ?p
  • Combine two or more statements into a compound
    statement

3
Forming a compound statement
4
Ex 2.1
  • s Phyllis goes out for a walk
  • t The moon is out
  • u It is snowing
  • (t??u)?s
  • t?(?u?s)
  • ?(s?(u?t))

5
Ex 2.2
  • If I weigh more than 120 pounds, then I shall
    enroll in an exercise class
  • p I weigh more than 120 pounds
  • q I shall enroll in an exercise class
  • the four cases of p?q

6
A word of caution
  • In our everyday language, we often find
    situations where an implications is used when the
    intention actually calls for a biconditional.
  • If you do your homework, then you will get to
    watch the baseball game.

7
p?(q?r)?(p?q)?r
8
p?(p?q), p?(?p?q)
9
Key ideas
  • A compound statement is a tautology if it is true
    for all truth value assignments and a
    contradiction if it is false for all truth value
    assignments
  • To show (p1?p2??pn)?q a valid argument, we need
    to show this statement is a tautology. If any pi
    is not true, then no matter what q is the
    statement is true. Thus, we only need to show
    that q follows from (p1?p2??pn), when all of
    them are true.
  • Premises and conclusion

10
2.2 Logic equivalence the laws of logic
  • Ex 2.7, p?q is equivalent to ?p?q
  • Definition 2.2. Two statements are said to be
    logically equivalent, s1?s2, when the statement
    s1 is true if and only if the statement s2 is true

11
(p?q)?(p?q)?(q?p)
12
(p?q)?(p?q)?? (p?q)
13
DeMorgans law
  • ? (p?q) ??p??q ?(p?q)??p??q

14
The distributive law
  • p?(q?r) ?(p?q) ? (p?r)
  • p? (q?r) ?(p?q) ? (p?r)

15
Observations
  • When s1?s2, then s1?s2 is a tautology when
    ?s1??s2 then ?s1??s2 is a tautology
  • When s1?s2 and s2?s3, then s1?s3

16
The laws of logic
  • ??p?p
  • ?(p?q)??p??q
  • ?(p?q)??p??q
  • p?q?q?p
  • p?q?q?p
  • p?(q?r) ? (p?q)?r
  • p?(q?r) ? (p?q) ?r
  • p?(q?r) ? (p?q) ?(p?r)
  • p?(q?r) ? (p?q) ? (p?r)
  • p?p?p
  • p?p?p
  • p?F?p
  • p?T?p
  • p??p?T
  • p??p?F
  • p?T?T
  • p?F?F
  • p?(p?q) ? p
  • p?(p?q) ? p

17
Observation
  • Definition 2.3, sd, the dual of s, is obtained by
    replacing ? with ?, ? with ?, T with F and F with
    T.
  • Theorem 2.1. The principle of duality. Let s and
    t be statements that contain no logical
    connectives other than ? and ?. If s?t, then
    sd?td.

18
Two substitution rules
  • Suppose that the compound statement P is a
    tautology. If p is a primitive statement that
    appears in P and we replace each occurrence of p
    by the same statement q, then the resulting
    compound statement P1 is also a tautology.
  • Let P be a compound statement where p is an
    arbitrary statement that appears in P, and let q
    be such a statement such that p?q. Suppose that
    in P we replace one or more occurrences of p by
    q. Then this replacement yields the compound
    statement P1. Under these circumstances P? P1.

19
Ex 2.10
  • P ?(p?q)?(?p??q) is a tautology
  • P1 ?((r?s)?q)?(? (r?s)??q)
  • P2 ?((r?s)? (t?u))?(? (r?s)?? (t?u))

20
Ex 2.11
  • Let P (p?q)?r be a compound statement.
  • Because (p?q)??p?q, if P1 (?p?q)?r, then P1?P.
  • Let P p?(p?q) be a compound statement.
  • Because ??p?p, if P1 ??p ?(??p ?q), then P1?P.

21
Ex 2.12, Ex 2.13
  • ?(p?q)?r?
  • ??(p?q)? r?
  • ??(p?q)?? r?
  • (p?q)?? r
  • ?(p?q)?
  • ?(?p?q)?
  • ??p??q?
  • p??q

22
Definitions
  • Implication p?q
  • contrapositive, ?q?? p
  • converse, q? p
  • inverse ? p ?? q

23
Ex 2.16, Ex 2.17
  • (p?q)??(?p?q)?
  • (p?q)?(??p??q)?
  • (p?q)?(p??q)?
  • p?(q??q)?
  • p?F?p
  • ??(p?q)?r??q ?
  • ??(p?q)?r???q ?
  • (p?q)?r?q ?
  • (p?q)?(q?r) ?
  • (p?q)?q?r ?
  • q?r

24
Simplifying the switch network
  • (p?q?r)?(p?t??q)?(p??t?r)?p?r?(t??q)

25
2.3 Logic implication rules of inference
  • (p1?p2??pn)?q is a valid argument, if the
    premises are true, then the conclusion is also
    true.
  • If any one of p1, p2,, pn is false, the
    implication is automatically true.
  • To establish the validity of a given argument is
    to show that the statement (p1?p2??pn)?q is a
    tautology.
  • The conclusion is deduced or inferred from the
    truth of premises.

26
Ex 2.19
  • (p?r)?(?q?p)??r?q

27
Ex 2.20
  • p?((p?r)?s)?(r?s)

28
Key concepts
  • Definition 2.4. If p and q are arbitrary
    statements such that p?q is a tautology, then we
    say that p is logically implies q and we write
    p?q to denote this situation.
  • When p?q, we refer to p?q as a logical
    implication.
  • If p?q, then p?q is a tautology, and we have p?q
    and q? p. Conversely, suppose that p?q and q? p,
    then we have p?q.

29
The rule of inferences
  • The rule of Modus Ponens
  • (method of affirming), the rule of detachment
  • p?( p?q)?q
  • (r?s)?(r?s)?(?t?u)? (?t?u)
  • The rule of syllogism
  • ( p?q)?( q?r)? ( p?r)

30
Ex 2.24
  • (p)? (p??q) ? (?q??r) ? ?r

31
the rule of Modus Tollens
  • (method of denying), ?q?( p?q)? ?p
  • Ex 2.25
  • (p?r)? (r?s)? (t??s)? (?t?u)? (?u) ? ?p

32
Some notes
  • Some arguments look similar in appearance but are
    indeed invalid.
  • q?( p?q)?p
  • ?p?( p?q)??q
  • the rule of conjunction, (p)?(q)?(p?q)
  • the rule of disjunctive syllogism, (
    p?q)?(?p)? q

33
the rule of contradiction
  • (?p)?(F)?(p)

34
The rule of contradiction
  • When we want to establish the validity of the
    argument (p1?p2??pn)?q, we can establish the
    validity of the logically equivalent argument
    (p1?p2??pn??q)?F

35
(No Transcript)
36
Ex 2.30
37
Ex 2.31
38
Ex 2.32
  • (?p?q)?(q?r)??r??p?F

39
Another inference rule
  • ( p)?(q?r) ?( p?q) ?r
  • ((p1?p2??pn)?(q?r)) ?(p1?p2??pn?q) ?r
  • This result tells us that if we want to establish
    the validity of the first argument, we may be
    able to do so by establishing the validity of the
    corresponding argument.

40
Ex 2.33
41
(No Transcript)
42
2.4 The use of Quantifiers
  • Definition 2.5. A declarative sentence is an open
    statement if
  • (1) it contains one or more variables, and
  • (2) it is not a statement, but
  • (3) it becomes a statement when the variables in
    it are replaced by certain allowable choices.
  • These allowable choices constitute what is called
    the universe or universe of discourse. The
    universe comprises the choices we wish to
    consider or allow for the variables in the open
    statement.

43
definitions
  • Existential quantifier (?) and universal
    quantifier (?) are used to quantify the open
    statements.
  • In an open statement p(x) the variable x is
    called a free variable. In the statement ?x p(x)
    the variable x is called a bound variableit is
    bound by the existential quantifier ?. Similarly,
    in the statement ?x p(x) the variable x is bound
    by the universal quantifier ?.

44
Ex 2.36
  • p(x) x?0
  • r(x) x2-3x-40
  • q(x) x2 ?0
  • s(x) x2-3gt0
  • ?x p(x)?r(x)
  • ?x p(x)?q(x)
  • ?x q(x)?s(x)
  • ?x r(x)?s(x)
  • ?x r(x)?p(x)

45
Ex 2.37
  • p(x) x is a rational number, q(x) x is a real
    number
  • ?x p(x)?q(x)
  • e(t) triangle t is equilateral, a(t) triangle t
    has three angles of 60?
  • ?t e(t)?a(t)
  • ?x sin2xcos2x1
  • ?m?n 41m2n2

46
Ex 2.39
  • For n1 to 20 do Ann?n-n
  • ?n (An?0)
  • ?n (An12An)
  • ?n (1?n?19)?(AnltAn1)
  • ?m ?n (m?n)?(Am?An)

47
Definitions
  • p(x) and q(x) are called logically equivalent,
    written as ?x p(x)?q(x), when p(a) ? q(a) is
    true for each replacement a from the universe.
    We say that p(x) logically implies q(x), written
    as ?x p(x)?q(x), when p(a)?q(a) is true for
    each replacement a from the universe.
  • ?x p(x)?q(x) if and only if ?x p(x)?q(x) and
    ?x q(x)?p(x)
  • ?x p?q contrapositive, ?x ?q?? p converse, ?x
    q? p inverse ?x ? p ?? q

48
Examples
  • Ex 2.40.
  • s(x) x is a square e(x) x is a equilateral
  • ?x s(x)?e(x) contrapositive, converse, inverse
  • Ex 2.41.
  • p(x) ?x?gt3 q(x) xgt3
  • ?x p(x)?q(x) contrapositive, converse, inverse
  • Ex 2.42. r(x) 2x15 s(x) x29
  • ?x r(x)?s(x) ?x r(x) ? ?x s(x)
  • but we have ?x r(x)?s(x) ? ?x r(x) ? ?x
    s(x)

49
Table 2.22
  • ?x r(x)?s(x) ? ?x r(x) ? ?x s(x)
  • ?x r(x)? s(x) ? ?x r(x) ??x s(x)
  • ?x r(x)?s(x) ? ?x r(x) ? ?x s(x)
  • ?x r(x)?s(x) ??x r(x) ? ?x s(x)

50
Ex 2.43
  • ?x p(x)?(q(x)?r(x)) ? ?x (p(x)?q(x))?r(x)
  • ?x p(x)?q(x)??x(?p(x)?q(x))
  • ?x ??p(x)??x p(x)
  • ?x ?p(x)?q(x)??x ?p(x)??q(x)
  • ?x ?p(x)?q(x)??x ?p(x)??q(x)

51
Rules for negation
  • ??x p(x) ? ?x ? p(x)
  • ??x p(x) ? ?x ? p(x)
  • ??x ? p(x) ? ?x?? p(x) ? ?x p(x)
  • ??x ? p(x) ? ?x?? p(x) ? ?x p(x)

52
Ex 2.44
  • p(x) x is odd, q(x) x2-1 is even
  • ?x (p(x)?q(x)). If x is odd, x2-1 is even.
  • ? ?x (p(x)?q(x))
  • ??x ?(p(x)?q(x))
  • ??x ?(?p(x)?q(x))
  • ??x ??p(x)??q(x))
  • ??x p(x)??q(x)
  • There exists an integer x such that x is odd and
    x2-1 is odd.

53
examples
  • Ex 2.45
  • ?x ?y p(x, y) ? ?y ?x p(x, y)
  • Ex 2.46
  • ?x ?y ?z p(x, y, z) can be written as ?x, y, z
    p(x, y, z)
  • Ex 2.47
  • ?x ?y p(x, y) ? ?y ?x p(x, y)

54
Ex 2.48
  • when a statement involves both existential and
    universal quantifiers, we must be careful about
    the order in which the quantifiers are written.
  • p(x, y) xy17
  • ?x ?y p(x, y) is different from ?y ?x p(x, y)

55
Ex 2.49
  • What is the negation of ?x?y(p(x,y)?q(x,y))
    ?r(x,y)

56
Ex 2.50
57
2.5 Quantifiers, definitions and the proofs of
theorems
  • Ex 2.52.
  • For all n in 2, 4, 6,, 26, we can write n as the
    sum of at most three perfect squares.
  • Table 2.4 shows this by the method of exhaustion.
  • The method is reasonable when we dealing with a
    fairly small universe.
  • When the universe is very large, it is impossible
    to use the method of exhaustion.

58
The rule of universal specification.
  • If p(x) is an open statement for a given
    universe, and if ?x p(x) is true, then p(a) is
    true for each a in the universe.
  • Note that this a is a specific but arbitrarily
    chosen member from the prescribed universe.

59
Ex 2.53 (b)(c)
60
The rule of universal generalization.
  • If an open statement p(x) is proved to be true
    when x is replaced by a specific but arbitrarily
    chosen element c from our universe, then the
    universally quantified statement ?x p(x) is true.
  • Furthermore, the rule extends beyond a single
    variable. That is, the same holds for ?x ?y p(x,
    y), ?x ?y ?z p(x, y, z) or more variables.

61
Ex 2.54
62
Ex 2.56
63
Theorems Proving
  • The rule of universal specification and the rule
    of universal generalization can be applied to
    prove theorems.
  • Theorem 2.2. If k and l are both odd, then kl is
    even.
  • Theorem 2.3. If k and l are both odd, then k?l is
    also odd.

64
Theorem 2.4
  • If m is an even integer, the m7 is odd.
  • Theorem 2.4 uses three different ways to prove
    the theorem.
  • (1) p?q, if m is even then m7 is even
  • (2) ?q??p, if m7 is even then m is odd
  • (3)p??q?F, if m and m7 are both even, then it is
    a contradiction.
Write a Comment
User Comments (0)
About PowerShow.com