The Logic of Compound Statements - PowerPoint PPT Presentation

1 / 56
About This Presentation
Title:

The Logic of Compound Statements

Description:

Tautologies and Contradictions. A tautology is a statement that is logically equivalent to T. ... is a tautology. Example. I will ride my bike today. ... – PowerPoint PPT presentation

Number of Views:216
Avg rating:3.0/5.0
Slides: 57
Provided by: ronm8
Category:

less

Transcript and Presenter's Notes

Title: The Logic of Compound Statements


1
The Logic of Compound Statements
  • Prof. Milon
  • Coll 147

2
Section 1.1
  • Logical Form and Logical Equivalence

3
Logic Lecture
4
Statements
  • A statement is a sentence that is either true or
    false, but not both.
  • Statements
  • It is raining.
  • I am carrying an umbrella.
  • Not statements
  • Hello.
  • Are you there?

5
Logical Operators
  • Binary operators
  • Conjunction and.
  • Disjunction or.
  • Unary operator
  • Negation not.
  • Other operators
  • XOR exclusive or
  • NAND not both
  • NOR neither

6
Logical Symbols
  • Statements are represented by letters p, q, r,
    etc.
  • ? means and.
  • ? means or.
  • ? means not.

7
Examples
  • Basic statements
  • p It is raining.
  • q I am carrying an umbrella.
  • Compound statements
  • p ? q It is raining and I am carrying an
    umbrella.
  • p ? q It is raining or I am carrying an
    umbrella.
  • ?p It is not raining.

8
False Negations
  • Statement
  • Everyone likes me.
  • False negation
  • Everyone does not like me.
  • True negation
  • Someone does not like me.

9
False Negations
  • Statement
  • Someone likes me.
  • False negation
  • Someone does not like me.
  • True negation
  • No one likes me.

10
Truth Table of an Expression
  • Make a column for every variable.
  • List every possible combination of truth values
    of the variables.
  • Make one more column for the expression.
  • Write the truth value of the expression for each
    combination of truth values of the variables.

11
Truth Table for and
  • p ? q is true if p is true and q is true.
  • p ? q is false if p is false or q is false.

12
Truth Table for or
  • p ? q is true if p is true or q is true.
  • p ? q is false if p is false and q is false.

13
Truth Table for not
  • ?p is true if p is false.
  • ?p is false if p is true.

14
Example Truth Table
  • Truth table for the statement (?p) ? (q ? r ).

15
Logical Equivalence
  • Two statements are logically equivalent if they
    have the same truth values for all combinations
    of truth values of their variables.

16
Example Logical Equivalence
  • (p ? q) ? (?p ? ?q) ? (p ? ?q) ? (?p ? q)

17
DeMorgans Laws
  • ?(p ? q) ? (?p) ? (?q)
  • ?(p ? q) ? (?p) ? (?q)
  • (C) If it is not true that
  • i lt size value ! arrayi
  • then it is true that
  • i gt size value arrayi
  • If it is not true that x ? 5 or x ? 10, then it
    is true that x gt 5 and x lt 10.

18
Tautologies and Contradictions
  • A tautology is a statement that is logically
    equivalent to T.
  • A contradiction is a statement that is logically
    equivalent to F.
  • Some tautologies
  • p ? ?p
  • p ? ?q ? (? p ? q)
  • Some contradictions
  • p ? ?p
  • p ? q ? (?p ? ?q)

19
Section 1.2
  • Conditional Statements

20
The Conditional
  • A conditional statement is a statement of the
    form
  • p ? q
  • p is the hypothesis.
  • q is the conclusion.
  • Read p ? q as p implies q.

21
Truth Table for the Conditional
  • p ? q is true if p is false or q is true.
  • p ? q is false if p is true and q is false.

22
Example Conditional Statements
  • If it is raining, then I am carrying an
    umbrella.
  • This statement is true
  • when I am carrying an umbrella (whether or not it
    is raining), and
  • when it is not raining (whether or not I am
    carrying an umbrella).

23
The Contrapositive
  • The contrapositive of p ? q is ?q ? ?p.
  • The statements p ? q and ?q ? ?p are logically
    equivalent.

24
The Converse and the Inverse
  • The converse of p ? q is q ? p.
  • The inverse of p ? q is ?p ? ?q.

25
Is this logical?
26
The Biconditional
  • The statement p ? q is the biconditional of p and
    q.
  • p ? q is logically equivalent to
  • (p ? q) ? (q ? p).

27
Other Logical Operators
28
Exclusive-Or
  • The statement p ? q is the exclusive-or of p and
    q.
  • p ? q is defined by

29
Exclusive-Or
  • p ? q means one or the other, but not both.
  • p ? q is logically equivalent to
  • (p ? q) ? ?(q ? p)
  • p ? q is also logically equivalent to
  • ?(p ? q)
  • p ? q is also logically equivalent to
  • (p ? ?q) ? (q ? ?p)

30
Section 1.3
  • Valid and Invalid Arguments

31
Arguments
  • An argument is a sequence of statements.
  • The last statement is the conclusion.
  • All the other statements are the premises.
  • A mathematical proof is an argument.

32
Validity of an Argument
  • An argument is valid if its conclusion is true
    when its premises are true.
  • Otherwise, the argument is invalid.
  • An invalid argument is called a fallacy.

33
Example Invalid Arguments with True Conclusions
  • An argument may be invalid even though its
    conclusion is true.
  • If I eat my vegetables, Ill be big and strong.
  • Im big and strong.
  • Therefore, I ate my vegetables.
  • A true conclusion does not ensure that the
    argument is valid.

34
Example Valid Arguments with False Conclusions
  • An argument may be valid even though its
    conclusion is false.
  • If I say hmmm a lot, then people will think Im
    smart.
  • I say hmmm a lot.
  • Therefore, people think Im smart.
  • A false conclusion does not ensure that the
    argument is invalid.

35
The Form of an Argument
  • The validity of an argument can be determined by
    its form rather than by the truth of its
    conclusion.
  • Let the premises be P1, , Pn.
  • Let the conclusion be C.
  • The argument is valid if
  • P1 ? ? ? Pn ? C
  • is a tautology.

36
Example
  • I will ride my bike today.
  • If it is windy and I ride my bike, then I will
    get tired.
  • It is windy.
  • Therefore, I will get tired.

37
Example
  • p I will ride my bike today.
  • q It is windy.
  • r I will get tired.
  • Argument
  • p
  • q ? p ? r
  • q
  • ? r

38
Example
39
Modus Ponens
  • Modus ponens is the argument form
  • p ? q
  • p
  • ? q
  • This is also called a direct argument.

40
Examples of Modus Ponens
  • If it is raining, then I am carrying my umbrella.
    It is raining. Therefore, I am carrying my
    umbrella.
  • If pigs can fly, then I am carrying my umbrella.
    Pigs can fly. Therefore, I am carrying my
    umbrella.

41
Modus Tollens
  • Modus tollens is the argument form
  • p ? q
  • ?q
  • ? ?p
  • This is also called an indirect argument.

42
Examples of Modus Tollens
  • If it is raining, then I am carrying my umbrella.
    I am not carrying my umbrella. Therefore, it is
    not raining.
  • If pigs can fly, then I am carrying my umbrella.
    I am not carrying my umbrella. Therefore, pigs
    cannot fly.

43
Fallacies
  • A fallacy is an invalid argument form.
  • Two common fallacies
  • The fallacy of the converse.
  • The fallacy of the inverse.

44
The Fallacy of the Converse
  • The fallacy of the converse is the invalid
    argument form
  • p ? q
  • q
  • ? p
  • This is also called the fallacy of affirming the
    consequent.

45
Example
  • If it is raining, then I am carrying an umbrella.
    I am carrying an umbrella. Therefore, it is
    raining.

46
Fallacy of the Inverse
  • The fallacy of the inverse is the invalid
    argument form
  • p ? q
  • ?p
  • ? ?q
  • This is also called the fallacy of denying the
    antecedent.

47
Example
  • If pigs can fly, then I am carrying an umbrella.
    Pigs cannot fly. Therefore, I am not carrying an
    umbrella.

48
Section 1.4
  • Application Digital Logic Circuits

49
Logic Gates
  • Three basic logic gates
  • AND-gate
  • OR-gate
  • NOT-gate
  • Two other gates
  • NAND-gate (NOT-AND)
  • NOR-gate (NOT-OR)

50
AND-Gate
  • Output is 1 if both inputs are 1.
  • Output is 0 if either input is 0.

51
OR-Gate
  • Output is 1 if either input is 1.
  • Output is 0 if both inputs are 0.

52
NOT-Gate
  • Output is 1 if input is 0.
  • Output is 0 if input is 1.

53
NAND-Gate
  • Output is 1 if either input is 0.
  • Output is 0 if both inputs are 1.

54
NOR-Gate
  • Output is 1 if both inputs are 0.
  • Output is 0 if either input is 1.

55
Disjunctive Normal Form
  • A logical expression is in disjunctive normal
    form if
  • It is a disjunction of clauses.
  • Each clause is a conjunction of variables and
    their negations.
  • Each variable or its negation appears in each
    clause exactly once.

56
Examples Disjunctive Normal Form
  • p ? q ? (p ? q) ? (?p ? q) ? (?p ? ?q).
  • p ? q ? (p ? q) ? (?p ? ?q).
  • p q ? (p ? ?q) ? (?p ? q) ? (?p ? ?q).
  • p ? q ? ?p ? ?q.
Write a Comment
User Comments (0)
About PowerShow.com