Formal Name NicknameArity Symbol
Negation operator NOT Unary ÂŽ, ~
Conjunction operator AND Binary â§
Disjunction operator OR Binary âĻ
Exclusive-OR operator XOR Binary â
Implication operator IMPLIES Binary â
Biconditional operator IFF Binary â
10
11.
Negation operator âÂŽâ(NOT) āđāļāļĨāļāļāļĢāļ°āļāļāļāđāđāļāđ
āđāļŦāđāđāļāđāļāļāļīāđāļŠāļāļāļāļāļāļĢāļ°āļāļāļāđāļāļąāđāļ
āđāļāđāļ āđāļŦāđ p = âāļāļąāļāļĄāļĩāļāļĄāļŠāļĩāļāļģāđāļēāļāļēāļĨâ
āļāļąāļāļāļąāđāļ ÂŽp = âāļāļąāļāđāļĄāđāļĄāļĩāļāļĄāļŠāļĩāļāļģāđāļēāļāļēāļĨâ
āļāļēāļĢāļēāļāļāđāļēāļāļ§āļēāļĄāļāļĢāļīāļ(truth table) āļāļāļ NOT:
11
p ÂŽp
T F
F T
T :⥠True; F :⥠False
â:âĄâ āļŦāļĄāļēāļĒāļāļķāļ âāļāļđāļāļāļīāļĒāļēāļĄāđāļāļâ
āļāļāļĨāļąāļĄāļāđāļāļąāļ§āļāļđāļāļāļģāļēāđāļāļīāļāļāļēāļĢāļāļāļĨāļąāļĄāļāđāļāļĨāļĨāļąāļāļāđ
ï āļŠāļąāļāđāļāļāļ§āđāļē pâĻqāļŦāļĄāļēāļĒāļāļķāļ
p āđāļāđāļāļāļĢāļīāļ āļŦāļĢāļ·āļ q āđāļāđāļāļāļĢāļīāļ,
āļŦāļĢāļ·āļāļāļąāđāļ p āđāļĨāļ° q āđāļāđāļāļāļĢāļīāļ
ï Disjunction operator ââĻâ
āļāļēāļāđāļĢāļĩāļĒāļāļāļĩāļāļāļĒāđāļēāļāļ§āđāļē inclusive or
āđāļāļĢāļēāļ°āļāļĢāļ°āļāļāļāđāļāļ°āļĄāļĩāļāđāļēāđāļāđāļāļāļĢāļīāļ
āđāļāļāļĢāļāļĩāļāļĩāđāļāļąāđāļ p āđāļĨāļ° q āđāļāđāļāļāļĢāļīāļāļāļąāđāļāļāļđāđ
15
p q pâĻ q
F F F
F T T
T F T
T T T
āļŠāļąāļāđāļāļāļŠāđāļ§āļāļāļĩāđ
āđāļāļāļāđāļēāļāļāļēāļ
AND
āđāļŦāđ p =âāđāļĄāļ·āđāļāļāļ·āļāļāļĩāđāļāļāļāļâ
q = âāļĄāļĩāļŦāļĄāļāļāļĨāļāđāļĄāļ·āđāļāđāļāđāļēāļ§āļąāļāļāļĩāđâ
r = âāđāļāđāļēāļ§āļąāļāļāļĩāđāļŠāļāļēāļĄāļŦāļāđāļēāđāļāļĩāļĒāļâ
āļāļāđāļāļĨāļāļīāļāļāļāđāļāđāļāđāļāļāļĩāđ:
ÂŽp =
r â§ ÂŽp =
ÂŽ r âĻ p âĻ q =
17
âāđāļĄāļ·āđāļāļāļ·āļāļāļāđāļĄāđāļāļâ
âāđāļāđāļēāļ§āļąāļāļāļĩāđāļŠāļāļēāļĄāļŦāļāđāļēāđāļāļĩāļĒāļ āđāļĨāļ°āđāļĄāļ·āđāļ
āļāļ·āļāļāļĩāđāļāļāđāļĄāđāļāļâ
âāđāļĄāļ·āđāļāđāļāđāļēāļ§āļąāļāļāļĩāđāļŠāļāļēāļĄāļŦāļāđāļēāđāļĄāđāđāļāļĩāļĒāļ
āļŦāļĢāļ·āļ āđāļĄāļ·āđāļāļāļ·āļāļāļĩāđāļāļāļāļ āļŦāļĢāļ·āļ āļĄāļĩāļŦāļĄāļāļ
āļĨāļāđāļĄāļ·āđāļāđāļāđāļēāļāļĩāđâ
18.
Exclusive-or operator âââ(XOR) āļĢāļ§āļĄāļāļĢāļ°āļāļāļāđ 2
āļāļĢāļ°āļāļāļāđāđāļāđāļēāļāđāļ§āļĒāļāļąāļāđāļāļ âexclusive orâ
p = âāļāļąāļāļāļ°āđāļāđāđāļāļĢāļ A āļ§āļīāļāļēāļāļĩāđâ
q = âāļāļąāļāļāļ°āđāļāđāđāļāļĢāļ B āļ§āļīāļāļēāļāļĩāđâ
p â q = âāļāļąāļāļāļ°āđāļāđāđāļāļĢāļ A āļ§āļīāļāļēāļāļĩāđ āļŦāļĢāļ·āļ āļāļąāļāļāļ°āđāļāđāđāļāļĢāļ
B āļ§āļīāļāļēāļāļĩāđ(āđāļāđāđāļĄāđāļŠāļēāļĄāļēāļĢāļāđāļāđāđāļāļĢāļāļāļąāđāļāļŠāļāļāļāļĢāđāļāļĄāļāļąāļ)â
18
19.
ï āļŠāļąāļāđāļāļāļ§āđāļē pâqāļŦāļĄāļēāļĒāļāļķāļ
p āđāļāđāļāļāļĢāļīāļ āļŦāļĢāļ·āļ q āđāļāđāļāļāļĢāļīāļ
āđāļāđāļāđāļāļāđāļĄāđāđāļāđāļāļāļĢāļīāļāļāļąāđāļāļāļđāđ
āļāļķāļāļāļēāļāđāļāļĩāļĒāļāđāļāđāļ§āđāļē
(p âĻ q) â§ ÂŽ(p â§ q)
ï āļāļēāļĢāļāļģāļēāđāļāļīāļāļāļēāļĢāļāļĩāđāđāļĢāļĩāļĒāļāļ§āđāļē exclusive or
āđāļāļĢāļēāļ°āļāļĢāļ°āļāļāļāđāļāļ°āļĄāļĩāļāđāļēāđāļāđāļāđāļāđāļ āđāļāļāļĢāļāļĩāļāļĩāđāļāļąāđāļ p āđāļĨāļ° q
āđāļāđāļāļāļĢāļīāļāļāļąāđāļāļāļđāđ
19
p q pâ q
F F F
F T T
T F T
T T F āļŠāļąāļāđāļāļ
āļŠāđāļ§āļāļāļĩāđ
āđāļāļāļāđāļēāļ
āļāļēāļ
OR
20.
Implication p âq āļŦāļĄāļēāļĒāļāļ§āļēāļĄāļ§āđāļē âāļāđāļē p āđāļĨāđāļ§ qâ
āļāļ·āļ āļāđāļē p āđāļāđāļāļāļĢāļīāļ āđāļĨāđāļ§ q āđāļāđāļāļāļĢāļīāļ āđāļāđ āļāđāļē p āđāļĄāđāđāļāđāļāļāļĢāļīāļ āđāļĨāđāļ§ q āļāļēāļ
āđāļāđāļāļāļĢāļīāļāļŦāļĢāļ·āļāđāļāđāļāđāļāđāļāļāđāđāļāđ
āđāļāđāļ āđāļŦāđ p = âāļāļļāļāļāļĒāļąāļāđāļĢāļĩāļĒāļâ
q = âāļāļļāļāļāļ°āđāļāđāđāļāļĢāļāļāļĩāđāļāļĩâ
p â q = âāļāđāļē āļāļļāļāļāļĒāļąāļāđāļĢāļĩāļĒāļ āđāļĨāđāļ§ āļāļļāļāļāļ°āđāļāđāđāļāļĢāļāļāļĩāđāļāļĩâ (āđāļāđāļāđāļē
āđāļĄāđāļāļĒāļąāļāđāļĢāļĩāļĒāļ āļāđāļāļēāļāđāļāđāđāļāļĢāļāļāļĩāđāļāļĩāļŦāļĢāļ·āļāđāļāļĢāļāļāļĩāđāđāļĄāđāļāļĩāļāđāđāļāđ)
āļāļĢāļ°āļāļāļāđ pâq āļĄāļĩāļāđāļēāđāļāđāļāđāļāđāļ āđāļĄāļ·āđāļāļāļĢāļ°āļāļāļāđ âāļāļļāļāļāļĒāļąāļāđāļĢāļĩāļĒāļâ
āđāļāđāļāļāļĢāļīāļ āđāļĨāļ°āļāļĢāļ°āļāļāļāđ âāļāļļāļāļāļ°āđāļāđāđāļāļĢāļāļāļĩāđāļāļĩâ āđāļāđāļāđāļāđāļ
āļāļĢāļāļĩāļāļ·āđāļāđāļāļāļāđāļŦāļāļ·āļāļāļēāļāļāļĩāđāļāļĢāļ°āļāļāļāđ pâq āļĄāļĩāļāđāļēāđāļāđāļāļāļĢāļīāļ
20
āđāļŦāļāļļ
(antecedent)
āļāļĨ
(consequent)
21.
ï āļĢāļđāļāđāļāļāļāļāļ implicationāļāļĩāđāļŠāļĄāļāļąāļĒāļāļąāļ(Equivalent) :
ïĄIf P, then Q
ïĄP implies Q
ïĄIf P, Q
ïĄP is a sufficient condition for Q
ïĄQ if P
ïĄQ whenever P
ïĄQ is a necessary condition for P
ï Terminology:
ïĄP = premise, hypothesis, antecedent
ïĄQ = conclusion, consequence
21
22.
ï p âq āđāļāđāļāđāļāđāļ āđāļāļāļēāļ°āđāļĄāļ·āđāļ
p āđāļāđāļāļāļĢāļīāļ āđāļāđ q āđāļāđāļāđāļāđāļ
ï āļāļĢāļ°āļāļāļāđ p â q āđāļāđāļāļāļĢāļīāļ
āđāļāļĒāđāļĄāđāļāļģāļēāđāļāđāļāļ§āđāļē p āļŦāļĢāļ·āļ q
āļāļ°āļāđāļāļāđāļāđāļāļāļĢāļīāļāļāļąāđāļāļāļđāđ
āđāļāđāļ
ï â(1=0) â āļŦāļĄāļđāļāļīāļāđāļāđâ āđāļāđāļāļāļĢāļīāļ
22
p q pâq
F F T
F T T
T F F
T T T
āđāļāđāļ
False
āđāļāļĩāļĒāļ
āļāļĢāļāļĩāđāļāļĩāļĒāļ§
āļāļēāļĢāļāļīāļŠāļđāļāļāđāļāļēāļĢāļŠāļĄāļĄāļđāļĨāļāļāļ p âq āļāļąāļāļāđāļāļāļ§āļēāļĄāđāļĒāđāļāļŠāļĨāļąāļ
āļāļĩāđ(contrapositive) āđāļāļĒāđāļāđāļāļēāļĢāļēāļāļāđāļēāļāļ§āļēāļĄāļāļĢāļīāļ :
25
p q ÂŽq ÂŽp pâq ÂŽq âÂŽp
F F T T T T
F T F T T T
T F T F F F
T T F F T T
26.
Biconditional p âq āđāļŠāļāļāļ§āđāļē p āđāļāđāļāļāļĢāļīāļ āļāđāļāđāļ
āđāļĄāļ·āđāļ (if and only if --IFF) q āđāļāđāļāļāļĢāļīāļ
p = âBush āļāļāļ°āļāļēāļĢāđāļĨāļ·āļāļāļāļąāđāļāļāļĩ 2004â
q = âBush āļāļ°āđāļāđāļāļāļĢāļ°āļāļēāļāļēāļāļīāļāļāļĩāđāļāļāļĩ 2005â
p â q = âBush āļāļāļ°āļāļēāļĢāđāļĨāļ·āļāļāļāļąāđāļāļāļĩ 2004 āļāđāļāđāļ
āđāļĄāļ·āđāļ Bush āļāļ°āđāļāđāļāļāļĢāļ°āļāļēāļāļēāļāļīāļāļāļĩāđāļāļāļĩ 2005 â
26
27.
ï p âq āļĄāļĩāļāđāļēāļāļ§āļēāļĄāļāļĢāļīāļāđāļāđāļāļāļĢāļīāļ
āđāļĄāļ·āđāļ p āđāļĨāļ° q āļĄāļĩāļāđāļēāļāļ§āļēāļĄāļāļĢāļīāļ
āđāļŦāļĄāļ·āļāļāļāļąāļ(āđāļāđāļāļāļąāđāļāļāļđāđ āļŦāļĢāļ·āļ āļāļĢāļīāļāļāļąāđāļāļāļđāđ)
ï āļŠāļąāļāđāļāļāļ§āđāļēāļāļēāļĢāļēāļāļāđāļēāļāļ§āļēāļĄāļāļĢāļīāļāļāļĩāđ
āļāļĢāļāļāđāļēāļĄāļāļąāļāļāļēāļĢāļēāļāļāđāļēāļāļ§āļēāļĄāļāļĢāļīāļāļāļāļ ï
āļāļąāļāļāļąāđāļ p â q āļŠāļĄāļĄāļđāļĨāļāļąāļ ÂŽ(p â q)
27
p q p â q
F F T
F T F
T F F
T T T
28.
28
p q ÂŽppâ§q pâĻq pâq pâq pâq
F F T F F F T T
F T T F T T T F
T F F F T T F F
T T F T T F T T
āļāļąāļ§āļāļĒāđāļēāļ āļāļāļāļīāļŠāļđāļāļāđāļ§āđāļē pâĻqâ ÂŽ(ÂŽp â§ ÂŽq)
pâĻq āļĄāļĩāļāđāļēāļāļ§āļēāļĄāļāļĢāļīāļāđāļŦāļĄāļ·āļāļāļāļąāļāđāļāļāļļāļāđāđāļāļ§āļāļąāļ ï (ÂŽp â§
ÂŽq) āļāļąāļāļāļąāđāļ pâĻq āļŠāļĄāļĄāļđāļĨāļāļąāļ ï (ÂŽp â§ ÂŽq)
44
p q ppâĻâĻqq ÂŽÂŽpp ÂŽÂŽqq ÂŽÂŽpp â§â§ÂŽÂŽqq ÂŽÂŽ((ÂŽÂŽpp â§â§ÂŽÂŽqq))
F F
F T
T F
T T
F
T
T
T
T
T
T
T
T
T
F
F
F
F
F
F
F
F
T
T
ï āļāļģāļēāļŦāļāļāđāļŦāđāđāļāļāļ āļāļŠāļąāļĄāļāļąāļāļāđāļāļ·āļ āđāļāļāļāļāļāļāļģāļēāļāļ§āļāļāļąāļ{0, 1, 2,
3, âĶ }
āđāļŦāđ R (x,y ) = âx < yâ
Q1: âx ây R (x,y ) āļŦāļĄāļēāļĒāļāļķāļ?
Ans1: âāļāļģāļēāļāļ§āļ x āļāļļāļāļāļąāļ§āļĄāļĩāļāđāļēāļāđāļāļĒāļāļ§āđāļē āļāļģāļēāļāļ§āļ y āļāļēāļāļāļąāļ§â
Q2: ây âx R (x,y ) āļŦāļĄāļēāļĒāļāļķāļ?
Ans2: âāļāļģāļēāļāļ§āļ y āļāļēāļāļāļąāļ§āļĄāļĩāļāđāļēāļĄāļēāļāļāļ§āđāļēāļāļģāļēāļāļ§āļ x āļāļļāļāļāļąāļ§â
Q: āļāđāļēāļāļ§āļēāļĄāļāļĢāļīāļāļāļāļāļāļĢāļ°āļāļāļāđ ïĒxâyR(x,y) āđāļĨāļ° ïĒyâxR(x,y)
āļāļ·āļāļāļ°āđāļĢ?
76
77.
Ans: âxây R(x,y)āđāļāđāļāļāļĢāļīāļ āđāļĨāļ° ïĒyâx R(x,y) āđāļāđāļāđāļāđāļ
âx ây R (x,y): âāļāļģāļēāļāļ§āļ x āļāļļāļāļāļąāļ§āļĄāļĩāļāđāļēāļāđāļāļĒāļāļ§āđāļē āļāļģāļēāļāļ§āļ y
āļāļēāļāļāļąāļ§â āđāļāđāļāļāļĢāļīāļ āđāļāļĒāļāļģāļēāļŦāļāļāđāļŦāđ y = x + 1
ây âx R (x,y): âāļāļģāļēāļāļ§āļ y āļāļēāļāļāļąāļ§āļĄāļĩāļāđāļēāļĄāļēāļāļāļ§āđāļēāļāļģāļēāļāļ§āļ x āļāļļāļ
āļāļąāļ§â āđāļāđāļāđāļāđāļ āđāļāļĢāļēāļ°āļāļģāļēāļāļ§āļ y āđāļĄāđāļŠāļēāļĄāļēāļĢāļāļĄāļĩāļāđāļēāļĄāļēāļāļāļ§āđāļēāļāļąāļ§
āļāļāļāļĄāļąāļāđāļāļāđāļāđ āļāļąāļāļāļąāđāļāļāļķāļāđāļŦāđāļāļĢāļāļĩāļāļĩāđ x = y āļāļāļāļāļĢāļ°āļāļāļāđāļāļĩāđ
āđāļāđāļāļāļąāļ§āļāļĒāđāļēāļāļāđāļēāļ(counterexample)
77
78.
ï āļāļāđāļŠāļāļāļāļĢāļ°āđāļĒāļâIf somebodyis female and is a
parent, then this person is someoneâs motherâ āđāļāđāļ
logical expression.
ïĄ āļāļģāļēāļŦāļāļāđāļŦāđ
F(x): x is female.
P(x): x is a parent.
M(x, y): x is the mother of y.
ïĄāļāđāļāļāļ§āļēāļĄāļāļĩāđāļāļĢāļ°āļĒāļļāļāļāđāđāļāđāļāļąāļāļāļļāļāļāļ
âx ((F(x) â§ (P(x)) â ây M(x, y))
78
79.
ï āļāļāđāļŠāļāļāļāļĢāļ°āđāļĒāļ âEveryonehas exactly one best
friendâ āđāļāđāļ logical expression.
ïĄ āļāļģāļēāļŦāļāļāđāļŦāđ
B(x, y): y is the best friend of x.
ïĄ āļāļĢāļ°āđāļĒāļāļāļĨāđāļēāļ§āļ§āđāļē âexactly one best friendâ āļŦāļĄāļēāļĒāļāļ§āļēāļĄāļāđāļē y
āđāļāđāļāđāļāļ·āđāļāļāļāļĩāđāļāļĩāļāļĩāđāļŠāļļāļāļāļāļ x āđāļĨāđāļ§āļāļāļāļ·āđāļ āđ(āđāļāļāļāđāļ§āļĒ z) āļāļāļāļāļēāļ y āđāļĄāđ
āļāļēāļāđāļāđāļāđāļāļ·āđāļāļāļāļĩāđāļāļĩāļāļĩāđāļŠāļļāļāļāļāļ x
ïĄ If y is the best friend of x, then all other people z other
than y can not be the best friend of x.
âxâyâz (B(x, y) â§ ((z â y) â ÂŽB(x, z)))
79
#10Â Computer Science, Burapha University Later in the course, we will see that operators can themselves be defined in terms of functions. This slide doesnât define them that way because we havenât defined functions yet. But for your reference, when you come back to study this section after learning about functions, in general, an n -ary operator O on any set S (the domain of the operator) is a function O : S ^ n -> S mapping n -tuples of members of S (the operands ) to members of S . â S ^ n â here denotes S with n as a superscript, that is, the n th Cartesian power of S . All this will be defined later when we talk about set theory. For Boolean operators, the set we are dealing with is B={True,False}. A unary Boolean operator U is a function U:B->B, while a binary Boolean operator T is a function T:(B,B)->B. Binary operators are conventionally written in between their operands, while unary operators are usually written in front of their operands. (One exception is the post-increment and post-decrement operators in C/C++/Java, which are written after their operands.)
#14 Computer Science, Burapha University Note that AND is commutative and associative, which means that we can write a long conjunction (like in the first bullet on the left) without parenthesizing it. It also doesnât matter what order the n propositions are in. The fact that an n -operand operator has 2^ n rows in its truth table is an easy consequence of the product rule of combinatorics. Here is a proof. Note that for the table to be complete, we must have 1 row for every possible assignment of truth values to the n operands. Thus, there is 1 row for every function f : V -> B , where V is the set of operand columns { p , q ,âĶ} and B ={T,F}. Here, | V |= n and | B |=2. The number of functions from a set of size n to a set of size m is m ^ n . This is because of the product rule, as we will see in a moment. In this case, m =2 so we get 2^ n such functions. In terms of the product rule: There are 2 possible values for p . For each of these, there are 2 possible values for q, since the choice of q is independent of the choice of p. And so on. So there are 2x2xâĶ(n repetitions)âĶx2 possible rows, thus 2^ n . Of course, we havenât defined the product rule, set cardinality, or functions yet, so donât worry if the above argument doesnât quite make sense to you yet. In the second bullet, we would say, {NOT,AND} is a universal set of Boolean operators, but we havenât even defined sets yet. If you already know what a set is, a universal set of operators over a given domain is a set of operators such that nested expressions involving those operators are sufficient to express any possible operator over that domain. In this case, the domain is B={T,F}. The proof that {NOT,AND} is universal is as follows: OR can be defined by p OR q = NOT(NOT(p) AND NOT(q)) (easily verified; this is one of DeMorganâs Laws, which we will get to later). Now, armed with OR, AND, and NOT, we can show how to express any Boolean truth table, with any number of columns, as follows. Look for the cases where the last (result) column is T. For each such row in the truth table, include a corresponding term in a disjunctive expression for the whole truth table. The term should be a conjunction of terms, one for each input operand in that row. Each of these terms should be p if the entry in that position is âTâ, and NOT( p ) if the entry in that position is âFâ. So, the entire expression basically says, âthe value of the operator is T if and only if the pattern of truth values of the input operands exactly matches one of the rows in the truth table that ends in a âTâ result.â Thus, the expression directly encodes the content of the truth table.
#15Â Computer Science, Burapha University OR is also commutative and associative. The animated picture on the right is just a memory device to help you remember that the disjunction operator is symbolized with a downward-pointing wedge, like the blade of an axe, because it âsplitsâ a proposition into two parts, such that you can take either part (or both), if you are trying to decide how to make the whole proposition true. Note that the meaning of disjunction is like the phrase âand/orâ which is sometimes used in informal English. âThe car has a bad engine and/or a bad carburetor.â
#17Â Computer Science, Burapha University As an exercise, drop the truth tables for f /\\ ( g \\/ s ) and ( f /\\ g ) \\/ s to see that theyâre different, and thus the parentheses are necessary. Precedence conventions such as the one in the second bullet help to reduce the number of parentheses needed in expressions. Note that negation, with its tight binding (high precedence), and with its position to the left of its operand, behaves similarly to a negative sign in arithmetic. There is also a precedence convention that you see sometimes (for example, in the C programming language) that AND takes precedence over OR. However, this convention is not quite universally accepted, not all systems adopt it. Therefore, to be safe, you should always include parentheses whenever you are mixing ANDs and ORs in a single sequence of binary operators.
#18Â Computer Science, Burapha University For slides that have interactive exercises, it may be a good idea to stop the class for a minute to allow the students to discuss the problem with their neighbors, then call on someone to answer. This will help keep the students engaged in the lecture activity.
#20Â Computer Science, Burapha University A good way to remember the symbol for XOR, a plus sign inside an O, is to think of XOR as adding the bit-values of its inputs (mod 2). E.g., 0+0=0, 1+0=0, 1+1=0 (mod 2). Thus XOR is basically an addition, and we put it inside an âOâ to remind ourselves that it is a type of âOrâ. XOR together with unary operators do not form a universal set of operators over the Booleans. However, it turns out that they are a universal set for quantum logic! However we do not have time to cover quantum computing in this class, interesting though it is.
#21Â Computer Science, Burapha University Note that the definition of âp implies qâ says: âIf p is true, then q is true, and if p is not true, then q is either true or false.â Well, saying that q is either true or false is not saying anything, since any proposition is, by the very definition of a proposition, either true or false. So, the last part of that sentence (covering the case where p is not true) is not really saying anything. So we may as well say the definition is, âIf p is true, then q is true.â Sometimes the antecedent is called the hypothesis and the consequent is called the conclusion .
#22Â Computer Science, Burapha University SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS
#23Â Computer Science, Burapha University Letâs consider the rows of the truth table, one at a time. In the first row, p is false and q is false. Now, letâs consider the definition of p -> q . It says âIf p is true, then q is true, but if p is false, then q is either true or false.â Well, in this case, p is false, and q is either true or false (namely false), so the second part of the statement is true. But, of course that part is true, since it is just a tautology that q is either true or false. In other words, and if is always true when its antecedent is false. Similarly, the second row is True. The third row is false, since p is true but q is false, so it is not the case that if p is true then q is true. Finally, in the fourth row, since p is true and q is true, it is the case that if q is true then q is true. Many students have trouble with the implication operator. When we say, âA implies Bâ, it is just a shorthand for âeither not A, or Bâ. In other words, it is just the statement that it is NOT the case that A is true and B is false. This often seems wrong to students, because when we say âA implies Bâ in everyday English, we mean that if somehow A were to become true in some way, somehow, the statement B would automatically be thereby made true, as a result. This does not seem to be the case in general when A and B are just two random false statements (such as the example in the last bullet). (However in this case, we might make a convoluted argument that the antecedent really DOES effectively imply the consequent: Note that if 1=0, then if a given pig flies 0 times in his life, then he also flies 1 time, thus he can fly.) In any case, perhaps a more accurate and satisfying English rendering of the true meaning of the logical claim âA implies Bâ, might be just, âthe possibility that A implies B is not contradicted directly by the truth values of A and Bâ. In other words, âit is not the case that A is true and B is false.â (Since that combination of truth values would directly contradict the hypothesis that A implies B.)
#24Â Computer Science, Burapha University The first one is true because T->T is True. It doesnât matter that my lecture ending is not the cause of the sun rising tomorrow. The second one is false for me, because although Tuesday is a day of the week, I am most certainly NOT a penguin. (But, if a penguin were to say this statement, then it would be true for him.) The third one is true, because 1+1 is not equal to 6. F->T is True. The last one is true, because the moon is not made of green cheese. F->F is True. In other words, anything thatâs false implies anything at all. p->q if p is false. Why? If p is false, then if p is true, then p is both false and true at the same time, and so truth and falsity are the same thing. So if q is false then q is true.
#25Â Computer Science, Burapha University Also, note that the converse and inverse of p->q also have the same meaning as each other.
#28Â Computer Science, Burapha University Also, p IFF q is equivalent to ( p -> q ) /\\ ( q -> p ). (â/\\â being the AND wedge)
#29Â Computer Science, Burapha University For fun, try writing down the truth tables for each of the 4 possible unary operators, and each of the 16 possible binary operators. For each one, try to come up with an English description of the operator that conveys its meaning. Also, figure out a way to define it in terms of other operators we already introduced.
#31Â Computer Science, Burapha University Bits can also be defined in terms of sets, if you like, by the convention that the empty set {} represents 0, and the set containing the empty set {{}} represents 1. Or more generally, any two distinct objects can represent the two bit-values or truth-values.
#69Â Computer Science, Burapha University Instructors: You can substitute your favorite overly-crowded destination in place of the University of Florida in this example.
#80Â Computer Science, Burapha University sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
#82Â Computer Science, Burapha University (Chalkboard.) Another way to see why the order of quantifiers matters is to expand out the definitions of FORALL and EXISTS in terms of AND and OR. For example, suppose the universe of discourse just consists of two objects a and b. Now, consider some predicate P(x,y). Then, FORALL x EXISTS y P(x,y) ïģ (EXISTS y P(a,y)) /\\ (EXISTS y P(b,y)) ïģ (P(a,a) \\/ P(a,b)) /\\ (P(b,a) \\/ P(b,b)). In contrast, EXISTS y FORALL x P(x,y) ïģ (FORALL x P(x,a)) \\/ (FORALL x P(x,b)) ïģ (P(a,a) /\\ P(b,a)) \\/ (P(a,b) /\\ P(b,b)). To see that these two are inequivalent, suppose only P(a,a) and P(b,b) are true. Then, the first proposition (with the FORALL first) is true, but, the second proposition (with the EXISTS first) is true. Students can come up with this counterexample in-class as an exercise.