Professional Documents
Culture Documents
1. Propositional Logic
HY ATHEMATICS IS MAZING !
Mathematics is a form of Art. The masterpieces of math are elegant arguments (proofs)
that tell us some fragment of truth.
Unlike other sciences where results are most often obtained from experimental data and
observation, mathematical results are “discovered” when someone is able to prove that
something must be true.
For a proof to be correct, the underlying steps must be a valid logical argument and the
language we use must be well-defined and exact.
It is useful to know when something is true! Many scientific results are based on
underlying mathematical models ! physics, chemistry, biology, engineering...
In this course, we will study D ISCRETE M ATH — the part of mathematics devoted to the
study of “discrete” objects (consisting of distinct “whole” parts or unconnected
elements).
Ex. DNA/RNA sequences fundamental building blocks of living things tRNA)
=
RNA e±
-
AGCAUCGCAUCGA
translation
-
.
From DNA tRNA to building proteins from amino acids encoded by 3- letter
"
Words
"
called coda
Logic itself is especially important in Computer Science; the language of computers is
Boolean algebra. Using logic, we are able to translate our intentions so that a machine
made of electrical circuits does our bidding.
A proposition is a declarative sentence that is either true or false but not both.
If a proposition is true, then its truth value is TRUE, denoted T.
If a proposition is false, then its truth value is FALSE, denoted F.
Example 1.1. For each of the following sentences, determine whether or not it is a proposition.
If it is a proposition, what is its truth value? If it is not a proposition, explain.
(a) Ottawa is the capital of Canada. ← a
proposition @ Its T .
(b) 1 + 2 = 3. ← a
proposition @ Its T .
(c) 2 + 2 = 3. ← a
proposition @ Its F
what xis
(d) 1 + x = 3. ←
proposition
a
not unless we Know .
"
Truth table:
the Itisnotlhecasethatp
"
is proposition .
P 7p
T F
• Thetrulhvalueoftipistheoppositofthetrulh
F T
valueofp .
por
Truth table:
porq
proposition
"
read the
"
pandq
PVQ
is
,
"
TT T
Pandq
"
pvqist
dismay
T F
theodora
F
•
ptqistwhenbothpandqaret
F
; otherwise ,
FT
F F
F
F
Ptqis
pvqistwhenbothpandqaret
porqbutnotboth
Disjunction. Let p and q be propositions.
• The , denoted ,
Truth table:
proposition
"
read the
" "
is "
, q
TT T
•
; otherwise ,
pqpnq
T F T
pqpotq
PQPVQ
FT
FF T
F
islhelndunsveerieandfor
" " " "
⇒ or
.
pxorq
•
,
proposition
"
read the
"
is
,
Truth Table:
theex_uveorofpandq.de#dpotq
potqistwhenexactlyoneofpandqistand " "
TT F
T F T
Ft
FF
•
T
theolherisf ;
otherwise ,P0qisF .
F
3
Conditional Statement / Implication. Let p and q be propositions.
the_ondhohaaemn.li
"
•
fpsthenq isdenotedpsq ,
pqp→q
,
" "
read
" "
is the
proposition IFP then
pimpliesq ,
,
q .
gp→q
Pisthepremise Tqisthecondn
Truth Table:
•
psoqislikeapromiseorbargain .
Ifpistthen
qispromisedobettheonlywayapromiseisbrokeh TT T
iswhlnpistbutqist .
T F F
F T T
[F→( anything )]isT
Note : F F T
.
[ (anything )→T]isT .
PqP→q
_icondhonaatemn
The
pifandonlyifq
• " "
Truth Table:
denoted
is read
pifandonlyifq
" "
Peg , .
T T T
T F F
Peoqistwhenpandqhavethesame
•
T
p<→qisF .
T RUTH TABLES
always
tf
• truth Values Tsandfscnotosts )
"
{ ¥¥
?
T T T F
FEF
• Eachatomhasitsowncolumn
oooforrightmostatom PFAFF
.
£
°
" " : F T T
F
's column We
T
alternate
F
,
...
T ¥
,F,T,F ,
... column .
: ;
fromtoptoboltomof
Movingonecdumntotheleftthehextatom 's
•
9
alternates teak qq.gg
Column alternates twiaasmanytsandtwice
alternates alternates ,
2k "
TS 4Ts,4Fs ZTS ,2Fs ...
asmanyfsasthecolumnonits
...
4
Example 1.2. Write a truth table for each of the following compound propositions:
a. (p ! q) $ (¬p _ q)
b. (p q) ! ¬q
c. (p ! q) ^ (q ! p)
d. ¬(¬p _ q)
e. (p ^ ¬p) $ (p _ ¬p)
f. q $ (p $ r)
a) Tpvq ( p→q)←Gpvq )
T T T T T
T F F F T
F T T T T
F F T T T
7q ( P0q)→7q
T T F F T
T F T T T
F T T F F
F F F T T
PQPQQ
Pq7P7pVq
P→q )
pqP→q
c ) pq q→p
(p→q)^(q→p
T T T T T
d)
b)
T F F T F
F T T F F
F F T T T
TGPVQ )
T T F T F
T F F F T
F T T T F
F F T T F
5
ft per ( )
p q r
of a
per
T T T T T
T T F F F
T F T T F
T F F F T
F T T F F
F T F T T
F F T F T
F F F T F
• A compound proposition that is always true (in all rows of its truth table) is called a
tautology.
• A compound proposition that is always false (in all rows if its truth table) is called a
contradiction.
• A compound proposition that is neither a tautology nor a contradiction is called a
contingency.
Example 1.3. For each compound proposition given in Example 1.2, determine whether it is a
tautology, contradiction, or contingency.
g)
tautology
a) ( p
Gpvq ) always T
→ a is :O
b) ( Po
g) →
7q
is sometimes T
,
sometimes F %
contingency
always
c) ( p ) sometimes T sometimes F
→
of )^(q→p is ,
%
contingency
d) TGPVQ ) is sometimes T
,
sometimes F %
contingency
f) of ←
( par ) is sometimes T
,
sometimes F %
contingency
S TUDY G UIDE