introduction to logic - discreet maths

Upload: cedrix-jonhtan

Post on 07-Apr-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/4/2019 Introduction to Logic - Discreet Maths

    1/24

    INTRODUCTION TO LOGIC

    Chapter Objectives

    In this chapter you will learn:

    what logic is; about the basis of logic: the simple

    statement;

    how to construct a truth table; about the five basic logic connectives and

    there truth tables;

    the rules of logic; what makes a statement a tautology; what makes a statement a contradiction; what logical equivalence is; what a proposition is; what makes an argument valid;

  • 8/4/2019 Introduction to Logic - Discreet Maths

    2/24

    1.1 WHAT IS LOGIC?

    Logic is the study of the principles and methodsused in distinguishing valid arguments from

    those that are invalid.

    Logic is also known as propositional calculus.1.1.1 SIMPLE STATEMENTS

    The basic building block in logic is thestatement, also referred to as a proposition.

    A statement is a declarative sentence, which canonly be either true or false.

    Statements are represented by letters such asp, q,and r, . . .

    Example: Jakarta is a city in Indonesia

  • 8/4/2019 Introduction to Logic - Discreet Maths

    3/24

    1.1.2 TRUTH TABLES

    Since a statement can only be true orfalse, thevalues of a statement can be represented by a

    truth table.

    Variablesp, q, r, . . . are used to represent basicstatements.

    T and F stand for true and false.p q

    T T

    T FF T

    F F

    In a truth table the number of truth-values (rows)is n2 , where n is the number of basic statements(variables)

  • 8/4/2019 Introduction to Logic - Discreet Maths

    4/24

    1.1.3 COMPOUND STATEMENTS

    The combination of two or more simplestatements is a compound statement, or

    compound proposition.

    Example: 2 + 1 = 5 and 6 + 2 = 8

    Example: The sky is clear or It is raining today

    The variablesp, q, r, . . . denote simplestatements in the compound proposition ,,, rqpP , where P is a proposition.

    1.2 BASIC LOGIC CONNECTIVES

    Compound statements are connected usingmainly five basic connectives: conjunction,

    disjunction, negation, conditional, and

    biconditional.

  • 8/4/2019 Introduction to Logic - Discreet Maths

    5/24

    1.2.1 CONJUNCTION

    Any two statements can be combined by theword and to form a composite statement which

    is called the conjunction of the original

    statements.

    The connection of the statementsp and q issymbolically represented bypq

    The truth values ofpq in a truth table:p q p q

    T T T

    T F F

    F T F

    F F F

    Ifp is true and q is true thenpq is true;otherwisepq is false.

    Example 12: Sidney is in Australia and 2 + 2 = 4

    Example 13: Sidney is in Australia and 2 + 2 = 5

    Example 14: Sidney is in Malaysia and 2 + 2 = 4

    Example 15: Sidney is in Malaysia and 2 + 2 = 5

    Only example 12 contains two simple statementswhich are true, the others all contain simple

    statements in which at least one of them is false,

    so only example 12 is true.

  • 8/4/2019 Introduction to Logic - Discreet Maths

    6/24

    1.2.2 DISJUNCTION

    Any two statements can be combined by theword or (in the sense of and/or, called the

    inclusive or), to form a new statement which is

    called the disjunction of the original two

    statements.

    The connection of the statementsp or q issymbolically represented bypq

    The truth values ofpq in a truth table:p q p q

    T T T

    T F T

    F T TF F F

    Ifp is true or q is true or bothp and q are true,thenpq is true; otherwisepq is false.

    Example 16: Sidney is in Australia or 2 + 2 = 4

    Example 17: Sidney is in Australia or 2 + 2 = 5

    Example 18: Sidney is in Malaysia or 2 + 2 = 4

    Example 19: Sidney is in Malaysia or 2 + 2 = 5

    Only example 19 is false. Each of the othercompound statements is true since at least one of

    its simple statements is true.

  • 8/4/2019 Introduction to Logic - Discreet Maths

    7/24

    1.2.3 NEGATION

    Given any statementp, another statement, calledthe negation ofp, can be formed by writing It is

    false that . . . beforep or, if possible, by

    inserting inpthe word not

    Negation can be symbolically represented by ~p,or

    p

    The truth values of ~p in a truth table:p ~p

    T F

    F T

    Ifp is true then ~p is false; ifp is false, then ~p istrue.

    Example 20: Ifpis Sidney is in Australia, then Sidney

    is not in Australia is the negation ~p

    Example 21: Ifpis 2 + 2 = x, then 2 + 2 x is the

    negation ~p

  • 8/4/2019 Introduction to Logic - Discreet Maths

    8/24

    1.2.4 CONDITIONAL

    Many statements, especially in mathematics, areof the form Ifp then q or p implies q. Such

    statements are called conditional statements.

    Conditional statements are symbolicallyrepresented aspq

    The truth values ofpq in a truth table:p q p q

    T T T

    T F F

    F T T

    F F T

    The conditionalpq is true unlessp is true andq is false.

    Example 22: If Sidney is in Australia then 2 + 2 = 4

    Example 23: If Sidney is in Australia then 2 + 2 = 5

    Example 24: If Sidney is in Malaysia then 2 + 2 = 4

    Example 25: If Sidney is in Malaysia then 2 + 2 = 5

    By the conditionalpq only example 23 isfalse. But how can this be as clearly 2 +2 = 4 is

    true and 2 + 2 =5 is clearly false? This is the

    case as once we know that the if is false we no

    longer care if the that is true or not.

  • 8/4/2019 Introduction to Logic - Discreet Maths

    9/24

    Exercise 1: Construct the truth table for ~pq

    p q ~p ~p qT T F F

    T F F F

    F T T T

    F F T F

    Exercise 2: Construct the truth table for(pq) (pq)

    p q p q p q (p q) (p q)

    T T T T T

    T F T F F

    F T T F F

    F F F F T

  • 8/4/2019 Introduction to Logic - Discreet Maths

    10/24

    1.2.5 BICONDITIONAL

    Another common statement called a bicon-ditional statementis of the form p iffq

    Biconditional statements are symbolicallyrepresented aspq

    The truth-values ofpq in a truth table:p q p q

    T T T

    T F F

    F T F

    F F T

    Ifp and q have the same truth value, thenpqis true;

    if p and q have opposite truth values, thenpqis false.

    Example 26: Sidney is in Australia iff 2 + 2 = 4

    Example 27: Sidney is in Australia iff 2 + 2 = 5

    Example 28: Sidney is in Malaysia iff 2 + 2 = 4

    Example 29: Sidney is in Malaysia iff 2 + 2 = 5

    By the conditionalpq examples 26 & 29 aretrue, examples 27 & 28 are false.

    pq can be represented as pqqp

  • 8/4/2019 Introduction to Logic - Discreet Maths

    11/24

    1.3 PROPOSITIONS AND TRUTH TABLES

    By repetitive use of the logical connectives (, ,~, , and, ), we can construct compoundstatements that are more involved.

    In the case where the substatementsp, q, . . . of acompound statement, P(p, q, ...) are variables, the

    compound statement is called a proposition.

    The truth-value of a proposition is known oncethe truth-values of its variables are known. A

    simple concise way to show this relationship is

    through a truth table.

    Example 30: The truth table of the proposition

    qp ~~ is:

    p q ~q p ~q ~(p ~q)

    T T F F T

    T F T T F

    F T F F T

    F F T F T

    Observe that the first columns of the table are forthe variablesp, q, . . . and there are enough rows

    in the table to allow for all possible combinations

    of T and F for these variables, i.e. the number of

    rows =

    n

    2

  • 8/4/2019 Introduction to Logic - Discreet Maths

    12/24

    Example 31: Construct the truth table for pqqp

    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 T T T

    Example 32: Construct the truth table for

    ~(pq) ~(qp)

    p q p q q p ~(p q) ~(q p) ~(p q)

    ~(q p)

    T T T T F F F

    T F F F T T T

    F T F F T T T

    F F F T T F T

  • 8/4/2019 Introduction to Logic - Discreet Maths

    13/24

    1.3.1 EXCLUSIVE DISJUNCTION

    In addition to the inclusive or there is anothermeaning for or in English called the exclusive

    or, which means either one or the other, but not

    both. In Logic exclusive or is referred to as

    exclusive disjunction.

    In mathematics or in logic, or always meansinclusive or i.e., or always refers to thedisjunction connective.

    Exclusive or can be expressed symbolically as~(pq)

    Exercise 3: Complete the truth table for

    ~(pq)

    p q p q ~(p q)

    T T T F

    T F F T

    F T F T

    F F T F

  • 8/4/2019 Introduction to Logic - Discreet Maths

    14/24

    1.4.1 TAUTOLOGY

    A compound proposition that is always TRUE iscalled a tautology.

    Example 33: pp ~ is a tautology as all entries in

    the last column are Ts

    p ~p p ~p

    T F T

    F T T

    1.4.2 CONTRADICTIONA compound proposition that is always FALSE

    is called a contradiction.

    Example 34: pp ~ is a contradiction as all

    entries in the last column are Fs

    p ~p p ~p

    T F FF T F

  • 8/4/2019 Introduction to Logic - Discreet Maths

    15/24

    1.4.3 PRINCIPLE OF SUBSTITUTION

    If ),,(

    qpP is a tautology, then ),,( 21

    PPP isalso a tautology.

    Example 35: We have shown thatp ~p is a

    tautology so by the principle of

    substitution, substituting qrforp

    we obtain the proposition

    (qr) ~(qr), which is also a

    tautology.

    q r q r ~(q r) (q r) ~(q r)

    T T T F T

    T F F T T

    F T F T TF F F T T

    1.4.4 LAW OF SYLLOGISMA fundamental principle of logical reasoning,

    called the Law of Syllogism, states: Ifp implies

    q and q implies r, thenp implies r.

    In other words the proposition[(pq) (qr)] (pr) is a tautology.

  • 8/4/2019 Introduction to Logic - Discreet Maths

    16/24

    Example 36:

    Show that [(pq) (qr)] (pr)

    is a tautology.

    p q r p q q r (p q)

    (q r)

    p r [(p q)

    (q r)]

    (p r)

    T T T T T T T T

    T T F T F F F T

    T F T F T F T T

    T F F F T F F T

    F T T T T T T T

    F T F T F F T T

    F F T T T T T T

    F F F T T T T T

    1.5 LOGICAL EQUIVALENCE

    Two propositions ,...),( qpP and ,...),( qpQ aresaid to be logically equivalent if the final

    columns in their truth tables are the same.

    Logical equivalence is denoted with

  • 8/4/2019 Introduction to Logic - Discreet Maths

    17/24

    Exercise 4: Show thatpq and ~q ~p are

    logically equivalent.

    p q ~p ~q p q ~q ~p

    T T F F T T

    T F F T F F

    F T T F T T

    F F T T T T

    Exercise 5: Show that (pq) (qp) pq

    p q p q q p (p q) (q p) p q

    T T T T T T

    T F F T F F

    F T T F F F

    F F T T T T

    Since the last two columns in the truth tables arethe same the statements are logically equivalent.

    1.5.1 DeMORGANS LAWSDeMorgans Laws are simply:

    a. qpqp ~~~ b. qpqp ~~~

    DeMorgans Laws are important both in logicand in set theory.

  • 8/4/2019 Introduction to Logic - Discreet Maths

    18/24

    1.5.2 LOGICALLY TRUE STATEMENTS

    A statement is said to be logically true if it isderivable from a tautology.

    Example 37: It is raining or it is not raining.

    Example 37 is logically true since it is derivablefrom the tautologyp ~p, wherepis It is

    raining.

    1.5.3 LOGICALLY EQUIVALENTSTATEMENTS

    Statements are logically equivalent if thepropositions that make up the statement arelogically equivalent to each other.

    Example 38: Since qpqp ~~~ , thestatement It is not true that roses arered and violets are blue is logically

    equivalent to the statement Roses are

    not red or violets are not blue.

    Wherepis roses are red, and q is

    violets are blue.

  • 8/4/2019 Introduction to Logic - Discreet Maths

    19/24

    1.6 ARGUMENTS

    An argument is a relationship between a set ofpropositions, nPPP ,,, 21 , called premises, and

    another proposition Q, called the conclusion.

    An argument is denoted by nPPP ,,, 21 QAn argument nPPP ,,, 21 Q is said to be valid

    iff QPPP n )...( 21 is a tautology.

    Example 39: The argumentp,pq q is valid,

    since [p (pq)] q is a

    tautology.

    p q p q p (p q) [p (p q)]q

    T T T T T

    T F F F T

    F T T F T

    F F T F T

    Example 40: The argumentpq, q p is a

    fallacy, since [(pq)q] p isnot a tautology.

    p q p q (p q) q [(p q) q] p

    T T T T T

    T F F F T

    F T T T F

    F F T F T

  • 8/4/2019 Introduction to Logic - Discreet Maths

    20/24

    Example 41: Analyse the following argument.

    1S : If a man is a bachelor, he is unhappy.2S : If a man is unhappy, he dies young.

    . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    S: Bachelors die young.

    First we must define our terms:

    p: he is a bachelor q: he is unhappy

    r: he dies young

    and the argument ispq, qr pr

    Show that [(pq) (qr)] (pr) is a

    tautology.

    p q r p q q r [(p q)

    (q r)]

    p r [(p q)

    (q r)] (p r)

    T T T T T T T T

    T T F T F F F T

    T F T F T F T T

    T F F F T F F T

    F T T T T T T TF T F T F F T T

    F F T T T T T T

    F F F T T T T T

    Since [(pq) (qr)] (pr) is a

    tautology the argument is valid.

  • 8/4/2019 Introduction to Logic - Discreet Maths

    21/24

    Another type of argument does not differentiatebetween the statements and the conclusion by the

    use of a line; it uses the word therefore instead.

    Example 42: Is this argument valid? An interesting

    teacher keeps me awake. I stay awake

    in CS218 class. Therefore, my CS218

    teacher is interesting.

    First define the terms:

    t: my teacher is interesting

    a: I stay awake m: I am in CS218 class

    and the argument is: ta,am mt

    Show that [(ta) (am)] (mt) is a

    tautology.t a m t a a m (t a)

    (a m)

    m t [(t a)

    (a m)]

    (m t)

    T T T T T T T T

    T T F T F F F T

    T F T F F F T TT F F F F F F T

    F T T T T T F F

    F T F T F F F T

    F F T T F F F T

    F F F T F F F T

    Since [(ta) (am)] (mt) is not a

    tautology, the argument is not a valid argument.

  • 8/4/2019 Introduction to Logic - Discreet Maths

    22/24

    Example 43: Is this argument valid? Sean is either a

    carpenter or a plumber (but not both).

    If he carries a wrench, hes a plumber.Sean is a carpenter. Therefore, he does

    not carry a wrench.

    First define the terms:

    c: Sean is a carpenter

    p: Sean is a plumber

    w: Sean carries a wrench

    and the argument is ~(cp), wp, c ~w

    So we need to show that

    [~(cp) (wp) c] ~w is a tautology.

    c p w ~(c

    p) w

    p ~(c

    p) (w p)

    c

    ~w [~(c

    p) (w p)

    c] ~w

    T T T F T F F T

    T T F F T F T T

    T F T T F F F T

    T F F T T T T T

    F T T T T F F T

    F T F T T F T T

    F F T F F F F T

    F F F F T F T T

    Since [~(cp) (wp) c] ~w is a

    tautology, the argument is valid.

  • 8/4/2019 Introduction to Logic - Discreet Maths

    23/24

    1.7 LOGICAL IMPLICATION

    A proposition P(p, q, . . .) is said to logicallyimply a proposition Q(p, q, . . .), written

    P(p, q, . . .) Q(p, q, . . .) if Q(p, q, . . .) is true

    whenever P(p, q, . . .) is true.

    Example 44: Consider the truth table below.

    Observe thatp is true in cases (lines)

    1 and 2, and in these casespq isalso true. In other words, p logically

    impliespq

    p q p q

    T T T

    T F TF T T

    F F F

    1.8.1 BASIC LOGIC CONNECTIVESConnective Meaning Symbolized byconjunction and disjunction or negation not , ~

    conditional If ... then ..., Implies

    biconditional If and only if

  • 8/4/2019 Introduction to Logic - Discreet Maths

    24/24

    REMARKS

    The number of truth values (rows) is

    n2

    , where nis the number of basic statements (variables).

    The biconditional statement can be defined as pqqp

    The truth table of a proposition consists preciselyof the columns under the variables and thecolumn under the proposition.

    If P(p, q, . . .) is a tautology then ~P(p, q, . . .) is acontradiction, and if ~P(p, q, . . .) is a tautology

    then P(p, q, . . .) is a contradiction.

    An argumentnPPP ,,,

    21 Q is valid if Q is

    true whenever all the premises nPPP ,,, 21 are

    true.

    The argument nPPP ,,, 21 Q is valid iff nPPP 21 Q is a tautology.

    For any propositions P(p, q, . . .) and Q(p, q, . . .),the following statements are equivalent:i) P(p, q, . . .) logically implies Q(p, q, . . .)ii) The argument P(p, q, . . .) Q(p, q, . . .) is

    valid.

    iii)The proposition P(p, q, . . .)

    Q(p, q, . . .) isa tautology.