Spring 2003 CMSC 203 - Discrete Structures 1
Let’s get started with...
Let’s get started with...
Logic
Logic!
!
Spring 2003 CMSC 203 - Discrete Structures 2
Logic
Logic
• Crucial for mathematical reasoning
Crucial for mathematical reasoning
• Important for program design
Important for program design
• Used for designing electronic circuitry
Used for designing electronic circuitry
• (Propositional )Logic is a system based on
(Propositional )Logic is a system based on
propositions
propositions.
.
• A proposition is a (declarative) statement that is
A proposition is a (declarative) statement that is
either
either true
true or
or false
false (not both).
(not both).
• We say that the
We say that the truth value
truth value of a proposition is
of a proposition is
either true (
either true (T
T) or false (
) or false (F
F).
).
• Corresponds to
Corresponds to 1
1 and
and 0
0 in digital circuits
in digital circuits
Spring 2003 CMSC 203 - Discrete Structures 3
The Statement/Proposition Game
The Statement/Proposition Game
“
“Elephants are bigger than mice.”
Elephants are bigger than mice.”
Is this a statement?
Is this a statement? yes
yes
Is this a proposition?
Is this a proposition? yes
yes
What is the truth value
What is the truth value
of the proposition?
of the proposition? true
true
Spring 2003 CMSC 203 - Discrete Structures 4
The Statement/Proposition Game
The Statement/Proposition Game
“
“520 < 111”
520 < 111”
Is this a statement?
Is this a statement? yes
yes
Is this a proposition?
Is this a proposition? yes
yes
What is the truth value
What is the truth value
of the proposition?
of the proposition? false
false
Spring 2003 CMSC 203 - Discrete Structures 5
The Statement/Proposition Game
The Statement/Proposition Game
“
“y > 5”
y > 5”
Is this a statement?
Is this a statement? yes
yes
Is this a proposition?
Is this a proposition? no
no
Its truth value depends on the value of y,
Its truth value depends on the value of y,
but this value is not specified.
but this value is not specified.
We call this type of statement a
We call this type of statement a
propositional function
propositional function or
or open sentence
open sentence.
.
Spring 2003 CMSC 203 - Discrete Structures 6
The Statement/Proposition Game
The Statement/Proposition Game
“
“Today is January 27 and 99 < 5.”
Today is January 27 and 99 < 5.”
Is this a statement?
Is this a statement? yes
yes
Is this a proposition?
Is this a proposition? yes
yes
What is the truth value
What is the truth value
of the proposition?
of the proposition? false
false
Spring 2003 CMSC 203 - Discrete Structures 7
The Statement/Proposition Game
The Statement/Proposition Game
“
“Please do not fall asleep.”
Please do not fall asleep.”
Is this a statement?
Is this a statement? no
no
Is this a proposition?
Is this a proposition? no
no
Only statements can be propositions.
Only statements can be propositions.
It’s a request.
It’s a request.
Spring 2003 CMSC 203 - Discrete Structures 8
The Statement/Proposition Game
The Statement/Proposition Game
“
“If the moon is made of cheese,
If the moon is made of cheese,
then I will be rich.”
then I will be rich.”
Is this a statement?
Is this a statement? yes
yes
Is this a proposition?
Is this a proposition? yes
yes
What is the truth value
What is the truth value
of the proposition?
of the proposition? probably true
probably true
Spring 2003 CMSC 203 - Discrete Structures 9
The Statement/Proposition Game
The Statement/Proposition Game
“
“x < y if and only if y > x.”
x < y if and only if y > x.”
Is this a statement?
Is this a statement? yes
yes
Is this a proposition?
Is this a proposition? yes
yes
What is the truth value
What is the truth value
of the proposition?
of the proposition? true
true
…
… because its truth value
because its truth value
does not depend on
does not depend on
specific values of x and y.
specific values of x and y.
Spring 2003 CMSC 203 - Discrete Structures 10
Combining Propositions
Combining Propositions
As we have seen in the previous examples,
As we have seen in the previous examples,
one or more propositions can be combined
one or more propositions can be combined
to form a single
to form a single compound proposition
compound proposition.
.
We formalize this by denoting propositions
We formalize this by denoting propositions
with letters such as
with letters such as p, q, r, s,
p, q, r, s, and
and
introducing several
introducing several logical operators or
logical operators or
logical connectives
logical connectives.
.
Spring 2003 CMSC 203 - Discrete Structures 11
Logical Operators (Connectives)
Logical Operators (Connectives)
We will examine the following logical operators:
We will examine the following logical operators:
• Negation
Negation (NOT,
(NOT, 
)
)
• Conjunction
Conjunction (AND,
(AND, 
)
)
• Disjunction
Disjunction (OR,
(OR, 
)
)
• Exclusive-or
Exclusive-or (XOR,
(XOR, 
 )
)
• Implication
Implication (if – then,
(if – then, 
 )
)
• Biconditional
Biconditional (if and only if,
(if and only if, 
 )
)
Truth tables can be used to show how these
Truth tables can be used to show how these
operators can combine propositions to compound
operators can combine propositions to compound
propositions.
propositions.
Spring 2003 CMSC 203 - Discrete Structures 12
Negation (NOT)
Negation (NOT)
Unary Operator, Symbol:
Unary Operator, Symbol: 

P
P 
 P
P
true (T)
true (T) false (F)
false (F)
false (F)
false (F) true (T)
true (T)
Spring 2003 CMSC 203 - Discrete Structures 13
Conjunction (AND)
Conjunction (AND)
Binary Operator, Symbol:
Binary Operator, Symbol: 

P
P Q
Q P
P
 Q
Q
T
T T
T T
T
T
T F
F F
F
F
F T
T F
F
F
F F
F F
F
Spring 2003 CMSC 203 - Discrete Structures 14
Disjunction (OR)
Disjunction (OR)
Binary Operator, Symbol:
Binary Operator, Symbol: 

P
P Q
Q P
P 
 Q
Q
T
T T
T T
T
T
T F
F T
T
F
F T
T T
T
F
F F
F F
F
Spring 2003 CMSC 203 - Discrete Structures 15
Exclusive Or (XOR)
Exclusive Or (XOR)
Binary Operator, Symbol:
Binary Operator, Symbol: 

P
P Q
Q P
P
Q
Q
T
T T
T F
F
T
T F
F T
T
F
F T
T T
T
F
F F
F F
F
Spring 2003 CMSC 203 - Discrete Structures 16
Implication (if - then)
Implication (if - then)
Binary Operator, Symbol:
Binary Operator, Symbol: 

P
P Q
Q P
P
Q
Q
T
T T
T T
T
T
T F
F F
F
F
F T
T T
T
F
F F
F T
T
Spring 2003 CMSC 203 - Discrete Structures 17
Biconditional (if and only if)
Biconditional (if and only if)
Binary Operator, Symbol:
Binary Operator, Symbol: 

P
P Q
Q P
P
Q
Q
T
T T
T T
T
T
T F
F F
F
F
F T
T F
F
F
F F
F T
T
Spring 2003 CMSC 203 - Discrete Structures 18
Statements and Operators
Statements and Operators
Statements and operators can be combined in any
Statements and operators can be combined in any
way to form new statements.
way to form new statements.
P
P Q
Q 
P
P 
Q
Q (
(
P)
P)
(
(
Q)
Q)
T
T T
T F
F F
F F
F
T
T F
F F
F T
T T
T
F
F T
T T
T F
F T
T
F
F F
F T
T T
T T
T
Spring 2003 CMSC 203 - Discrete Structures 19
Statements and Operations
Statements and Operations
Statements and operators can be combined in any
Statements and operators can be combined in any
way to form new statements.
way to form new statements.
P
P Q
Q P
P
Q
Q 
(P
(P
Q)
Q) (
(
P)
P)
(
(
Q)
Q)
T
T T
T T
T F
F F
F
T
T F
F F
F T
T T
T
F
F T
T F
F T
T T
T
F
F F
F F
F T
T T
T
Spring 2003 CMSC 203 - Discrete Structures 20
Exercises
Exercises
• To take discrete mathematics, you must have
To take discrete mathematics, you must have
taken calculus or a course in computer science.
taken calculus or a course in computer science.
• When you buy a new car from Acme Motor
When you buy a new car from Acme Motor
Company, you get $2000 back in cash or a 2%
Company, you get $2000 back in cash or a 2%
car loan.
car loan.
• School is closed if more than 2 feet of snow
School is closed if more than 2 feet of snow
falls or if the wind chill is below -100.
falls or if the wind chill is below -100.
Spring 2003 CMSC 203 - Discrete Structures 21
Exercises
Exercises
– P: take discrete mathematics
P: take discrete mathematics
– Q: take calculus
Q: take calculus
– R: take a course in computer science
R: take a course in computer science
• P
P 
 Q
Q 
 R
R
• Problem with proposition R
Problem with proposition R
– What if I want to represent “take CMSC201”?
What if I want to represent “take CMSC201”?
• To take discrete mathematics, you must have
To take discrete mathematics, you must have
taken calculus or a course in computer science.
taken calculus or a course in computer science.
Spring 2003 CMSC 203 - Discrete Structures 22
Exercises
Exercises
– P: buy a car from Acme Motor Company
P: buy a car from Acme Motor Company
– Q: get $2000 cash back
Q: get $2000 cash back
– R: get a 2% car loan
R: get a 2% car loan
• P
P 
 Q
Q 
 R
R
• Why use XOR here? – example of
Why use XOR here? – example of ambiguity of
ambiguity of
natural languages
natural languages
• When you buy a new car from Acme Motor
When you buy a new car from Acme Motor
Company, you get $2000 back in cash or a 2%
Company, you get $2000 back in cash or a 2%
car loan.
car loan.
Spring 2003 CMSC 203 - Discrete Structures 23
Exercises
Exercises
– P: School is closed
P: School is closed
– Q: 2 feet of snow falls
Q: 2 feet of snow falls
– R: wind chill is below -100
R: wind chill is below -100
• Q
Q 
 R
R 
 P
P
• Precedence among operators:
Precedence among operators:

,
, 
,
, 
,
, 
,
, 

• School is closed if more than 2 feet of snow
School is closed if more than 2 feet of snow
falls or if the wind chill is below -100.
falls or if the wind chill is below -100.
Spring 2003 CMSC 203 - Discrete Structures 24
Equivalent Statements
Equivalent Statements
P
P Q
Q 
(P
(P
Q)
Q) (
(
P)
P)
(
(
Q)
Q) 
(P
(P
Q)
Q)
(
(
P)
P)
(
(
Q)
Q)
T
T T
T F
F F
F T
T
T
T F
F T
T T
T T
T
F
F T
T T
T T
T T
T
F
F F
F T
T T
T T
T
The statements
The statements 
(P
(P
Q) and (
Q) and (
P)
P) 
 (
(
Q) are
Q) are logically equivalent
logically equivalent, since they have the
, since they have the
same truth table, or put it in another way,
same truth table, or put it in another way, 
(P
(P
Q)
Q) 
(
(
P)
P) 
 (
(
Q) is always true.
Q) is always true.
Spring 2003 CMSC 203 - Discrete Structures 25
Tautologies and Contradictions
Tautologies and Contradictions
A tautology is a statement that is always true.
A tautology is a statement that is always true.
Examples:
Examples:
– R
R
(
(
R)
R)
 
(P
(P
Q)
Q) 
 (
(
P)
P)
(
(
 Q)
Q)
A contradiction is a statement that is always false.
A contradiction is a statement that is always false.
Examples:
Examples:
– R
R
(
(
R)
R)
 
(
(
(P
(P 
 Q)
Q) 
 (
(
P)
P) 
 (
(
Q))
Q))
The negation of any tautology is a contradiction, and
The negation of any tautology is a contradiction, and
the negation of any contradiction is a tautology.
the negation of any contradiction is a tautology.
Spring 2003 CMSC 203 - Discrete Structures 26
Equivalence
Equivalence
Definition: two propositional statements
Definition: two propositional statements
S1 and S2 are said to be (logically)
S1 and S2 are said to be (logically)
equivalent, denoted S1
equivalent, denoted S1 
 S2 if
S2 if
– They have the same truth table, or
They have the same truth table, or
– S1
S1 
 S2 is a tautology
S2 is a tautology
Equivalence can be established by
Equivalence can be established by
– Constructing truth tables
Constructing truth tables
– Using equivalence laws (Table 5 in Section 1.2)
Using equivalence laws (Table 5 in Section 1.2)
Spring 2003 CMSC 203 - Discrete Structures 27
Equivalence
Equivalence
Equivalence laws
Equivalence laws
– Identity laws,
Identity laws, P
P 
 T
T 
 P,
P,
– Domination laws,
Domination laws, P
P 
 F
F 
 F,
F,
– Idempotent laws,
Idempotent laws, P
P 
 P
P 
 P,
P,
– Double negation law,
Double negation law, 
 (
(
 P
P)
) 
 P
P
– Commutative laws,
Commutative laws, P
P 
 Q
Q 
 Q
Q 
 P,
P,
– Associative laws,
Associative laws, P
P 
 (Q
(Q 
 R)
R)
 (
(P
P 
 Q)
Q) 
 R
R,
,
– Distributive laws,
Distributive laws, P
P 
 (Q
(Q 
 R)
R)
 (
(P
P 
 Q)
Q) 
 (P
(P 
 R)
R),
,
– De Morgan’s laws,
De Morgan’s laws, 
 (P
(P
Q)
Q) 
 (
(
 P)
P) 
 (
(
 Q)
Q)
– Law with implication
Law with implication P
P 
 Q
Q 
 
 P
P 
 Q
Q
Spring 2003 CMSC 203 - Discrete Structures 28
Exercises
Exercises
• Show that
Show that P
P 
 Q
Q 
 
 P
P 
 Q
Q: by truth table
: by truth table
• Show that
Show that (P
(P 
 Q)
Q) 
 (P
(P 
 R)
R) 
 P
P 
 (Q
(Q 
 R)
R): by
: by
equivalence laws (q20, p27):
equivalence laws (q20, p27):
– Law with implication on both sides
Law with implication on both sides
– Distribution law on LHS
Distribution law on LHS
Spring 2003 CMSC 203 - Discrete Structures 29
Summary, Sections 1.1, 1.2
Summary, Sections 1.1, 1.2
•Proposition
Proposition
– Statement, Truth value,
Statement, Truth value,
– Proposition, Propositional symbol, Open proposition
Proposition, Propositional symbol, Open proposition
•Operators
Operators
– Define by truth tables
Define by truth tables
– Composite propositions
Composite propositions
– Tautology and contradiction
Tautology and contradiction
•Equivalence of propositional statements
Equivalence of propositional statements
– Definition
Definition
– Proving equivalence (by truth table or equivalence
Proving equivalence (by truth table or equivalence
laws)
laws)
Spring 2003 CMSC 203 - Discrete Structures 30
Propositional Functions & Predicates
Propositional Functions & Predicates
Propositional function (open sentence):
Propositional function (open sentence):
statement involving one or more variables,
statement involving one or more variables,
e.g.: x-3 > 5.
e.g.: x-3 > 5.
Let us call this propositional function P(x), where
Let us call this propositional function P(x), where
P is the
P is the predicate
predicate and x is the
and x is the variable
variable.
.
What is the truth value of P(2) ?
What is the truth value of P(2) ? false
false
What is the truth value of P(8) ?
What is the truth value of P(8) ?
What is the truth value of P(9) ?
What is the truth value of P(9) ?
false
false
true
true
When a variable is given a value, it is said to be
When a variable is given a value, it is said to be
instantiated
instantiated
Truth value depends on value of variable
Truth value depends on value of variable
Spring 2003 CMSC 203 - Discrete Structures 31
Propositional Functions
Propositional Functions
Let us consider the propositional function
Let us consider the propositional function
Q(x, y, z) defined as:
Q(x, y, z) defined as:
x + y = z.
x + y = z.
Here, Q is the
Here, Q is the predicate
predicate and x, y, and z are the
and x, y, and z are the
variables
variables.
.
What is the truth value of Q(2, 3, 5) ?
What is the truth value of Q(2, 3, 5) ? true
true
What is the truth value of Q(0, 1, 2) ?
What is the truth value of Q(0, 1, 2) ?
What is the truth value of Q(9, -9, 0) ?
What is the truth value of Q(9, -9, 0) ?
false
false
true
true
A propositional function (predicate) becomes a
A propositional function (predicate) becomes a
proposition when
proposition when all
all its variables are
its variables are instantiated
instantiated.
.
Spring 2003 CMSC 203 - Discrete Structures 32
Propositional Functions
Propositional Functions
Other examples of propositional functions
Other examples of propositional functions
Person(x),
Person(x), which is true if x is a person
which is true if x is a person
Person(Socrates) = T
Person(Socrates) = T
CSCourse(x),
CSCourse(x), which is true if x is a
which is true if x is a
computer science course
computer science course
CSCourse(CMSC201) = T
CSCourse(CMSC201) = T
Person(dolly-the-sheep) = F
Person(dolly-the-sheep) = F
CSCourse(MATH155) = F
CSCourse(MATH155) = F
How do we say
How do we say
All humans are mortal
All humans are mortal
One CS course
One CS course
Spring 2003 CMSC 203 - Discrete Structures 33
Universal Quantification
Universal Quantification
Let P(x) be a predicate (propositional function).
Let P(x) be a predicate (propositional function).
Universally quantified sentence
Universally quantified sentence:
:
For all x in the
For all x in the universe of discourse
universe of discourse P(x) is true.
P(x) is true.
Using the universal quantifier
Using the universal quantifier 
:
:

x P(x)
x P(x) “for all x P(x)” or “for every x P(x)”
“for all x P(x)” or “for every x P(x)”
(Note:
(Note: 
x P(x) is either true or false, so it is a
x P(x) is either true or false, so it is a
proposition, not a propositional function.)
proposition, not a propositional function.)
Spring 2003 CMSC 203 - Discrete Structures 34
Universal Quantification
Universal Quantification
Example: Let the universe of discourse be all people
Example: Let the universe of discourse be all people
S(x): x is a UMBC student.
S(x): x is a UMBC student.
G(x): x is a genius.
G(x): x is a genius.
What does
What does 
x (S(x)
x (S(x) 
 G(x))
G(x)) mean ?
mean ?
“
“If x is a UMBC student, then x is a genius.” or
If x is a UMBC student, then x is a genius.” or
“
“All UMBC students are geniuses.”
All UMBC students are geniuses.”
If the universe of discourse is all UMBC students,
If the universe of discourse is all UMBC students,
then the same statement can be written as
then the same statement can be written as

x G(x)
x G(x)
Spring 2003 CMSC 203 - Discrete Structures 35
Existential Quantification
Existential Quantification
Existentially quantified sentence
Existentially quantified sentence:
:
There exists an x in the universe of discourse
There exists an x in the universe of discourse
for which P(x) is true.
for which P(x) is true.
Using the existential quantifier
Using the existential quantifier 
:
:

x P(x)
x P(x) “There is an x such that P(x).”
“There is an x such that P(x).”
“
“There is at least one x such that P(x).”
There is at least one x such that P(x).”
(Note:
(Note: 
x P(x) is either true or false, so it is a
x P(x) is either true or false, so it is a
proposition, but no propositional function.)
proposition, but no propositional function.)
Spring 2003 CMSC 203 - Discrete Structures 36
Existential Quantification
Existential Quantification
Example:
Example:
P(x): x is a UMBC professor.
P(x): x is a UMBC professor.
G(x): x is a genius.
G(x): x is a genius.
What does
What does 
x (P(x)
x (P(x) 
 G(x))
G(x)) mean ?
mean ?
“
“There is an x such that x is a UMBC professor
There is an x such that x is a UMBC professor
and x is a genius.”
and x is a genius.”
or
or
“
“At least one UMBC professor is a genius.”
At least one UMBC professor is a genius.”
Spring 2003 CMSC 203 - Discrete Structures 37
Quantification
Quantification
Another example:
Another example:
Let the universe of discourse be the real numbers.
Let the universe of discourse be the real numbers.
What does
What does 
x
x
y (x + y = 320)
y (x + y = 320) mean ?
mean ?
“
“For every x there exists a y so that x + y = 320.”
For every x there exists a y so that x + y = 320.”
Is it true?
Is it true?
Is it true for the natural numbers?
Is it true for the natural numbers?
yes
yes
no
no
Spring 2003 CMSC 203 - Discrete Structures 38
Disproof by Counterexample
Disproof by Counterexample
A counterexample to
A counterexample to 
x P(x) is an object c so
x P(x) is an object c so
that P(c) is false.
that P(c) is false.
Statements such as
Statements such as 
x (P(x)
x (P(x) 
 Q(x)) can be
Q(x)) can be
disproved by simply providing a counterexample.
disproved by simply providing a counterexample.
Statement: “All birds can fly.”
Statement: “All birds can fly.”
Disproved by counterexample: Penguin.
Disproved by counterexample: Penguin.
Spring 2003 CMSC 203 - Discrete Structures 39
Negation
Negation

(
(
x P(x)) is logically equivalent to
x P(x)) is logically equivalent to 
x (
x (
P(x)).
P(x)).

(
(
x P(x)) is logically equivalent to
x P(x)) is logically equivalent to 
x (
x (
P(x)).
P(x)).
See Table 2 in Section 1.3.
See Table 2 in Section 1.3.
This is de Morgan’s law for quantifiers
This is de Morgan’s law for quantifiers
Spring 2003 CMSC 203 - Discrete Structures 40
Negation
Negation
Examples
Examples
Not all roses are red
Not all roses are red


x (Rose(x)
x (Rose(x) 
 Red(x)
Red(x))
)

x (Rose(x)
x (Rose(x) 
 
Red(x)
Red(x))
)
Nobody is perfect
Nobody is perfect


x (Person(x)
x (Person(x) 
 Perfect(x)
Perfect(x))
)

x (Person(x)
x (Person(x) 
 
Perfect(x)
Perfect(x))
)
Spring 2003 CMSC 203 - Discrete Structures 41
Nested Quantifier
Nested Quantifier
A predicate can have more than one variables.
A predicate can have more than one variables.
– S(x, y, z): z is the sum of x and y
S(x, y, z): z is the sum of x and y
– F(x, y): x and y are friends
F(x, y): x and y are friends
We can quantify individual variables in different
We can quantify individual variables in different
ways
ways
 
x, y, z (S(x, y, z)
x, y, z (S(x, y, z) 
 (x <= z
(x <= z 
 y <= z))
y <= z))
 
x
x 
y
y 
z (F(x, y)
z (F(x, y) 
 F(x, z)
F(x, z) 
 (y != z)
(y != z) 
 
F(y, z)
F(y, z)
Spring 2003 CMSC 203 - Discrete Structures 42
Nested Quantifier
Nested Quantifier
Exercise: translate the following English
Exercise: translate the following English
sentence into logical expression
sentence into logical expression
“
“There is a rational number in between every
There is a rational number in between every
pair of distinct rational numbers”
pair of distinct rational numbers”
Use predicate
Use predicate Q(x)
Q(x), which is true when x
, which is true when x
is a rational number
is a rational number

x,y (
x,y (Q
Q(x)
(x) 
 Q
Q (y)
(y) 
 (x < y)
(x < y) 


u (Q(u)
u (Q(u) 
 (x < u)
(x < u) 
 (u < y)))
(u < y)))
Spring 2003 CMSC 203 - Discrete Structures 43
Summary, Sections 1.3, 1.4
Summary, Sections 1.3, 1.4
• Propositional functions (predicates)
Propositional functions (predicates)
• Universal and existential quantifiers, and
Universal and existential quantifiers, and
the duality of the two
the duality of the two
• When predicates become propositions
When predicates become propositions
– All of its variables are instantiated
All of its variables are instantiated
– All of its variables are quantified
All of its variables are quantified
• Nested quantifiers
Nested quantifiers
– Quantifiers with negation
Quantifiers with negation
• Logical expressions formed by predicates,
Logical expressions formed by predicates,
operators, and quantifiers
operators, and quantifiers
Spring 2003 CMSC 203 - Discrete Structures 44
Let’s proceed to…
Let’s proceed to…
Mathematical
Mathematical
Reasoning
Reasoning
Spring 2003 CMSC 203 - Discrete Structures 45
Mathematical Reasoning
Mathematical Reasoning
We need
We need mathematical reasoning
mathematical reasoning to
to
• determine whether a mathematical argument is
determine whether a mathematical argument is
correct or incorrect and
correct or incorrect and
• construct mathematical arguments.
construct mathematical arguments.
Mathematical reasoning is not only important for
Mathematical reasoning is not only important for
conducting
conducting proofs
proofs and
and program verification
program verification, but
, but
also for
also for artificial intelligence
artificial intelligence systems (drawing
systems (drawing
logical inferences from knowledge and facts).
logical inferences from knowledge and facts).
We focus on
We focus on deductive
deductive proofs
proofs
Spring 2003 CMSC 203 - Discrete Structures 46
Terminology
Terminology
An
An axiom
axiom is a basic assumption about mathematical
is a basic assumption about mathematical
structure that needs no proof.
structure that needs no proof.
- Things known to be true (facts or proven theorems)
Things known to be true (facts or proven theorems)
- Things believed to be true but cannot be proved
Things believed to be true but cannot be proved
We can use a
We can use a proof
proof to demonstrate that a
to demonstrate that a
particular statement is true. A proof consists of a
particular statement is true. A proof consists of a
sequence of statements that form an argument.
sequence of statements that form an argument.
The steps that connect the statements in such a
The steps that connect the statements in such a
sequence are the
sequence are the rules of inference
rules of inference.
.
Cases of incorrect reasoning are called
Cases of incorrect reasoning are called fallacies
fallacies.
.
Spring 2003 CMSC 203 - Discrete Structures 47
Terminology
Terminology
A
A theorem
theorem is a statement that can be shown to be
is a statement that can be shown to be
true.
true.
A
A lemma
lemma is a simple theorem used as an
is a simple theorem used as an
intermediate result in the proof of another
intermediate result in the proof of another
theorem.
theorem.
A
A corollary
corollary is a proposition that follows directly
is a proposition that follows directly
from a theorem that has been proved.
from a theorem that has been proved.
A
A conjecture
conjecture is a statement whose truth value is
is a statement whose truth value is
unknown. Once it is proven, it becomes a theorem.
unknown. Once it is proven, it becomes a theorem.
Spring 2003 CMSC 203 - Discrete Structures 48
Proofs
Proofs
A
A theorem
theorem often has two parts
often has two parts
- Conditions (premises, hypotheses)
Conditions (premises, hypotheses)
- conclusion
conclusion
A
A correct (deductive) proof
correct (deductive) proof is to establish that
is to establish that
- If the conditions are true then the conclusion is true
If the conditions are true then the conclusion is true
- I.e., Conditions
I.e., Conditions 
 conclusion is a
conclusion is a tautology
tautology
Often there are missing pieces between conditions
Often there are missing pieces between conditions
and conclusion. Fill it by an
and conclusion. Fill it by an argument
argument
- Using conditions and axioms
Using conditions and axioms
- Statements in the argument connected by proper
Statements in the argument connected by proper
rules of inference
rules of inference
Spring 2003 CMSC 203 - Discrete Structures 49
Rules of Inference
Rules of Inference
Rules of inference
Rules of inference provide the justification of
provide the justification of
the steps used in a proof.
the steps used in a proof.
One important rule is called
One important rule is called modus ponens
modus ponens or the
or the
law of detachment
law of detachment. It is based on the tautology
. It is based on the tautology
(p
(p 
 (p
(p 
 q))
q)) 
 q. We write it in the following way:
q. We write it in the following way:
p
p
p
p 
 q
q
____
____

 q
q
The two
The two hypotheses
hypotheses p and p
p and p 
 q are
q are
written in a column, and the
written in a column, and the conclusion
conclusion
below a bar, where
below a bar, where 
 means “therefore”.
means “therefore”.
Spring 2003 CMSC 203 - Discrete Structures 50
Rules of Inference
Rules of Inference
The general form of a rule of inference is:
The general form of a rule of inference is:
p
p1
1
p
p2
2
.
.
.
.
.
.
p
pn
n
____
____

 q
q
The rule states that if p
The rule states that if p1
1 and
and p
p2
2 and
and …
…
and
and p
pn
n are all true, then q is true as well.
are all true, then q is true as well.
Each rule is an established tautology of
Each rule is an established tautology of
p
p1
1 
 p
p2
2 
 …
… 
 p
pn
n 
 q
q
These rules of inference can be used in
These rules of inference can be used in
any mathematical argument and do not
any mathematical argument and do not
require any proof.
require any proof.
Spring 2003 CMSC 203 - Discrete Structures 51
Rules of Inference
Rules of Inference
p
p
_____
_____

 p
p
q
q
Addition
Addition
p
p
q
q
_____
_____

 p
p
Simplification
Simplification
p
p
q
q
_____
_____

 p
p
q
q
Conjunction
Conjunction

q
q
p
p 
 q
q
_____
_____

 
 p
p
Modus
Modus
tollens
tollens
p
p 
 q
q
q
q 
 r
r
_____
_____

 p
p
 r
r
Hypothetical
Hypothetical
syllogism
syllogism
(
(chaining
chaining)
)
p
p
q
q

p
p
_____
_____

 q
q
Disjunctive
Disjunctive
syllogism
syllogism
(
(resolution
resolution)
)
Spring 2003 CMSC 203 - Discrete Structures 52
Arguments
Arguments
Just like a rule of inference, an
Just like a rule of inference, an argument
argument consists
consists
of one or more hypotheses (or premises) and a
of one or more hypotheses (or premises) and a
conclusion.
conclusion.
We say that an argument is
We say that an argument is valid
valid, if whenever all
, if whenever all
its hypotheses are true, its conclusion is also true.
its hypotheses are true, its conclusion is also true.
However, if any hypothesis is false, even a valid
However, if any hypothesis is false, even a valid
argument can lead to an incorrect conclusion.
argument can lead to an incorrect conclusion.
Proof: show that
Proof: show that hypotheses
hypotheses 
 conclusion
conclusion is true
is true
using rules of inference
using rules of inference
Spring 2003 CMSC 203 - Discrete Structures 53
Arguments
Arguments
Example:
Example:
“
“If 101 is divisible by 3, then 101
If 101 is divisible by 3, then 1012
2
is divisible by 9.
is divisible by 9.
101 is divisible by 3. Consequently, 101
101 is divisible by 3. Consequently, 1012
2
is divisible
is divisible
by 9.”
by 9.”
Although the argument is
Although the argument is valid
valid, its conclusion is
, its conclusion is
incorrect
incorrect, because one of the hypotheses is false
, because one of the hypotheses is false
(“101 is divisible by 3.”).
(“101 is divisible by 3.”).
If in the above argument we replace 101 with 102,
If in the above argument we replace 101 with 102,
we could correctly conclude that 102
we could correctly conclude that 1022
2
is divisible
is divisible
by 9.
by 9.
Spring 2003 CMSC 203 - Discrete Structures 54
Arguments
Arguments
Which rule of inference was used in the last
Which rule of inference was used in the last
argument?
argument?
p: “101 is divisible by 3.”
p: “101 is divisible by 3.”
q: “101
q: “1012
2
is divisible by 9.”
is divisible by 9.”
p
p
p
p 
 q
q
_____
_____

 q
q
Modus
Modus
ponens
ponens
Unfortunately, one of the hypotheses (p) is false.
Unfortunately, one of the hypotheses (p) is false.
Therefore, the conclusion q is incorrect.
Therefore, the conclusion q is incorrect.
Spring 2003 CMSC 203 - Discrete Structures 55
Arguments
Arguments
Another example:
Another example:
“
“If it rains today, then we will not have a barbeque
If it rains today, then we will not have a barbeque
today. If we do not have a barbeque today, then
today. If we do not have a barbeque today, then
we will have a barbeque tomorrow.
we will have a barbeque tomorrow.
Therefore, if it rains today, then we will have a
Therefore, if it rains today, then we will have a
barbeque tomorrow.”
barbeque tomorrow.”
This is a
This is a valid
valid argument: If its hypotheses are
argument: If its hypotheses are
true, then its conclusion is also true.
true, then its conclusion is also true.
Spring 2003 CMSC 203 - Discrete Structures 56
Arguments
Arguments
Let us formalize the previous argument:
Let us formalize the previous argument:
p: “It is raining today.”
p: “It is raining today.”
q: “We will not have a barbecue today.”
q: “We will not have a barbecue today.”
r: “We will have a barbecue tomorrow.”
r: “We will have a barbecue tomorrow.”
So the argument is of the following form:
So the argument is of the following form:
p
p 
 q
q
q
q 
 r
r
______
______

 P
P 
 r
r
Hypothetical
Hypothetical
syllogism
syllogism
Spring 2003 CMSC 203 - Discrete Structures 57
Arguments
Arguments
Another example:
Another example:
Gary is either intelligent or a good actor.
Gary is either intelligent or a good actor.
If Gary is intelligent, then he can count
If Gary is intelligent, then he can count
from 1 to 10.
from 1 to 10.
Gary can only count from 1 to 3.
Gary can only count from 1 to 3.
Therefore, Gary is a good actor.
Therefore, Gary is a good actor.
i: “Gary is intelligent.”
i: “Gary is intelligent.”
a: “Gary is a good actor.”
a: “Gary is a good actor.”
c: “Gary can count from 1 to 10.”
c: “Gary can count from 1 to 10.”
Spring 2003 CMSC 203 - Discrete Structures 58
Arguments
Arguments
i: “Gary is intelligent.”
i: “Gary is intelligent.”
a: “Gary is a good actor.”
a: “Gary is a good actor.”
c: “Gary can count from 1 to 10.”
c: “Gary can count from 1 to 10.”
Step 1:
Step 1: 
 c
c Hypothesis
Hypothesis
Step 2:
Step 2: i
i 
 c
c Hypothesis
Hypothesis
Step 3:
Step 3: 
 i
i Modus tollens Steps 1 & 2
Modus tollens Steps 1 & 2
Step 4:
Step 4: a
a 
 i
i Hypothesis
Hypothesis
Step 5:
Step 5: a
a Disjunctive Syllogism
Disjunctive Syllogism
Steps 3 & 4
Steps 3 & 4
Conclusion:
Conclusion: a
a (“Gary is a good actor.”)
(“Gary is a good actor.”)
Spring 2003 CMSC 203 - Discrete Structures 59
Arguments
Arguments
Yet another example:
Yet another example:
If you listen to me, you will pass CS 320.
If you listen to me, you will pass CS 320.
You passed CS 320.
You passed CS 320.
Therefore, you have listened to me.
Therefore, you have listened to me.
Is this argument valid?
Is this argument valid?
No
No, it assumes ((p
, it assumes ((p 
 q)
q)
 q)
q) 
 p.
p.
This statement is not a tautology. It is
This statement is not a tautology. It is false
false if p is
if p is
false and q is true.
false and q is true.
Spring 2003 CMSC 203 - Discrete Structures 60
Rules of Inference for Quantified Statements
Rules of Inference for Quantified Statements

x P(x)
x P(x)
__________
__________

 P(c) if c
P(c) if c
U
U
Universal
Universal
instantiation
instantiation
P(c) for an arbitrary c
P(c) for an arbitrary c
U
U
___________________
___________________

 
x P(x)
x P(x)
Universal
Universal
generalization
generalization

x P(x)
x P(x)
______________________
______________________

 P(c) for some element c
P(c) for some element c
U
U
Existential
Existential
instantiation
instantiation
P(c) for some element c
P(c) for some element c
U
U
____________________
____________________

 
x P(x)
x P(x)
Existential
Existential
generalization
generalization
Spring 2003 CMSC 203 - Discrete Structures 61
Rules of Inference for Quantified Statements
Rules of Inference for Quantified Statements
Example:
Example:
Every UMB student is a genius.
Every UMB student is a genius.
George is a UMB student.
George is a UMB student.
Therefore, George is a genius.
Therefore, George is a genius.
U(x): “x is a UMB student.”
U(x): “x is a UMB student.”
G(x): “x is a genius.”
G(x): “x is a genius.”
Spring 2003 CMSC 203 - Discrete Structures 62
Rules of Inference for Quantified Statements
Rules of Inference for Quantified Statements
The following steps are used in the argument:
The following steps are used in the argument:
Step 1:
Step 1: 
x (U(x)
x (U(x) 
 G(x))
G(x)) Hypothesis
Hypothesis
Step 2:
Step 2: U(George)
U(George) 
 G(George)
G(George) Univ. instantiation
Univ. instantiation
using Step 1
using Step 1

x P(x)
x P(x)
__________
__________

 P(c) if c
P(c) if c
U
U
Universal
Universal
instantiation
instantiation
Step 3:
Step 3: U(George)
U(George) Hypothesis
Hypothesis
Step 4:
Step 4: G(George)
G(George) Modus ponens
Modus ponens
using Steps 2 & 3
using Steps 2 & 3
Spring 2003 CMSC 203 - Discrete Structures 63
Proving Theorems
Proving Theorems
Direct proof:
Direct proof:
An implication p
An implication p 
 q can be proved by showing that
q can be proved by showing that
if p is true, then q is also true.
if p is true, then q is also true.
Example:
Example: Give a direct proof of the theorem
Give a direct proof of the theorem
“If n is odd, then n
“If n is odd, then n2
2
is odd.”
is odd.”
Idea:
Idea: Assume that the hypothesis of this
Assume that the hypothesis of this
implication is true (n is odd). Then use rules of
implication is true (n is odd). Then use rules of
inference and known theorems of math to show
inference and known theorems of math to show
that q must also be true (n
that q must also be true (n2
2
is odd).
is odd).
Spring 2003 CMSC 203 - Discrete Structures 64
Proving Theorems
Proving Theorems
n is odd.
n is odd.
Then n = 2k + 1, where k is an integer.
Then n = 2k + 1, where k is an integer.
Consequently, n
Consequently, n2
2
= (2k + 1)
= (2k + 1)2
2
.
.
= 4k
= 4k2
2
+ 4k + 1
+ 4k + 1
= 2(2k
= 2(2k2
2
+ 2k) + 1
+ 2k) + 1
Since n
Since n2
2
can be written in this form, it is odd.
can be written in this form, it is odd.
Spring 2003 CMSC 203 - Discrete Structures 65
Proving Theorems
Proving Theorems
Indirect proof:
Indirect proof:
An implication p
An implication p 
 q is equivalent to its
q is equivalent to its contra-
contra-
positive
positive 
q
q 
 
p. Therefore, we can prove p
p. Therefore, we can prove p 
 q
q
by showing that whenever q is false, then p is also
by showing that whenever q is false, then p is also
false.
false.
Example:
Example: Give an indirect proof of the theorem
Give an indirect proof of the theorem
“If 3n + 2 is odd, then n is odd.”
“If 3n + 2 is odd, then n is odd.”
Idea:
Idea: Assume that the conclusion of this
Assume that the conclusion of this
implication is false (n is even). Then use rules of
implication is false (n is even). Then use rules of
inference and known theorems to show that p
inference and known theorems to show that p
must also be false (3n + 2 is even).
must also be false (3n + 2 is even).
Spring 2003 CMSC 203 - Discrete Structures 66
Proving Theorems
Proving Theorems
n is even.
n is even.
Then n = 2k, where k is an integer.
Then n = 2k, where k is an integer.
It follows that 3n + 2 = 3(2k) + 2
It follows that 3n + 2 = 3(2k) + 2
= 6k + 2
= 6k + 2
= 2(3k + 1)
= 2(3k + 1)
Therefore, 3n + 2 is even.
Therefore, 3n + 2 is even.
We have shown that the contrapositive of the
We have shown that the contrapositive of the
implication is true, so the implication itself is also
implication is true, so the implication itself is also
true
true (If 3n + 2 is odd, then n is odd).
(If 3n + 2 is odd, then n is odd).
Spring 2003 CMSC 203 - Discrete Structures 67
Proving Theorems
Proving Theorems
Indirect Proof is a special case of
Indirect Proof is a special case of proof by
proof by
contradiction
contradiction
Suppose n is even (
Suppose n is even (negation of the conclusion
negation of the conclusion).
).
Then n = 2k, where k is an integer.
Then n = 2k, where k is an integer.
It follows that 3n + 2 = 3(2k) + 2
It follows that 3n + 2 = 3(2k) + 2
= 6k + 2
= 6k + 2
= 2(3k + 1)
= 2(3k + 1)
Therefore, 3n + 2 is even.
Therefore, 3n + 2 is even.
However, this is a
However, this is a contradiction
contradiction since 3n + 2 is given
since 3n + 2 is given
to be odd, so the conclusion (n is odd) holds.
to be odd, so the conclusion (n is odd) holds.
Spring 2003 CMSC 203 - Discrete Structures 68
Another Example on Proof
Another Example on Proof
Anyone performs well is either intelligent or a
Anyone performs well is either intelligent or a
good actor.
good actor.
If someone is intelligent, then he/she can count
If someone is intelligent, then he/she can count
from 1 to 10.
from 1 to 10.
Gary performs well.
Gary performs well.
Gary can only count from 1 to 3.
Gary can only count from 1 to 3.
Therefore, not everyone is both intelligent and a
Therefore, not everyone is both intelligent and a
good actor
good actor
P(x): x performs well
P(x): x performs well
I(x): x is intelligent
I(x): x is intelligent
A(x): x is a good actor
A(x): x is a good actor
C(x): x can count from 1 to 10
C(x): x can count from 1 to 10
Spring 2003 CMSC 203 - Discrete Structures 69
Another Example on Proof
Another Example on Proof
Hypotheses:
Hypotheses:
1.
1. Anyone performs well is either intelligent or a good
Anyone performs well is either intelligent or a good
actor.
actor.

x (P(x)
x (P(x) 
 I(x)
I(x) 
 A(x))
A(x))
2.
2. If someone is intelligent, then he/she can count
If someone is intelligent, then he/she can count
from 1 to 10.
from 1 to 10.

x (I(x)
x (I(x) 
 C
C(x) )
(x) )
3.
3. Gary performs well.
Gary performs well.
P(G)
P(G)
4.
4. Gary can only count from 1 to 3.
Gary can only count from 1 to 3.

C(G)
C(G)
Conclusion: not everyone is both intelligent and a good
Conclusion: not everyone is both intelligent and a good
actor
actor

x(I(x)
x(I(x) 
 A(x))
A(x))
Spring 2003 CMSC 203 - Discrete Structures 70
Another Example on Proof
Another Example on Proof
Direct proof:
Direct proof:
Step 1:
Step 1: 
x (P(x)
x (P(x) 
 I(x)
I(x) 
 A(x))
A(x)) Hypothesis
Hypothesis
Step 2:
Step 2: P(G)
P(G) 
 I(G)
I(G) 
 A(G)
A(G) Univ. Inst. Step 1
Univ. Inst. Step 1
Step 3:
Step 3: P(G)
P(G) Hypothesis
Hypothesis
Step 4:
Step 4: I(G)
I(G) 
 A(G)
A(G) Modus ponens Steps 2 & 3
Modus ponens Steps 2 & 3
Step 5:
Step 5: 
x (I(x)
x (I(x) 
 C(x))
C(x)) Hypothesis
Hypothesis
Step 6:
Step 6: I(G)
I(G) 
 C(G)
C(G) Univ. inst. Step5
Univ. inst. Step5
Step 7:
Step 7: 
C(G)
C(G) Hypothesis
Hypothesis
Step 8:
Step 8: 
I(G)
I(G) Modus tollens Steps 6 & 7
Modus tollens Steps 6 & 7
Step 9:
Step 9: 
I(G)
I(G) 
 
A(G)
A(G) Addition Step 8
Addition Step 8
Step 10:
Step 10: 
(I(G)
(I(G) 
 A(G))
A(G)) Equivalence Step 9
Equivalence Step 9
Step 11:
Step 11: 
x
x
(I(x)
(I(x) 
 A(x))
A(x)) Exist. general. Step 10
Exist. general. Step 10
Step 12:
Step 12: 
x (I(x)
x (I(x) 
 A(x))
A(x)) Equivalence Step 11
Equivalence Step 11
Conclusion:
Conclusion: 
x (I(x)
x (I(x) 
 A(x))
A(x)), not everyone is both intelligent and
, not everyone is both intelligent and
a good actor.
a good actor.
Spring 2003 CMSC 203 - Discrete Structures 71
Summary, Section 1.5
Summary, Section 1.5
• Terminology (axiom, theorem, conjecture,
Terminology (axiom, theorem, conjecture,
argument, etc.)
argument, etc.)
• Rules of inference (Tables 1 and 2)
Rules of inference (Tables 1 and 2)
• Valid argument (hypotheses and conclusion)
Valid argument (hypotheses and conclusion)
• Construction of valid argument using rules of
Construction of valid argument using rules of
inference
inference
– For each rule used, write down and the statements
For each rule used, write down and the statements
involved in the proof
involved in the proof
• Direct and indirect proofs
Direct and indirect proofs
– Other proof methods (e.g., induction, pigeon hole)
Other proof methods (e.g., induction, pigeon hole)
will be introduced in later chapters
will be introduced in later chapters

More Related Content

PPT
Ch01-1.ppt
PPT
Ch01-1.ppt
PDF
PPTX
This is one of the subtopics of Introduction to set and logic theory in mathe...
PPTX
Let’s get started with with discrete math.pptx
PPT
Discrete Mathematics - All chapters
PDF
dma_ppt.pdf
PPT
The propositional logic and its appl.ppt
Ch01-1.ppt
Ch01-1.ppt
This is one of the subtopics of Introduction to set and logic theory in mathe...
Let’s get started with with discrete math.pptx
Discrete Mathematics - All chapters
dma_ppt.pdf
The propositional logic and its appl.ppt

Similar to Ch01 logic 7238248327433333722u393-1.ppt (20)

PDF
Discrete Structures lecture 2
PDF
Discrete Structures. Lecture 1
PPTX
Intro to disceret structure
PPT
lecture011712 (1).ppt
PDF
Dscrete structure
PPTX
PPTX
discrete structures and their introduction
PPTX
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation
PPTX
Discrete Structure/Mathematics INTRODUCTION TO LOGIC
PPT
Best presentation about discrete structure
PPT
good teaching skills and other beautiful things
PPTX
1. Introduction to math logic.pptx
PPT
Discrete Maths141 - Course Outline and Lecture Slides
PPTX
DiscreteMathematicsfor btechAsWeProgress.pptx
PDF
SMIU Lecture #1 & 2 Introduction to Discrete Structure and Truth Table.pdf
PPTX
Tn 110 lecture 1 logic
PPT
2_1_DiscreteMathematics_05 2 slides about discrete subjects
PPT
logic and proof II for grade 12 students .ppt
PPT
Discrete mathematics with applications by Susanna notes
Discrete Structures lecture 2
Discrete Structures. Lecture 1
Intro to disceret structure
lecture011712 (1).ppt
Dscrete structure
discrete structures and their introduction
Logic, contrapositive, converse, Discrete Mathematics, conjunction, negation
Discrete Structure/Mathematics INTRODUCTION TO LOGIC
Best presentation about discrete structure
good teaching skills and other beautiful things
1. Introduction to math logic.pptx
Discrete Maths141 - Course Outline and Lecture Slides
DiscreteMathematicsfor btechAsWeProgress.pptx
SMIU Lecture #1 & 2 Introduction to Discrete Structure and Truth Table.pdf
Tn 110 lecture 1 logic
2_1_DiscreteMathematics_05 2 slides about discrete subjects
logic and proof II for grade 12 students .ppt
Discrete mathematics with applications by Susanna notes
Ad

More from ssuser7b9bda1 (14)

PPT
03_sorting123456789454545454545444543.ppt
PPT
Ch02 algorithm 127836129812y12y823873893.ppt
PPT
Ch01-2 set theory 123873298738938r3387.ppt
PPT
Dijkstra algorithm ds 57612334t4t44.ppt
PPT
lecture DS warshalls algo DFS BFS DS.ppt
PPTX
DS ppt 123445544434t33vdbdbdbfgfPPtt.pptx
PPT
graphass1-23022111180722548-1ba6b00a.ppt
PPTX
DSE LECTURE 1 -LRW_ Introduction_to_Computer.pptx
PPT
lecture07 dicrete mathematics relation .ppt
PPTX
skoekoe3748339828yrhjejh2989839jkej.pptx
PPTX
Exploring the Stack Stack Description.pptx
PPT
Lecture9_StackQueue operation on stacks .ppt
PPT
Exploring the Stack Stack operation.pptx
PDF
Agri Brochure sample for reference 123.pdf
03_sorting123456789454545454545444543.ppt
Ch02 algorithm 127836129812y12y823873893.ppt
Ch01-2 set theory 123873298738938r3387.ppt
Dijkstra algorithm ds 57612334t4t44.ppt
lecture DS warshalls algo DFS BFS DS.ppt
DS ppt 123445544434t33vdbdbdbfgfPPtt.pptx
graphass1-23022111180722548-1ba6b00a.ppt
DSE LECTURE 1 -LRW_ Introduction_to_Computer.pptx
lecture07 dicrete mathematics relation .ppt
skoekoe3748339828yrhjejh2989839jkej.pptx
Exploring the Stack Stack Description.pptx
Lecture9_StackQueue operation on stacks .ppt
Exploring the Stack Stack operation.pptx
Agri Brochure sample for reference 123.pdf
Ad

Recently uploaded (20)

PPT
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
PPTX
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
PDF
737-MAX_SRG.pdf student reference guides
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
PPTX
Amdahl’s law is explained in the above power point presentations
PDF
III.4.1.2_The_Space_Environment.p pdffdf
PDF
Design Guidelines and solutions for Plastics parts
PPTX
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
PDF
Visual Aids for Exploratory Data Analysis.pdf
PPTX
CyberSecurity Mobile and Wireless Devices
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
Module 8- Technological and Communication Skills.pptx
PPTX
Feature types and data preprocessing steps
PPTX
communication and presentation skills 01
PDF
Soil Improvement Techniques Note - Rabbi
PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
INTRODUCTION -Data Warehousing and Mining-M.Tech- VTU.ppt
ASME PCC-02 TRAINING -DESKTOP-NLE5HNP.pptx
737-MAX_SRG.pdf student reference guides
Categorization of Factors Affecting Classification Algorithms Selection
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
A SYSTEMATIC REVIEW OF APPLICATIONS IN FRAUD DETECTION
Amdahl’s law is explained in the above power point presentations
III.4.1.2_The_Space_Environment.p pdffdf
Design Guidelines and solutions for Plastics parts
Chemical Technological Processes, Feasibility Study and Chemical Process Indu...
Visual Aids for Exploratory Data Analysis.pdf
CyberSecurity Mobile and Wireless Devices
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Module 8- Technological and Communication Skills.pptx
Feature types and data preprocessing steps
communication and presentation skills 01
Soil Improvement Techniques Note - Rabbi
"Array and Linked List in Data Structures with Types, Operations, Implementat...
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...

Ch01 logic 7238248327433333722u393-1.ppt

  • 1. Spring 2003 CMSC 203 - Discrete Structures 1 Let’s get started with... Let’s get started with... Logic Logic! !
  • 2. Spring 2003 CMSC 203 - Discrete Structures 2 Logic Logic • Crucial for mathematical reasoning Crucial for mathematical reasoning • Important for program design Important for program design • Used for designing electronic circuitry Used for designing electronic circuitry • (Propositional )Logic is a system based on (Propositional )Logic is a system based on propositions propositions. . • A proposition is a (declarative) statement that is A proposition is a (declarative) statement that is either either true true or or false false (not both). (not both). • We say that the We say that the truth value truth value of a proposition is of a proposition is either true ( either true (T T) or false ( ) or false (F F). ). • Corresponds to Corresponds to 1 1 and and 0 0 in digital circuits in digital circuits
  • 3. Spring 2003 CMSC 203 - Discrete Structures 3 The Statement/Proposition Game The Statement/Proposition Game “ “Elephants are bigger than mice.” Elephants are bigger than mice.” Is this a statement? Is this a statement? yes yes Is this a proposition? Is this a proposition? yes yes What is the truth value What is the truth value of the proposition? of the proposition? true true
  • 4. Spring 2003 CMSC 203 - Discrete Structures 4 The Statement/Proposition Game The Statement/Proposition Game “ “520 < 111” 520 < 111” Is this a statement? Is this a statement? yes yes Is this a proposition? Is this a proposition? yes yes What is the truth value What is the truth value of the proposition? of the proposition? false false
  • 5. Spring 2003 CMSC 203 - Discrete Structures 5 The Statement/Proposition Game The Statement/Proposition Game “ “y > 5” y > 5” Is this a statement? Is this a statement? yes yes Is this a proposition? Is this a proposition? no no Its truth value depends on the value of y, Its truth value depends on the value of y, but this value is not specified. but this value is not specified. We call this type of statement a We call this type of statement a propositional function propositional function or or open sentence open sentence. .
  • 6. Spring 2003 CMSC 203 - Discrete Structures 6 The Statement/Proposition Game The Statement/Proposition Game “ “Today is January 27 and 99 < 5.” Today is January 27 and 99 < 5.” Is this a statement? Is this a statement? yes yes Is this a proposition? Is this a proposition? yes yes What is the truth value What is the truth value of the proposition? of the proposition? false false
  • 7. Spring 2003 CMSC 203 - Discrete Structures 7 The Statement/Proposition Game The Statement/Proposition Game “ “Please do not fall asleep.” Please do not fall asleep.” Is this a statement? Is this a statement? no no Is this a proposition? Is this a proposition? no no Only statements can be propositions. Only statements can be propositions. It’s a request. It’s a request.
  • 8. Spring 2003 CMSC 203 - Discrete Structures 8 The Statement/Proposition Game The Statement/Proposition Game “ “If the moon is made of cheese, If the moon is made of cheese, then I will be rich.” then I will be rich.” Is this a statement? Is this a statement? yes yes Is this a proposition? Is this a proposition? yes yes What is the truth value What is the truth value of the proposition? of the proposition? probably true probably true
  • 9. Spring 2003 CMSC 203 - Discrete Structures 9 The Statement/Proposition Game The Statement/Proposition Game “ “x < y if and only if y > x.” x < y if and only if y > x.” Is this a statement? Is this a statement? yes yes Is this a proposition? Is this a proposition? yes yes What is the truth value What is the truth value of the proposition? of the proposition? true true … … because its truth value because its truth value does not depend on does not depend on specific values of x and y. specific values of x and y.
  • 10. Spring 2003 CMSC 203 - Discrete Structures 10 Combining Propositions Combining Propositions As we have seen in the previous examples, As we have seen in the previous examples, one or more propositions can be combined one or more propositions can be combined to form a single to form a single compound proposition compound proposition. . We formalize this by denoting propositions We formalize this by denoting propositions with letters such as with letters such as p, q, r, s, p, q, r, s, and and introducing several introducing several logical operators or logical operators or logical connectives logical connectives. .
  • 11. Spring 2003 CMSC 203 - Discrete Structures 11 Logical Operators (Connectives) Logical Operators (Connectives) We will examine the following logical operators: We will examine the following logical operators: • Negation Negation (NOT, (NOT,  ) ) • Conjunction Conjunction (AND, (AND,  ) ) • Disjunction Disjunction (OR, (OR,  ) ) • Exclusive-or Exclusive-or (XOR, (XOR,   ) ) • Implication Implication (if – then, (if – then,   ) ) • Biconditional Biconditional (if and only if, (if and only if,   ) ) Truth tables can be used to show how these Truth tables can be used to show how these operators can combine propositions to compound operators can combine propositions to compound propositions. propositions.
  • 12. Spring 2003 CMSC 203 - Discrete Structures 12 Negation (NOT) Negation (NOT) Unary Operator, Symbol: Unary Operator, Symbol:   P P   P P true (T) true (T) false (F) false (F) false (F) false (F) true (T) true (T)
  • 13. Spring 2003 CMSC 203 - Discrete Structures 13 Conjunction (AND) Conjunction (AND) Binary Operator, Symbol: Binary Operator, Symbol:   P P Q Q P P  Q Q T T T T T T T T F F F F F F T T F F F F F F F F
  • 14. Spring 2003 CMSC 203 - Discrete Structures 14 Disjunction (OR) Disjunction (OR) Binary Operator, Symbol: Binary Operator, Symbol:   P P Q Q P P   Q Q T T T T T T T T F F T T F F T T T T F F F F F F
  • 15. Spring 2003 CMSC 203 - Discrete Structures 15 Exclusive Or (XOR) Exclusive Or (XOR) Binary Operator, Symbol: Binary Operator, Symbol:   P P Q Q P P Q Q T T T T F F T T F F T T F F T T T T F F F F F F
  • 16. Spring 2003 CMSC 203 - Discrete Structures 16 Implication (if - then) Implication (if - then) Binary Operator, Symbol: Binary Operator, Symbol:   P P Q Q P P Q Q T T T T T T T T F F F F F F T T T T F F F F T T
  • 17. Spring 2003 CMSC 203 - Discrete Structures 17 Biconditional (if and only if) Biconditional (if and only if) Binary Operator, Symbol: Binary Operator, Symbol:   P P Q Q P P Q Q T T T T T T T T F F F F F F T T F F F F F F T T
  • 18. Spring 2003 CMSC 203 - Discrete Structures 18 Statements and Operators Statements and Operators Statements and operators can be combined in any Statements and operators can be combined in any way to form new statements. way to form new statements. P P Q Q  P P  Q Q ( ( P) P) ( ( Q) Q) T T T T F F F F F F T T F F F F T T T T F F T T T T F F T T F F F F T T T T T T
  • 19. Spring 2003 CMSC 203 - Discrete Structures 19 Statements and Operations Statements and Operations Statements and operators can be combined in any Statements and operators can be combined in any way to form new statements. way to form new statements. P P Q Q P P Q Q  (P (P Q) Q) ( ( P) P) ( ( Q) Q) T T T T T T F F F F T T F F F F T T T T F F T T F F T T T T F F F F F F T T T T
  • 20. Spring 2003 CMSC 203 - Discrete Structures 20 Exercises Exercises • To take discrete mathematics, you must have To take discrete mathematics, you must have taken calculus or a course in computer science. taken calculus or a course in computer science. • When you buy a new car from Acme Motor When you buy a new car from Acme Motor Company, you get $2000 back in cash or a 2% Company, you get $2000 back in cash or a 2% car loan. car loan. • School is closed if more than 2 feet of snow School is closed if more than 2 feet of snow falls or if the wind chill is below -100. falls or if the wind chill is below -100.
  • 21. Spring 2003 CMSC 203 - Discrete Structures 21 Exercises Exercises – P: take discrete mathematics P: take discrete mathematics – Q: take calculus Q: take calculus – R: take a course in computer science R: take a course in computer science • P P   Q Q   R R • Problem with proposition R Problem with proposition R – What if I want to represent “take CMSC201”? What if I want to represent “take CMSC201”? • To take discrete mathematics, you must have To take discrete mathematics, you must have taken calculus or a course in computer science. taken calculus or a course in computer science.
  • 22. Spring 2003 CMSC 203 - Discrete Structures 22 Exercises Exercises – P: buy a car from Acme Motor Company P: buy a car from Acme Motor Company – Q: get $2000 cash back Q: get $2000 cash back – R: get a 2% car loan R: get a 2% car loan • P P   Q Q   R R • Why use XOR here? – example of Why use XOR here? – example of ambiguity of ambiguity of natural languages natural languages • When you buy a new car from Acme Motor When you buy a new car from Acme Motor Company, you get $2000 back in cash or a 2% Company, you get $2000 back in cash or a 2% car loan. car loan.
  • 23. Spring 2003 CMSC 203 - Discrete Structures 23 Exercises Exercises – P: School is closed P: School is closed – Q: 2 feet of snow falls Q: 2 feet of snow falls – R: wind chill is below -100 R: wind chill is below -100 • Q Q   R R   P P • Precedence among operators: Precedence among operators:  , ,  , ,  , ,  , ,   • School is closed if more than 2 feet of snow School is closed if more than 2 feet of snow falls or if the wind chill is below -100. falls or if the wind chill is below -100.
  • 24. Spring 2003 CMSC 203 - Discrete Structures 24 Equivalent Statements Equivalent Statements P P Q Q  (P (P Q) Q) ( ( P) P) ( ( Q) Q)  (P (P Q) Q) ( ( P) P) ( ( Q) Q) T T T T F F F F T T T T F F T T T T T T F F T T T T T T T T F F F F T T T T T T The statements The statements  (P (P Q) and ( Q) and ( P) P)   ( ( Q) are Q) are logically equivalent logically equivalent, since they have the , since they have the same truth table, or put it in another way, same truth table, or put it in another way,  (P (P Q) Q)  ( ( P) P)   ( ( Q) is always true. Q) is always true.
  • 25. Spring 2003 CMSC 203 - Discrete Structures 25 Tautologies and Contradictions Tautologies and Contradictions A tautology is a statement that is always true. A tautology is a statement that is always true. Examples: Examples: – R R ( ( R) R)   (P (P Q) Q)   ( ( P) P) ( (  Q) Q) A contradiction is a statement that is always false. A contradiction is a statement that is always false. Examples: Examples: – R R ( ( R) R)   ( ( (P (P   Q) Q)   ( ( P) P)   ( ( Q)) Q)) The negation of any tautology is a contradiction, and The negation of any tautology is a contradiction, and the negation of any contradiction is a tautology. the negation of any contradiction is a tautology.
  • 26. Spring 2003 CMSC 203 - Discrete Structures 26 Equivalence Equivalence Definition: two propositional statements Definition: two propositional statements S1 and S2 are said to be (logically) S1 and S2 are said to be (logically) equivalent, denoted S1 equivalent, denoted S1   S2 if S2 if – They have the same truth table, or They have the same truth table, or – S1 S1   S2 is a tautology S2 is a tautology Equivalence can be established by Equivalence can be established by – Constructing truth tables Constructing truth tables – Using equivalence laws (Table 5 in Section 1.2) Using equivalence laws (Table 5 in Section 1.2)
  • 27. Spring 2003 CMSC 203 - Discrete Structures 27 Equivalence Equivalence Equivalence laws Equivalence laws – Identity laws, Identity laws, P P   T T   P, P, – Domination laws, Domination laws, P P   F F   F, F, – Idempotent laws, Idempotent laws, P P   P P   P, P, – Double negation law, Double negation law,   ( (  P P) )   P P – Commutative laws, Commutative laws, P P   Q Q   Q Q   P, P, – Associative laws, Associative laws, P P   (Q (Q   R) R)  ( (P P   Q) Q)   R R, , – Distributive laws, Distributive laws, P P   (Q (Q   R) R)  ( (P P   Q) Q)   (P (P   R) R), , – De Morgan’s laws, De Morgan’s laws,   (P (P Q) Q)   ( (  P) P)   ( (  Q) Q) – Law with implication Law with implication P P   Q Q     P P   Q Q
  • 28. Spring 2003 CMSC 203 - Discrete Structures 28 Exercises Exercises • Show that Show that P P   Q Q     P P   Q Q: by truth table : by truth table • Show that Show that (P (P   Q) Q)   (P (P   R) R)   P P   (Q (Q   R) R): by : by equivalence laws (q20, p27): equivalence laws (q20, p27): – Law with implication on both sides Law with implication on both sides – Distribution law on LHS Distribution law on LHS
  • 29. Spring 2003 CMSC 203 - Discrete Structures 29 Summary, Sections 1.1, 1.2 Summary, Sections 1.1, 1.2 •Proposition Proposition – Statement, Truth value, Statement, Truth value, – Proposition, Propositional symbol, Open proposition Proposition, Propositional symbol, Open proposition •Operators Operators – Define by truth tables Define by truth tables – Composite propositions Composite propositions – Tautology and contradiction Tautology and contradiction •Equivalence of propositional statements Equivalence of propositional statements – Definition Definition – Proving equivalence (by truth table or equivalence Proving equivalence (by truth table or equivalence laws) laws)
  • 30. Spring 2003 CMSC 203 - Discrete Structures 30 Propositional Functions & Predicates Propositional Functions & Predicates Propositional function (open sentence): Propositional function (open sentence): statement involving one or more variables, statement involving one or more variables, e.g.: x-3 > 5. e.g.: x-3 > 5. Let us call this propositional function P(x), where Let us call this propositional function P(x), where P is the P is the predicate predicate and x is the and x is the variable variable. . What is the truth value of P(2) ? What is the truth value of P(2) ? false false What is the truth value of P(8) ? What is the truth value of P(8) ? What is the truth value of P(9) ? What is the truth value of P(9) ? false false true true When a variable is given a value, it is said to be When a variable is given a value, it is said to be instantiated instantiated Truth value depends on value of variable Truth value depends on value of variable
  • 31. Spring 2003 CMSC 203 - Discrete Structures 31 Propositional Functions Propositional Functions Let us consider the propositional function Let us consider the propositional function Q(x, y, z) defined as: Q(x, y, z) defined as: x + y = z. x + y = z. Here, Q is the Here, Q is the predicate predicate and x, y, and z are the and x, y, and z are the variables variables. . What is the truth value of Q(2, 3, 5) ? What is the truth value of Q(2, 3, 5) ? true true What is the truth value of Q(0, 1, 2) ? What is the truth value of Q(0, 1, 2) ? What is the truth value of Q(9, -9, 0) ? What is the truth value of Q(9, -9, 0) ? false false true true A propositional function (predicate) becomes a A propositional function (predicate) becomes a proposition when proposition when all all its variables are its variables are instantiated instantiated. .
  • 32. Spring 2003 CMSC 203 - Discrete Structures 32 Propositional Functions Propositional Functions Other examples of propositional functions Other examples of propositional functions Person(x), Person(x), which is true if x is a person which is true if x is a person Person(Socrates) = T Person(Socrates) = T CSCourse(x), CSCourse(x), which is true if x is a which is true if x is a computer science course computer science course CSCourse(CMSC201) = T CSCourse(CMSC201) = T Person(dolly-the-sheep) = F Person(dolly-the-sheep) = F CSCourse(MATH155) = F CSCourse(MATH155) = F How do we say How do we say All humans are mortal All humans are mortal One CS course One CS course
  • 33. Spring 2003 CMSC 203 - Discrete Structures 33 Universal Quantification Universal Quantification Let P(x) be a predicate (propositional function). Let P(x) be a predicate (propositional function). Universally quantified sentence Universally quantified sentence: : For all x in the For all x in the universe of discourse universe of discourse P(x) is true. P(x) is true. Using the universal quantifier Using the universal quantifier  : :  x P(x) x P(x) “for all x P(x)” or “for every x P(x)” “for all x P(x)” or “for every x P(x)” (Note: (Note:  x P(x) is either true or false, so it is a x P(x) is either true or false, so it is a proposition, not a propositional function.) proposition, not a propositional function.)
  • 34. Spring 2003 CMSC 203 - Discrete Structures 34 Universal Quantification Universal Quantification Example: Let the universe of discourse be all people Example: Let the universe of discourse be all people S(x): x is a UMBC student. S(x): x is a UMBC student. G(x): x is a genius. G(x): x is a genius. What does What does  x (S(x) x (S(x)   G(x)) G(x)) mean ? mean ? “ “If x is a UMBC student, then x is a genius.” or If x is a UMBC student, then x is a genius.” or “ “All UMBC students are geniuses.” All UMBC students are geniuses.” If the universe of discourse is all UMBC students, If the universe of discourse is all UMBC students, then the same statement can be written as then the same statement can be written as  x G(x) x G(x)
  • 35. Spring 2003 CMSC 203 - Discrete Structures 35 Existential Quantification Existential Quantification Existentially quantified sentence Existentially quantified sentence: : There exists an x in the universe of discourse There exists an x in the universe of discourse for which P(x) is true. for which P(x) is true. Using the existential quantifier Using the existential quantifier  : :  x P(x) x P(x) “There is an x such that P(x).” “There is an x such that P(x).” “ “There is at least one x such that P(x).” There is at least one x such that P(x).” (Note: (Note:  x P(x) is either true or false, so it is a x P(x) is either true or false, so it is a proposition, but no propositional function.) proposition, but no propositional function.)
  • 36. Spring 2003 CMSC 203 - Discrete Structures 36 Existential Quantification Existential Quantification Example: Example: P(x): x is a UMBC professor. P(x): x is a UMBC professor. G(x): x is a genius. G(x): x is a genius. What does What does  x (P(x) x (P(x)   G(x)) G(x)) mean ? mean ? “ “There is an x such that x is a UMBC professor There is an x such that x is a UMBC professor and x is a genius.” and x is a genius.” or or “ “At least one UMBC professor is a genius.” At least one UMBC professor is a genius.”
  • 37. Spring 2003 CMSC 203 - Discrete Structures 37 Quantification Quantification Another example: Another example: Let the universe of discourse be the real numbers. Let the universe of discourse be the real numbers. What does What does  x x y (x + y = 320) y (x + y = 320) mean ? mean ? “ “For every x there exists a y so that x + y = 320.” For every x there exists a y so that x + y = 320.” Is it true? Is it true? Is it true for the natural numbers? Is it true for the natural numbers? yes yes no no
  • 38. Spring 2003 CMSC 203 - Discrete Structures 38 Disproof by Counterexample Disproof by Counterexample A counterexample to A counterexample to  x P(x) is an object c so x P(x) is an object c so that P(c) is false. that P(c) is false. Statements such as Statements such as  x (P(x) x (P(x)   Q(x)) can be Q(x)) can be disproved by simply providing a counterexample. disproved by simply providing a counterexample. Statement: “All birds can fly.” Statement: “All birds can fly.” Disproved by counterexample: Penguin. Disproved by counterexample: Penguin.
  • 39. Spring 2003 CMSC 203 - Discrete Structures 39 Negation Negation  ( ( x P(x)) is logically equivalent to x P(x)) is logically equivalent to  x ( x ( P(x)). P(x)).  ( ( x P(x)) is logically equivalent to x P(x)) is logically equivalent to  x ( x ( P(x)). P(x)). See Table 2 in Section 1.3. See Table 2 in Section 1.3. This is de Morgan’s law for quantifiers This is de Morgan’s law for quantifiers
  • 40. Spring 2003 CMSC 203 - Discrete Structures 40 Negation Negation Examples Examples Not all roses are red Not all roses are red   x (Rose(x) x (Rose(x)   Red(x) Red(x)) )  x (Rose(x) x (Rose(x)    Red(x) Red(x)) ) Nobody is perfect Nobody is perfect   x (Person(x) x (Person(x)   Perfect(x) Perfect(x)) )  x (Person(x) x (Person(x)    Perfect(x) Perfect(x)) )
  • 41. Spring 2003 CMSC 203 - Discrete Structures 41 Nested Quantifier Nested Quantifier A predicate can have more than one variables. A predicate can have more than one variables. – S(x, y, z): z is the sum of x and y S(x, y, z): z is the sum of x and y – F(x, y): x and y are friends F(x, y): x and y are friends We can quantify individual variables in different We can quantify individual variables in different ways ways   x, y, z (S(x, y, z) x, y, z (S(x, y, z)   (x <= z (x <= z   y <= z)) y <= z))   x x  y y  z (F(x, y) z (F(x, y)   F(x, z) F(x, z)   (y != z) (y != z)    F(y, z) F(y, z)
  • 42. Spring 2003 CMSC 203 - Discrete Structures 42 Nested Quantifier Nested Quantifier Exercise: translate the following English Exercise: translate the following English sentence into logical expression sentence into logical expression “ “There is a rational number in between every There is a rational number in between every pair of distinct rational numbers” pair of distinct rational numbers” Use predicate Use predicate Q(x) Q(x), which is true when x , which is true when x is a rational number is a rational number  x,y ( x,y (Q Q(x) (x)   Q Q (y) (y)   (x < y) (x < y)    u (Q(u) u (Q(u)   (x < u) (x < u)   (u < y))) (u < y)))
  • 43. Spring 2003 CMSC 203 - Discrete Structures 43 Summary, Sections 1.3, 1.4 Summary, Sections 1.3, 1.4 • Propositional functions (predicates) Propositional functions (predicates) • Universal and existential quantifiers, and Universal and existential quantifiers, and the duality of the two the duality of the two • When predicates become propositions When predicates become propositions – All of its variables are instantiated All of its variables are instantiated – All of its variables are quantified All of its variables are quantified • Nested quantifiers Nested quantifiers – Quantifiers with negation Quantifiers with negation • Logical expressions formed by predicates, Logical expressions formed by predicates, operators, and quantifiers operators, and quantifiers
  • 44. Spring 2003 CMSC 203 - Discrete Structures 44 Let’s proceed to… Let’s proceed to… Mathematical Mathematical Reasoning Reasoning
  • 45. Spring 2003 CMSC 203 - Discrete Structures 45 Mathematical Reasoning Mathematical Reasoning We need We need mathematical reasoning mathematical reasoning to to • determine whether a mathematical argument is determine whether a mathematical argument is correct or incorrect and correct or incorrect and • construct mathematical arguments. construct mathematical arguments. Mathematical reasoning is not only important for Mathematical reasoning is not only important for conducting conducting proofs proofs and and program verification program verification, but , but also for also for artificial intelligence artificial intelligence systems (drawing systems (drawing logical inferences from knowledge and facts). logical inferences from knowledge and facts). We focus on We focus on deductive deductive proofs proofs
  • 46. Spring 2003 CMSC 203 - Discrete Structures 46 Terminology Terminology An An axiom axiom is a basic assumption about mathematical is a basic assumption about mathematical structure that needs no proof. structure that needs no proof. - Things known to be true (facts or proven theorems) Things known to be true (facts or proven theorems) - Things believed to be true but cannot be proved Things believed to be true but cannot be proved We can use a We can use a proof proof to demonstrate that a to demonstrate that a particular statement is true. A proof consists of a particular statement is true. A proof consists of a sequence of statements that form an argument. sequence of statements that form an argument. The steps that connect the statements in such a The steps that connect the statements in such a sequence are the sequence are the rules of inference rules of inference. . Cases of incorrect reasoning are called Cases of incorrect reasoning are called fallacies fallacies. .
  • 47. Spring 2003 CMSC 203 - Discrete Structures 47 Terminology Terminology A A theorem theorem is a statement that can be shown to be is a statement that can be shown to be true. true. A A lemma lemma is a simple theorem used as an is a simple theorem used as an intermediate result in the proof of another intermediate result in the proof of another theorem. theorem. A A corollary corollary is a proposition that follows directly is a proposition that follows directly from a theorem that has been proved. from a theorem that has been proved. A A conjecture conjecture is a statement whose truth value is is a statement whose truth value is unknown. Once it is proven, it becomes a theorem. unknown. Once it is proven, it becomes a theorem.
  • 48. Spring 2003 CMSC 203 - Discrete Structures 48 Proofs Proofs A A theorem theorem often has two parts often has two parts - Conditions (premises, hypotheses) Conditions (premises, hypotheses) - conclusion conclusion A A correct (deductive) proof correct (deductive) proof is to establish that is to establish that - If the conditions are true then the conclusion is true If the conditions are true then the conclusion is true - I.e., Conditions I.e., Conditions   conclusion is a conclusion is a tautology tautology Often there are missing pieces between conditions Often there are missing pieces between conditions and conclusion. Fill it by an and conclusion. Fill it by an argument argument - Using conditions and axioms Using conditions and axioms - Statements in the argument connected by proper Statements in the argument connected by proper rules of inference rules of inference
  • 49. Spring 2003 CMSC 203 - Discrete Structures 49 Rules of Inference Rules of Inference Rules of inference Rules of inference provide the justification of provide the justification of the steps used in a proof. the steps used in a proof. One important rule is called One important rule is called modus ponens modus ponens or the or the law of detachment law of detachment. It is based on the tautology . It is based on the tautology (p (p   (p (p   q)) q))   q. We write it in the following way: q. We write it in the following way: p p p p   q q ____ ____   q q The two The two hypotheses hypotheses p and p p and p   q are q are written in a column, and the written in a column, and the conclusion conclusion below a bar, where below a bar, where   means “therefore”. means “therefore”.
  • 50. Spring 2003 CMSC 203 - Discrete Structures 50 Rules of Inference Rules of Inference The general form of a rule of inference is: The general form of a rule of inference is: p p1 1 p p2 2 . . . . . . p pn n ____ ____   q q The rule states that if p The rule states that if p1 1 and and p p2 2 and and … … and and p pn n are all true, then q is true as well. are all true, then q is true as well. Each rule is an established tautology of Each rule is an established tautology of p p1 1   p p2 2   … …   p pn n   q q These rules of inference can be used in These rules of inference can be used in any mathematical argument and do not any mathematical argument and do not require any proof. require any proof.
  • 51. Spring 2003 CMSC 203 - Discrete Structures 51 Rules of Inference Rules of Inference p p _____ _____   p p q q Addition Addition p p q q _____ _____   p p Simplification Simplification p p q q _____ _____   p p q q Conjunction Conjunction  q q p p   q q _____ _____     p p Modus Modus tollens tollens p p   q q q q   r r _____ _____   p p  r r Hypothetical Hypothetical syllogism syllogism ( (chaining chaining) ) p p q q  p p _____ _____   q q Disjunctive Disjunctive syllogism syllogism ( (resolution resolution) )
  • 52. Spring 2003 CMSC 203 - Discrete Structures 52 Arguments Arguments Just like a rule of inference, an Just like a rule of inference, an argument argument consists consists of one or more hypotheses (or premises) and a of one or more hypotheses (or premises) and a conclusion. conclusion. We say that an argument is We say that an argument is valid valid, if whenever all , if whenever all its hypotheses are true, its conclusion is also true. its hypotheses are true, its conclusion is also true. However, if any hypothesis is false, even a valid However, if any hypothesis is false, even a valid argument can lead to an incorrect conclusion. argument can lead to an incorrect conclusion. Proof: show that Proof: show that hypotheses hypotheses   conclusion conclusion is true is true using rules of inference using rules of inference
  • 53. Spring 2003 CMSC 203 - Discrete Structures 53 Arguments Arguments Example: Example: “ “If 101 is divisible by 3, then 101 If 101 is divisible by 3, then 1012 2 is divisible by 9. is divisible by 9. 101 is divisible by 3. Consequently, 101 101 is divisible by 3. Consequently, 1012 2 is divisible is divisible by 9.” by 9.” Although the argument is Although the argument is valid valid, its conclusion is , its conclusion is incorrect incorrect, because one of the hypotheses is false , because one of the hypotheses is false (“101 is divisible by 3.”). (“101 is divisible by 3.”). If in the above argument we replace 101 with 102, If in the above argument we replace 101 with 102, we could correctly conclude that 102 we could correctly conclude that 1022 2 is divisible is divisible by 9. by 9.
  • 54. Spring 2003 CMSC 203 - Discrete Structures 54 Arguments Arguments Which rule of inference was used in the last Which rule of inference was used in the last argument? argument? p: “101 is divisible by 3.” p: “101 is divisible by 3.” q: “101 q: “1012 2 is divisible by 9.” is divisible by 9.” p p p p   q q _____ _____   q q Modus Modus ponens ponens Unfortunately, one of the hypotheses (p) is false. Unfortunately, one of the hypotheses (p) is false. Therefore, the conclusion q is incorrect. Therefore, the conclusion q is incorrect.
  • 55. Spring 2003 CMSC 203 - Discrete Structures 55 Arguments Arguments Another example: Another example: “ “If it rains today, then we will not have a barbeque If it rains today, then we will not have a barbeque today. If we do not have a barbeque today, then today. If we do not have a barbeque today, then we will have a barbeque tomorrow. we will have a barbeque tomorrow. Therefore, if it rains today, then we will have a Therefore, if it rains today, then we will have a barbeque tomorrow.” barbeque tomorrow.” This is a This is a valid valid argument: If its hypotheses are argument: If its hypotheses are true, then its conclusion is also true. true, then its conclusion is also true.
  • 56. Spring 2003 CMSC 203 - Discrete Structures 56 Arguments Arguments Let us formalize the previous argument: Let us formalize the previous argument: p: “It is raining today.” p: “It is raining today.” q: “We will not have a barbecue today.” q: “We will not have a barbecue today.” r: “We will have a barbecue tomorrow.” r: “We will have a barbecue tomorrow.” So the argument is of the following form: So the argument is of the following form: p p   q q q q   r r ______ ______   P P   r r Hypothetical Hypothetical syllogism syllogism
  • 57. Spring 2003 CMSC 203 - Discrete Structures 57 Arguments Arguments Another example: Another example: Gary is either intelligent or a good actor. Gary is either intelligent or a good actor. If Gary is intelligent, then he can count If Gary is intelligent, then he can count from 1 to 10. from 1 to 10. Gary can only count from 1 to 3. Gary can only count from 1 to 3. Therefore, Gary is a good actor. Therefore, Gary is a good actor. i: “Gary is intelligent.” i: “Gary is intelligent.” a: “Gary is a good actor.” a: “Gary is a good actor.” c: “Gary can count from 1 to 10.” c: “Gary can count from 1 to 10.”
  • 58. Spring 2003 CMSC 203 - Discrete Structures 58 Arguments Arguments i: “Gary is intelligent.” i: “Gary is intelligent.” a: “Gary is a good actor.” a: “Gary is a good actor.” c: “Gary can count from 1 to 10.” c: “Gary can count from 1 to 10.” Step 1: Step 1:   c c Hypothesis Hypothesis Step 2: Step 2: i i   c c Hypothesis Hypothesis Step 3: Step 3:   i i Modus tollens Steps 1 & 2 Modus tollens Steps 1 & 2 Step 4: Step 4: a a   i i Hypothesis Hypothesis Step 5: Step 5: a a Disjunctive Syllogism Disjunctive Syllogism Steps 3 & 4 Steps 3 & 4 Conclusion: Conclusion: a a (“Gary is a good actor.”) (“Gary is a good actor.”)
  • 59. Spring 2003 CMSC 203 - Discrete Structures 59 Arguments Arguments Yet another example: Yet another example: If you listen to me, you will pass CS 320. If you listen to me, you will pass CS 320. You passed CS 320. You passed CS 320. Therefore, you have listened to me. Therefore, you have listened to me. Is this argument valid? Is this argument valid? No No, it assumes ((p , it assumes ((p   q) q)  q) q)   p. p. This statement is not a tautology. It is This statement is not a tautology. It is false false if p is if p is false and q is true. false and q is true.
  • 60. Spring 2003 CMSC 203 - Discrete Structures 60 Rules of Inference for Quantified Statements Rules of Inference for Quantified Statements  x P(x) x P(x) __________ __________   P(c) if c P(c) if c U U Universal Universal instantiation instantiation P(c) for an arbitrary c P(c) for an arbitrary c U U ___________________ ___________________    x P(x) x P(x) Universal Universal generalization generalization  x P(x) x P(x) ______________________ ______________________   P(c) for some element c P(c) for some element c U U Existential Existential instantiation instantiation P(c) for some element c P(c) for some element c U U ____________________ ____________________    x P(x) x P(x) Existential Existential generalization generalization
  • 61. Spring 2003 CMSC 203 - Discrete Structures 61 Rules of Inference for Quantified Statements Rules of Inference for Quantified Statements Example: Example: Every UMB student is a genius. Every UMB student is a genius. George is a UMB student. George is a UMB student. Therefore, George is a genius. Therefore, George is a genius. U(x): “x is a UMB student.” U(x): “x is a UMB student.” G(x): “x is a genius.” G(x): “x is a genius.”
  • 62. Spring 2003 CMSC 203 - Discrete Structures 62 Rules of Inference for Quantified Statements Rules of Inference for Quantified Statements The following steps are used in the argument: The following steps are used in the argument: Step 1: Step 1:  x (U(x) x (U(x)   G(x)) G(x)) Hypothesis Hypothesis Step 2: Step 2: U(George) U(George)   G(George) G(George) Univ. instantiation Univ. instantiation using Step 1 using Step 1  x P(x) x P(x) __________ __________   P(c) if c P(c) if c U U Universal Universal instantiation instantiation Step 3: Step 3: U(George) U(George) Hypothesis Hypothesis Step 4: Step 4: G(George) G(George) Modus ponens Modus ponens using Steps 2 & 3 using Steps 2 & 3
  • 63. Spring 2003 CMSC 203 - Discrete Structures 63 Proving Theorems Proving Theorems Direct proof: Direct proof: An implication p An implication p   q can be proved by showing that q can be proved by showing that if p is true, then q is also true. if p is true, then q is also true. Example: Example: Give a direct proof of the theorem Give a direct proof of the theorem “If n is odd, then n “If n is odd, then n2 2 is odd.” is odd.” Idea: Idea: Assume that the hypothesis of this Assume that the hypothesis of this implication is true (n is odd). Then use rules of implication is true (n is odd). Then use rules of inference and known theorems of math to show inference and known theorems of math to show that q must also be true (n that q must also be true (n2 2 is odd). is odd).
  • 64. Spring 2003 CMSC 203 - Discrete Structures 64 Proving Theorems Proving Theorems n is odd. n is odd. Then n = 2k + 1, where k is an integer. Then n = 2k + 1, where k is an integer. Consequently, n Consequently, n2 2 = (2k + 1) = (2k + 1)2 2 . . = 4k = 4k2 2 + 4k + 1 + 4k + 1 = 2(2k = 2(2k2 2 + 2k) + 1 + 2k) + 1 Since n Since n2 2 can be written in this form, it is odd. can be written in this form, it is odd.
  • 65. Spring 2003 CMSC 203 - Discrete Structures 65 Proving Theorems Proving Theorems Indirect proof: Indirect proof: An implication p An implication p   q is equivalent to its q is equivalent to its contra- contra- positive positive  q q    p. Therefore, we can prove p p. Therefore, we can prove p   q q by showing that whenever q is false, then p is also by showing that whenever q is false, then p is also false. false. Example: Example: Give an indirect proof of the theorem Give an indirect proof of the theorem “If 3n + 2 is odd, then n is odd.” “If 3n + 2 is odd, then n is odd.” Idea: Idea: Assume that the conclusion of this Assume that the conclusion of this implication is false (n is even). Then use rules of implication is false (n is even). Then use rules of inference and known theorems to show that p inference and known theorems to show that p must also be false (3n + 2 is even). must also be false (3n + 2 is even).
  • 66. Spring 2003 CMSC 203 - Discrete Structures 66 Proving Theorems Proving Theorems n is even. n is even. Then n = 2k, where k is an integer. Then n = 2k, where k is an integer. It follows that 3n + 2 = 3(2k) + 2 It follows that 3n + 2 = 3(2k) + 2 = 6k + 2 = 6k + 2 = 2(3k + 1) = 2(3k + 1) Therefore, 3n + 2 is even. Therefore, 3n + 2 is even. We have shown that the contrapositive of the We have shown that the contrapositive of the implication is true, so the implication itself is also implication is true, so the implication itself is also true true (If 3n + 2 is odd, then n is odd). (If 3n + 2 is odd, then n is odd).
  • 67. Spring 2003 CMSC 203 - Discrete Structures 67 Proving Theorems Proving Theorems Indirect Proof is a special case of Indirect Proof is a special case of proof by proof by contradiction contradiction Suppose n is even ( Suppose n is even (negation of the conclusion negation of the conclusion). ). Then n = 2k, where k is an integer. Then n = 2k, where k is an integer. It follows that 3n + 2 = 3(2k) + 2 It follows that 3n + 2 = 3(2k) + 2 = 6k + 2 = 6k + 2 = 2(3k + 1) = 2(3k + 1) Therefore, 3n + 2 is even. Therefore, 3n + 2 is even. However, this is a However, this is a contradiction contradiction since 3n + 2 is given since 3n + 2 is given to be odd, so the conclusion (n is odd) holds. to be odd, so the conclusion (n is odd) holds.
  • 68. Spring 2003 CMSC 203 - Discrete Structures 68 Another Example on Proof Another Example on Proof Anyone performs well is either intelligent or a Anyone performs well is either intelligent or a good actor. good actor. If someone is intelligent, then he/she can count If someone is intelligent, then he/she can count from 1 to 10. from 1 to 10. Gary performs well. Gary performs well. Gary can only count from 1 to 3. Gary can only count from 1 to 3. Therefore, not everyone is both intelligent and a Therefore, not everyone is both intelligent and a good actor good actor P(x): x performs well P(x): x performs well I(x): x is intelligent I(x): x is intelligent A(x): x is a good actor A(x): x is a good actor C(x): x can count from 1 to 10 C(x): x can count from 1 to 10
  • 69. Spring 2003 CMSC 203 - Discrete Structures 69 Another Example on Proof Another Example on Proof Hypotheses: Hypotheses: 1. 1. Anyone performs well is either intelligent or a good Anyone performs well is either intelligent or a good actor. actor.  x (P(x) x (P(x)   I(x) I(x)   A(x)) A(x)) 2. 2. If someone is intelligent, then he/she can count If someone is intelligent, then he/she can count from 1 to 10. from 1 to 10.  x (I(x) x (I(x)   C C(x) ) (x) ) 3. 3. Gary performs well. Gary performs well. P(G) P(G) 4. 4. Gary can only count from 1 to 3. Gary can only count from 1 to 3.  C(G) C(G) Conclusion: not everyone is both intelligent and a good Conclusion: not everyone is both intelligent and a good actor actor  x(I(x) x(I(x)   A(x)) A(x))
  • 70. Spring 2003 CMSC 203 - Discrete Structures 70 Another Example on Proof Another Example on Proof Direct proof: Direct proof: Step 1: Step 1:  x (P(x) x (P(x)   I(x) I(x)   A(x)) A(x)) Hypothesis Hypothesis Step 2: Step 2: P(G) P(G)   I(G) I(G)   A(G) A(G) Univ. Inst. Step 1 Univ. Inst. Step 1 Step 3: Step 3: P(G) P(G) Hypothesis Hypothesis Step 4: Step 4: I(G) I(G)   A(G) A(G) Modus ponens Steps 2 & 3 Modus ponens Steps 2 & 3 Step 5: Step 5:  x (I(x) x (I(x)   C(x)) C(x)) Hypothesis Hypothesis Step 6: Step 6: I(G) I(G)   C(G) C(G) Univ. inst. Step5 Univ. inst. Step5 Step 7: Step 7:  C(G) C(G) Hypothesis Hypothesis Step 8: Step 8:  I(G) I(G) Modus tollens Steps 6 & 7 Modus tollens Steps 6 & 7 Step 9: Step 9:  I(G) I(G)    A(G) A(G) Addition Step 8 Addition Step 8 Step 10: Step 10:  (I(G) (I(G)   A(G)) A(G)) Equivalence Step 9 Equivalence Step 9 Step 11: Step 11:  x x (I(x) (I(x)   A(x)) A(x)) Exist. general. Step 10 Exist. general. Step 10 Step 12: Step 12:  x (I(x) x (I(x)   A(x)) A(x)) Equivalence Step 11 Equivalence Step 11 Conclusion: Conclusion:  x (I(x) x (I(x)   A(x)) A(x)), not everyone is both intelligent and , not everyone is both intelligent and a good actor. a good actor.
  • 71. Spring 2003 CMSC 203 - Discrete Structures 71 Summary, Section 1.5 Summary, Section 1.5 • Terminology (axiom, theorem, conjecture, Terminology (axiom, theorem, conjecture, argument, etc.) argument, etc.) • Rules of inference (Tables 1 and 2) Rules of inference (Tables 1 and 2) • Valid argument (hypotheses and conclusion) Valid argument (hypotheses and conclusion) • Construction of valid argument using rules of Construction of valid argument using rules of inference inference – For each rule used, write down and the statements For each rule used, write down and the statements involved in the proof involved in the proof • Direct and indirect proofs Direct and indirect proofs – Other proof methods (e.g., induction, pigeon hole) Other proof methods (e.g., induction, pigeon hole) will be introduced in later chapters will be introduced in later chapters