discrete math
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
1 of 120
Chapter 12
Logic
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
2 of 120
Outline
12.1 Introduction to Logic
12.2 Truth Tables
12.3 Implication
12.4 Logical Implication and Equivalence
12.5 Valid Argument
12.6 Predicate Calculus
12.7 Logic Circuits
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
3 of 120
12.1 Introduction to Logic
Statement and Truth Value
Compound Statement
Variables
Logical Connectives
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
4 of 120
Statement and Truth Value
A statement is a declarative sentence that is either true or false.
The truth value of a statement is either TRUE or FALSE.
Although statements are either true or false (and never both), we may not have enough information to know its truth value.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
5 of 120
George Washington was the first president of the United States.
This is a true statement.
The New York Knicks won the NBA basketball championship in 1989.
This is a false statement.
The number of atoms in the universe is 1075.
This statement is either true or false but we don’t know which it is.
Example Statement
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
6 of 120
Compound Statement
A simple statement is a statement that is formed using the words “and,” “or,” “not,” or “if, then.”
A compound statement is formed by combining statements using the words “and,” “or,” “not,” or “if, then.”
A simple statement is a statement that is not a compound statement.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
7 of 120
Variables
To develop the rules of logic and logical arguments, we need to deal with any logical statement, rather than specific examples. We use the variables p, q, r, and so on to represent simple statements.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
8 of 120
The number 6 is even and the number 5 is odd.
This compound statement is of the form p and q where p = “The number 6 is even” and q = “The number 5 is odd.”
Tom Jones does a term paper or takes the final exam.
This compound statement is of the form p or q where p = “Tom Jones does a term paper” and q = “Tom Jones takes the final exam.”
Example Compound Statement
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
9 of 120
Logical Connectives
When writing compound statements in terms of its component parts, the following logic symbols are used:
| Word | Symbol |
| and | |
| or | |
| not | ~ |
| if, then |
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
10 of 120
Define p and q and determine the logical connective to rewrite the following statement:
Fred and Cindy like each other.
Let p = “Fred likes Cindy.”
Let q = “Cindy likes Fred.”
Example Compound Statement with
The symbolic statement then becomes p q.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
11 of 120
Define p and q and determine the logical connective to rewrite the following statement:
The train stops in New York or Washington.
Let p = “The train stops in New York.”
Let q = “The train stops in Washington.”
Example Compound Statement with
The symbolic statement then becomes p q.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
12 of 120
Define p and q and determine the logical connective to rewrite the following statement:
Fred likes Cindy but Cindy does not like Fred.
Let p = “Fred likes Cindy.”
Let q = “Cindy likes Fred.”
Example Compound Statement with
The symbolic statement then becomes p ~q.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
13 of 120
Define p and q and determine the logical connective to rewrite the following statement:
If the train stops in New York, it does not stop in Washington.
Let p = “The train stops in New York.”
Let q = “The train stops in Washington.”
Example Compound Statement with
The symbolic statement then becomes p ~ q.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
14 of 120
A logical statement (proposition) is a declarative sentence that is either TRUE or FALSE.
Summary Section 12.1
Logical statements frequently have
Connectives such as and , or , not ~, and
implies (if, then ) .
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
15 of 120
12.2 Truth Tables
Statement Form
Propositional Calculus
Truth Table
Tautology and Contradiction
Exclusive Or
Tree
Logic and Computer Languages
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
16 of 120
Statement Form
A statement form is an expression formed from simple statements and connectives according to the following rules:
A simple statement is a statement form.
If p is a statement form, ~p is a statement form.
If p and q are statement forms, then so are p q,
p q, and p q.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
17 of 120
Example Statement Form
a) ( p ~ r ) r is a statement form.
b) ~ ( p ( q ~ r )) is a statement form.
If p, q, and r are simple statements, then
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
18 of 120
Propositional Calculus
The propositional calculus is the manipulation, verification, and simplification of logical statement forms. Truth tables and trees diagrams will be used to determine the truth values of statement forms.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
19 of 120
Truth Table
A truth table is a table that includes:
A column for each simple statement;
A column for the compound statement;
A row for each possible combination (arrangement) of the truth values for the simple statements;
The column for the statement form has its truth value depending on the truth values of the simple statements in the corresponding row.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
20 of 120
Survey the crowd
A statement form that has truth value TRUE regardless of the truth values of the individual statement variables it contains is called a
_______.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
21 of 120
Survey the crowd
A statement form that has truth value TRUE regardless of the truth values of the individual statement variables it contains is called a tautology.
A statement form that has truth value FALSE regardless of the truth values of the individual statement variables it contains is called a __________.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
22 of 120
Tautology and Contradiction
A statement form that has truth value TRUE regardless of the truth values of the individual statement variables it contains is called a tautology.
A statement form that has truth value FALSE regardless of the truth values of the individual statement variables it contains is called a contradiction.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
23 of 120
Example Truth Table of Negation ( ~ )
| p | ~ p |
| T | F |
| F | T |
Note: T means TRUE and F means FALSE.
The statement form ~ p has the opposite truth value as the statement form p.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
24 of 120
Example Truth Table of Conjunction ( )
| p | q | p q |
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
The statement form p q is TRUE if and only if both statement forms p and q are TRUE.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
25 of 120
Example Truth Table of Disjunction ( )
| p | q | p q |
| T | T | T |
| T | F | T |
| F | T | T |
| F | F | F |
The statement form p q is FALSE if and only if both statement forms p and q are FALSE.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
26 of 120
Truth Table for More Than One Connective
If a statement form contains more than one connective, the truth table often includes the truth values of the intermediate steps. See the following example.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
27 of 120
Example More Than One Connective
| T | T |
| T | F |
| F | T |
| F | F |
| 1 | 2 |
| T |
| T |
| T |
| F |
| 3 |
| T |
| F |
| F |
| F |
| 4 |
| F |
| T |
| T |
| T |
| 5 |
| F |
| T |
| T |
| F |
| 6 |
Find the truth table for ( p q ) ~ ( p q ).
p
q
( p q)
~
( p q )
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
28 of 120
Survey the crowd
The statement of the previous example
( p q ) ~ ( p q )
can be read as “p or q but not both p and q.”
This is what familiar combination?
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
29 of 120
Exclusive Or
The statement of the previous example
( p q ) ~ ( p q )
can be read as “p or q but not both p and q.”
This is what familiar combination?
Exclusive OR
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
30 of 120
Survey the crowd
The statement of the previous example
( p q ) ~ ( p q )
can be read as “p or q but not both p and q.”
This is what familiar combination?
Exclusive OR
And what single Boolean symbol is used to represent the XOR?
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
31 of 120
Exclusive Or
The statement of the previous example
( p q ) ~ ( p q )
can be read as “p or q but not both p and q.”
This is what familiar combination?
Exclusive OR
And what single Boolean symbol is used to represent the XOR?
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
32 of 120
Exclusive Or
The statement of the previous example
( p q ) ~ ( p q )
can be read as “p or q but not both p and q.” This is the exclusive or and is denoted by the symbol .
p
q
p q
T
T
F
T
F
T
F
T
T
F
F
F
Å
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
33 of 120
Example More Than Two Variables
Construct the truth table for
( p q ) (( p r ) ~ q ).
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
34 of 120
Example More Than Two Variables
| p | q | r | ( p q ) (( p r ) ~ q ) |
| T |
| T |
| T |
| T |
| F |
| F |
| F |
| F |
| 1 |
| T |
| T |
| F |
| F |
| T |
| T |
| F |
| F |
| 2 |
| T |
| F |
| T |
| F |
| T |
| F |
| T |
| F |
| 3 |
| F |
| F |
| T |
| T |
| T |
| T |
| F |
| F |
| 4 |
| T |
| T |
| T |
| T |
| T |
| F |
| T |
| F |
| 5 |
| F |
| F |
| T |
| T |
| F |
| F |
| T |
| T |
| 6 |
| F |
| F |
| T |
| T |
| F |
| F |
| T |
| F |
| 7 |
| F |
| F |
| T |
| T |
| F |
| F |
| F |
| F |
| 8 |
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
35 of 120
Tree
Another method of describing a statement form is by using a tree. The statement form is written at the top of the tree. The statement is then separated along the branches into its operands until only simple statements are at the end of the branches.
r
p
~ q
q
( p ~ q )
For example:
( p ~ q ) r
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
36 of 120
Example Tree
Use a tree to find the truth value of
( p ~ q ) r
if p is true and q and r are both false.
The statement is TRUE.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
37 of 120
Example Tree
Use a tree to find the truth value of
( p ~ q ) r
if p is true and q and r are both false.
The statement is TRUE.
T
T
T
F
F
T
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
38 of 120
Logic and Computer Languages
Many computer languages and graphing calculators use logical connectives in programs that depend on logical decision making.
For example in a TI-83/84 Plus:
Calculator Function
Logic symbol
AND
OR
NOT
~
XOR
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
39 of 120
Example Excel
Use an Excel spreadsheet to find the truth value of
( p ~ q ) r
if p is TRUE and q and r are both FALSE.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
40 of 120
Summary Section 12.2 - Part 1
A statement without any connectives is called a simple statement. A statement form is a simple statement or simple statements with connectives. The truth value of a statement form depends only on the truth values of the simple statements it contains.
The exclusive or, denoted by p q, is TRUE only if one of p or q is TRUE but not both. Otherwise, it is FALSE.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
41 of 120
Summary Section 12.2 - Part 2
A truth table or tree can be used to determine the truth value of a statement form.
The truth table for the connectives ~, , and is
p
q
~ p
p q
p q
p q
T
T
F
T
T
F
T
F
F
F
T
T
F
T
T
F
T
T
F
F
T
F
F
F
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
42 of 120
Summary Section 12.2 - Part 3
A statement that always has a truth value TRUE is called a tautology. A statement that always has a truth value FALSE is called a contradiction.
The logical connectives used in computer languages and calculators AND, OR, NOT and XOR correspond to the symbols , , ~ and , respectively.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
43 of 120
12.3 Implication
Conditional Connective
English Equivalents
Converse
Biconditional Connective
Order of Precedence
Implication and Computer Languages
The logic symbol is called the conditional connective.
The statement p q is FALSE only if the hypothesis p is TRUE and the conclusion q is FALSE.
Otherwise, it is TRUE.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
44 of 120
Conditional Connective
| p | q | p q |
| T | T | T |
| T | F | F |
| F | T | T |
| F | F | T |
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
45 of 120
English Equivalents
There are several ways to read p q in English.
p implies q.
If p, then q.
p only if q.
q, if p.
p is sufficient for q.
q is a necessary condition for p.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
46 of 120
Survey the crowd
There are several ways to read p q in English.
In this implication, the p portion is called the
___________?
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
47 of 120
Survey the crowd
There are several ways to read p q in English.
In this implication, the p portion is called the
antecedent.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
48 of 120
Survey the crowd
There are several ways to read p q in English.
In this implication, the p portion is called the
antecedent.
And the q portion is called the
________?
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
49 of 120
Survey the crowd
There are several ways to read p q in English.
In this implication, the p portion is called the
antecedent.
And the q portion is called the
consequent.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
50 of 120
Example English Equivalences
Determine the hypothesis and the conclusion for each of the following.
Bill goes to the party only if Greta goes to the party.
Sue goes to the party if Craig goes to the party.
For 6 to be even, it is sufficient that its square, 36, be even.
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
51 of 120
Example English Equivalences (a)
Bill goes to the party only if Greta goes to the party.
The statement is of the form p only if q.
The hypothesis p is “Bill goes to the party.”
The conclusion q is “Greta goes to the party.”
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
52 of 120
Example English Equivalences (b)
Sue goes to the party if Craig goes to the party.
The statement is of the form q, if p.
The hypothesis p is “Craig goes to the party.”
The conclusion q is “Sue goes to the party.”
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
53 of 120
Example English Equivalences (c)
For 6 to be even, it is sufficient that its square, 36, be even.
The statement is of the form p is sufficient for q.
The hypothesis p is “The square of the integer 6 is even.”
The conclusion q is “The integer 6 is even.”
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
54 of 120
Converse
The implication q p is the converse of the statement p q.
For example, the converse of the statement
“If x = -6, then x2 = 36”
is
“If x2 = 36, then x = -6.”
Finite Mathematics & Its Applications, 11/e by Goldstein/Schneider/Siegel Copyright © 2014 Pearson Education, Inc.
55 of 120
Example Converse
Construct the truth table for ( p q ) ( q p ).
p
q
( p q )
( q p )
T
T
T
T
T
T
F
F
F
T
F
T
T
F
F
F
F
T
T
T
1
2
3
5
4