Professional Documents
Culture Documents
my
http://fskik.upsi.edu.my
Logic
Crucial for mathematical reasoning
Important for program design
Used for designing electronic circuitry
(Propositional )Logic is a system based on
propositions.
A proposition is a (declarative) statement that is
either true or false (not both).
We say that the truth value of a proposition is
either true (T) or false (F).
Corresponds to 1 and 0 in digital circuits
http://fskik.upsi.edu.my
The Statement/Proposition
Game
yes
Is this a proposition?
yes
true
http://fskik.upsi.edu.my
The Statement/Proposition
Game
520 < 111
Is this a statement?
yes
Is this a proposition?
yes
false
http://fskik.upsi.edu.my
The Statement/Proposition
Game
y > 5
Is this a statement?
yes
Is this a proposition?
no
http://fskik.upsi.edu.my
The Statement/Proposition
Game
yes
Is this a proposition?
yes
false
http://fskik.upsi.edu.my
The Statement/Proposition
Game
Please do not fall asleep.
Is this a statement?
no
Its a request.
Is this a proposition?
Only statements can be
propositions.
no
http://fskik.upsi.edu.my
The Statement/Proposition
Game
yes
Is this a proposition?
yes
probably false
http://fskik.upsi.edu.my
The Statement/Proposition
Game
x < y if and only if y > x.
Is this a statement?
yes
Is this a proposition?
yes
because its truth value
does not depend on
specific values of x and y.
What is the truth value
of the proposition?
true
http://fskik.upsi.edu.my
Combining Propositions
As we have seen in the previous
examples, one or more propositions can
be combined to form a single compound
proposition.
We formalize this by denoting
propositions with letters such as p, q, r,
s, and introducing several logical
operators.
Logical Operators
(Connectives)
http://fskik.upsi.edu.my
Negation
(NOT)
Conjunction (AND)
Disjunction (OR)
Exclusive or (XOR)
Implication
(if then)
Biconditional
(if and only if)
http://fskik.upsi.edu.my
Negation (NOT)
Unary Operator, Symbol:
p
true
false
false
true
http://fskik.upsi.edu.my
Conjunction (AND)
Binary Operator, Symbol:
p
p q
true
true
true
true
false
false
false
true
false
false
false
false
http://fskik.upsi.edu.my
Disjunction (OR)
Binary Operator, Symbol:
p
p q
true
true
true
true
false
true
false
true
true
false
false
false
http://fskik.upsi.edu.my
Exclusive Or (XOR)
Binary Operator, Symbol:
p
p q
true
true
false
true
false
true
false
true
true
false
false
false
http://fskik.upsi.edu.my
p q
true
true
true
true
false
false
false
true
true
false
false
true
http://fskik.upsi.edu.my
1. A conditional
_________________ is a statement
statement
if- in
that
can be expressed
then
________form.
2. A conditional statementtwo
hasparts
hypothesi
if
_________
.
s
The __________
____ part.
conclusio is the
then
The __________
is the
n
______ part.
http://fskik.upsi.edu.my
Conditional Statement
If p, then q
If p, q
p is sufficient for q
q if p
An necessary
condition for p is q
p implies q
p only if q
A sufficient
condition for q
is p
q whenever p
q is necessary
for p
q follows from p
http://fskik.upsi.edu.my
Example :
p : Maria learns Discrete Structures
q : Maria will find a good job. Express
the statement p
q.
http://fskik.upsi.edu.my
Converse, Contrapositive
and Inverse
To fully analyze this conditional
statement, we need to find three new
conditionals:
Converse
Inverse
Contrapositive
http://fskik.upsi.edu.my
Converse
The converse
________ of a conditional
statement is formed by switching the
hypothesis and the conclusion.
Example:
(Conditional) If I am sleeping, then I am
breathing.
(Converse)
am
If I am breathing, then I
sleeping.
http://fskik.upsi.edu.my
Inverse
The ________
inverse of a conditional
statement is formed by negating
(inserting not) the hypothesis and
the conclusion.
(Conditional)
Example:
If I am sleeping, then I am
breathing.
(Converse)
then
If I am not sleeping,
I am not breathing.
http://fskik.upsi.edu.my
Contrapositive
The contrapositive
______________ of a conditional
statement is formed by negating the
hypothesis and the conclusion of the
converse.
Example:
(Converse)
If I am breathing, then I
am
sleeping.
(Contrapositive)
then I
If I am not breathing,
am not sleeping.
http://fskik.upsi.edu.my
Conditional
( p q)
Inverse
p -> q
If I am sleeping, then I
am breathing.
If I am not sleeping, then
I am not breathing.
Converse
q->p
If I am breathing, then I am
sleeping.
http://fskik.upsi.edu.my
http://fskik.upsi.edu.my
Conditional
Inverse
(insert not)
Converse
(switch)
Contrapositive
(switch then
insert not)
Practice :
http://fskik.upsi.edu.my
Conclusion
The conditional statement and its
contrapositive have the same truth
value.
They are both true.
They are logically equivalent.
http://fskik.upsi.edu.my
A. hypothesis
B. Conclusion
C. neither
http://fskik.upsi.edu.my
http://fskik.upsi.edu.my
http://fskik.upsi.edu.my
http://fskik.upsi.edu.my
P Q
true
true
true
true
false
false
false
true
false
false
false
true
http://fskik.upsi.edu.my
P
true
Q (P)(Q)
false
true
false true
true
true false
true
true
http://fskik.upsi.edu.my
Statements and
Operations
true
true
PQ (PQ) (P)(Q)
true
false
false
true
true
true
true
true
true
http://fskik.upsi.edu.my
Equivalent Statements
P
true
true false
false
true
true
true
false true
true
true
true
true
true