discreet structures ch1-1
TRANSCRIPT
-
8/10/2019 Discreet Structures Ch1-1
1/48
EECS 1590-002
Discrete Structures
Chapter 1, Section 1.1Propositional Logic
These class notes are based on material from our
textbook, Discrete Mathematics and ItsApplications, by Kenneth H. Rosen. They areintended for classroom use only and are notasubstitute for reading the textbook.
-
8/10/2019 Discreet Structures Ch1-1
2/48
Proposition
Statement that is trueorfalse.
Examples:
The capital of New York is Albany.The moon is made of green cheese.
Go to town. (not a propositionwhy?)
What time is it? (not a propositionwhy?)
x+ 1 = 2 (not a propositionwhy?)
-
8/10/2019 Discreet Structures Ch1-1
3/48
Simple/Compound Propositions
A simple proposition has a value of T/F
A compound proposition is constructed from
one or more simple propositions using logical
operators
The truth value of a compound proposition
depends on the truth values of the constituentpropositions
-
8/10/2019 Discreet Structures Ch1-1
4/48
Negation (NOT)
NOTcan be represented by the ~ or
symbols
NOT is a logical operator:
p: I am going to town.
~p: I am not going to town.
-
8/10/2019 Discreet Structures Ch1-1
5/48
-
8/10/2019 Discreet Structures Ch1-1
6/48
Truth Tables
A truth table lists ALL possible values of a
(compound) proposition
one column for each propositional variable
one column for the compound proposition
2nrows for npropositional variables
-
8/10/2019 Discreet Structures Ch1-1
7/48
Conjunction (AND)
The conjunctionAND is a logical operator
p: I am going to town.
q: It is raining.
pq: I am going to town and it is raining.
Bothpand qmust be true for the conjunctionto be true.
-
8/10/2019 Discreet Structures Ch1-1
8/48
Truth table for ^ (AND)
p q p q
T T T
T F F
F T F
F F F
-
8/10/2019 Discreet Structures Ch1-1
9/48
Disjunction (OR)
Inclusive or - only one proposition needs to be
true for the disjunction to be true.
p: I am going to town.
q: It is raining.
pq: I am going to town or it is raining.
-
8/10/2019 Discreet Structures Ch1-1
10/48
Truth table for (OR)
p q p q
T T T
T F T
F T T
F F F
-
8/10/2019 Discreet Structures Ch1-1
11/48
Exclusive OR
Only one ofpand qare true (not both).
p: I am going to town.
q: It is raining.
pq: Either I am going to town or it is raining.
-
8/10/2019 Discreet Structures Ch1-1
12/48
Truth table for (Exclusive OR)
p q p q
T T F
T F T
F T T
F F F
-
8/10/2019 Discreet Structures Ch1-1
13/48
Conditional statements
A conditionalstatement is also called an
implicationor an if .. then statement.
It has the formp q
p: I am going to town.
q: It is raining.
pq: If I am going to town, then it is raining.
The implication is false only whenpis true and
qis false!
-
8/10/2019 Discreet Structures Ch1-1
14/48
Truth table for Conditional statements
p q p q
T T T
T F F
F T T
F F T
-
8/10/2019 Discreet Structures Ch1-1
15/48
Implication - Equivalent Forms
Ifp, then q
pimplies q
Ifp, q
qifp
qwheneverp
pis a sufficient condition for q
qis a necessary condition forp
ponly if q
-
8/10/2019 Discreet Structures Ch1-1
16/48
Converse of an Implication
Implication: pq
Converse: qp
Implication:
If I am going to town, it is raining.
Converse:
If it is raining, then I am going to town.
-
8/10/2019 Discreet Structures Ch1-1
17/48
Converse of an Implication
p q q p
T T T
T F T
F T F
F F T
(for pq, this would be F)
(for pq, this would be true)
-
8/10/2019 Discreet Structures Ch1-1
18/48
Contrapositive of an Implication
Implication: pq
Contrapositive: qp
Implication:If I am going to town, it is raining.
Contrapositive:
If it is not raining, then I am not going to town. The contrapositive has the same truth table as
the original implication.
-
8/10/2019 Discreet Structures Ch1-1
19/48
Inverse of an Implication
Implication: pq
Inverse: pq
Implication:If I am going to town, it is raining.
Inverse:
If I am not going to town, then it is not raining. The inverse of an implication has the same
truth table as the converse of that implication.
-
8/10/2019 Discreet Structures Ch1-1
20/48
Biconditional
if and only if, iff
pq
I am going to town if and only if it is raining. Bothpand qmust have the same truth value
for the assertion to be true.
-
8/10/2019 Discreet Structures Ch1-1
21/48
Truth Table for (Biconditional)
p q p q
T T T
T F F
F T F
F F T
-
8/10/2019 Discreet Structures Ch1-1
22/48
Truth Table Summary of Connectives
FF
T
Tp
FT
F
Tq p
qp
qp
qp
qp
q
TTFFFFTTTF
FFTTF
TTFTT
-
8/10/2019 Discreet Structures Ch1-1
23/48
Compound Propositions
To construct complex truth tables, addintermediate columns for smaller (compound)
propositions
One column for each propositional variable
One column for each compound proposition
For npropositional variables there will be 2n
rows
Example:
(pq)r
-
8/10/2019 Discreet Structures Ch1-1
24/48
Truth Tables for Compound Propositions
p q r p
q ~r (p
q) ~r
T T T T F F
T T F T T T
T F T T F F
T F F T T T
F T T T F F
F T F T T T
F F T F F T
F F F F T T
-
8/10/2019 Discreet Structures Ch1-1
25/48
Precedence of Logical Operators
Parentheses gets the highest precedence
Then:
Operator Precedence 1
2
3
4
5
-
8/10/2019 Discreet Structures Ch1-1
26/48
Precedence of Logical Operators
Examples:
p q r means (p q) r, not p (q r)
p
q
r means (p
q)
r
-
8/10/2019 Discreet Structures Ch1-1
27/48
Translating English Sentences
To remove natural language ambiguity
Helps in reasoning
Examples:
You can access the Internet from campusonly if you are a computer science major oryou are not a freshman.
You cannot ride the roller coaster if you areunder 4 feet tall unless you are older than 16years old.
-
8/10/2019 Discreet Structures Ch1-1
28/48
Logic and Bit Operations
Binary numbers use bits, or binary digits.
Each bit can have one of two values:
1 (which represents TRUE)
0 (which represents FALSE)
A variable whose value can be true or false is
called a Boolean variable. A Boolean variables
value can be represented using a single bit.
-
8/10/2019 Discreet Structures Ch1-1
29/48
Logic and Bit Operations
Computer bit operations are exactly the same as the logic
operations we have just studied. Here is the truth table
for the bit operations OR, AND, and XOR:
x y x y x y x y
0 0 0 0 0
0 1 1 0 1
1 0 1 0 1
1 1 1 1 0
-
8/10/2019 Discreet Structures Ch1-1
30/48
EECS 1590 -002
Discrete Structures
Chapter 1, Section 1.2
Propositional Logic applicationdemonstrated in class
-
8/10/2019 Discreet Structures Ch1-1
31/48
EECS 1590 -002
Discrete Structures
Chapter 1, Section 1.3
Propositional Equivalences
-
8/10/2019 Discreet Structures Ch1-1
32/48
Basic Terminology
A tautologyis a proposition which is always
true. Example:
pp
A contradictionis a proposition that is always
false. Example:
pp
-
8/10/2019 Discreet Structures Ch1-1
33/48
Basic Terminology
p p p p p p
T F T F
F T T F
-
8/10/2019 Discreet Structures Ch1-1
34/48
Basic Terminology
A contingencyis a proposition that is neither a
tautology nor a contradiction. Example:
pqr
-
8/10/2019 Discreet Structures Ch1-1
35/48
Logical Equivalences
Two propositionspand qare logically
equivalent if they have the same truth values in
all possible cases.
Two propositionspand qare logically
equivalent ifpqis a tautology.
Notation: pq or pq
-
8/10/2019 Discreet Structures Ch1-1
36/48
Determining Logical Equivalence
Consider the following two propositions:
(pq)
pq
Are they equivalent? Yes. (They are part of
DeMorgans Law, which we will see later.)
To show that (pq) and pqare
logically equivalent, you can use a truth table:
-
8/10/2019 Discreet Structures Ch1-1
37/48
Equivalence of (pq) and pq
p q p q (p q) p q p q
T T T F F F F
T F T F F T F
F T T F T F F
F F F T T T T
-
8/10/2019 Discreet Structures Ch1-1
38/48
Show that: p q pq
p q p p q p q
T T F T T
T F F F F
F T T T T
F F T T T
-
8/10/2019 Discreet Structures Ch1-1
39/48
Determining Logical Equivalence
This is not a very efficient method. Why?
To be more efficient, we develop a series of
equivalences, and use them to prove otherequivalences.
-
8/10/2019 Discreet Structures Ch1-1
40/48
Important Equivalences
IdentitypTp
pFp
Double Negation(p)p
DominationpTTpFF
Idempotentppp
p
p
p
-
8/10/2019 Discreet Structures Ch1-1
41/48
Important Equivalences
Commutativepqqp
pqqp
Associative(pq) rp(qr)(pq) rp(qr)
Distributivep(qr)(pq) (pr)
p
(q
r)
(p
q)
(p
r)De Morgans(pq)pq
(pq)pq
-
8/10/2019 Discreet Structures Ch1-1
42/48
Important Equivalences
Absorptionp(pq)p
p(pq)p
NegationppT
ppF
-
8/10/2019 Discreet Structures Ch1-1
43/48
Example
Show that (pq) andpqare logicallyequivalent:
(pq) (p q) Example 3
(p) q 2ndDeMorgan lawp q double negation law
Q.E.D
-
8/10/2019 Discreet Structures Ch1-1
44/48
Example
Show that
(p
(p
q)) andp
qarelogically equivalent:
(p(pq)) p(p q) 2ndDeMorgan
p[(p) q) 1stDeMorganp(p q) double negation
(pp) (p q) 2nddistributive
FALSE (p q) negation
(p q) FALSE commutativepq identity
Q.E.D
-
8/10/2019 Discreet Structures Ch1-1
45/48
Equivalences Involving Implications
pq pq
pq qp
pq pq
pq (pq)
(pq) pq
(pq) (pr) p(q r)
(pr) (qr) (pq) r
(pq) (pr) p(q r)
(pr) (qr) (pq) r
-
8/10/2019 Discreet Structures Ch1-1
46/48
Equivalences Involving Biconditionals
p q (p q) (q p)
p q p q
p q (p q) (p q)
(p q ) p q
-
8/10/2019 Discreet Structures Ch1-1
47/48
Example
Show that (pq)(pq) is a tautology.
(p q)(p q) (p q) (p q) Example 3
(
p
q)
(p
q) 1
st
DeMorgan law p (q (p q)) Associative law
p ((p q) q) Commutative law
(p p) (q q) Associative law
TRUE TRUE Example 1
TRUE Domination law
QED
-
8/10/2019 Discreet Structures Ch1-1
48/48
Steps to show logical equivalence
1. Use to simplify implication
pq pq
2. Use Distributiveand De Morgan's to simplify parenthesis
p(qr)(pq) (pr)
p(qr)(pq) (pr)
(pq)pq
(pq)pq
3. UseAssociativeto simplify parenthesis(pq) rp(qr)
(pq) rp(qr)