This preview shows pages 1–6. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: 12 Chapter 1 The Foundations: Logic and Proofs SECTION 1.3 Predicates and Quantiﬁers 2. 10. 12. a) This is true, since there is an a. in orange. b) This is false, since there is no a in lemon. c) This is false, since there is no a in true. (:1) This is true, since there is an e in false. . 3) Here .7: is still equal to 0, since the condition is false. b) Here .1: is still equal to 1, since the condition is false. c) This time 3: is equal to 1 at the end, since the condition is true, so the statement .1: :2 l is executed. . The answers given here are not Unique, but care must be taken not to confuse nonequivalent sentences. Parts ((1) and (f) are equivalent; and parts ((1) and (e) are equivalent. But these two pairs are not equivalent to
each other. a) Some student in the school has visited North Dakota. (Alternatively, there exists a student in the school
who has visited North Dakota.) b) Every student. in the school has visited North Dakota. (Alternatively, all students in the school have visited
North Dakota.) 0) This is the negation of part (a): No student in the school has visited North Dakota. (Alternatively, there
does not exist a student in the school who has visited North Dakota.) d) Some student in the school has not visited North Dakota. (Alternatively, there exists a student in the
school who has not visited North Dakota.) 9) This is the negation of part (b): it is not true that every student in the school has visited North Dakota.
(Alternatively, not all students in the school have visited North Dakota.) f) All students in the school have not visited North Dakota. (This is technically the correct answer, although
common English usage takes this sentence to mean—sincorrectly—the answer to part (9). To be perfectly
clear, one could say that every student in this school has failed to visit North Dakota, or simply that no
student has visited North Dakota.) . Note that part (b) and part (c) are not the sorts of things one would normally say. a) if an animal is a rabbit, then that animal hops. (Alternatively, every rabbit hops.) b) Every animal is a rabbit and hops. c) There exists an animal such that. if it is a rabbit, then it hops. (Note that this is trivially true, satisﬁed,
for example, by lions, so it is not the sort of thing one would say.) d) There exists an animal that is a rabbit and hops. (Alternatively, some rabbits hop. Alternatively, some hopping animals are rabbits.) a) We assume that. this means that one student has all three animals: 3:1:(C(.r) A A b) Vx(C(:i;) V V F'(:r:)) c) Elas(C(:E) A F(;i:) A mD(III)) d) This is the negation of part (a): —Ela:(C(:c) A A e) Here the owners of these pets can be different: (Elm C($))A(El;1: D(.1;))A(Ha: There is no harm in using
the same dummy variable, but this could also be written, for example, as (325 C(33)) A (Ely A (Elz F(z)). 3) Since 0 + l > 2  0, we know that (2(0) is true. b) Since (~1) + 1 > 2 (—1), we know that Q(~1) is true. c) Since 1 + 1 )4 2 1, we know that (2(1) is false. d) From part (a) we know that there is at least one a: that makes Q(:c) true, so 3150(3)) is true.
e) Fi‘om part (c) we know that there is at least one a: that makes Q(ri:) false, so VJJQ(:IZ) is false.
f) From part (c) we know that there is at least one I that makes (2(a) false, so HarﬁQ(a:) is true.
g) From part (a) we know that there is at least one a: that makes (2(a) true, so V3: ﬁQ(:c) is false. Section 1.3 14. 16. 18. 20. 22. Predicates and Quantifiers 13
21) Since (—1)3 : #1, this is true. b) Since < (%)2, this is true. c) Since (~$)2 : ((‘1)s;')"Z = (#1)2.’1:‘2 21:2, we know that ‘r/LI:((~:L')2 : is true. d) Twice a positive number is larger than the number. but this inequality is not true for i'iegative numbers
or 0. Therefore Vrr(2rr > :r.) is false. a) true (I 2 b) false («—1 is not a real number) (1) true (the lefthand side is always at least 2) d) false (not true for .1; : 1 or J: z 0) Existential quantifiers are like disjunctions, and universal quantiﬁers are like conjunctions. See Examples 11
and 16. a) We want to assert that. 13(93) is true for some so in the domain, so either P(~‘2) is true or P(»1) is true
or P(0) is true or P(1) is true or [3(2) is true. Thus the answer is P(~2) V P(— 1) V P(U) V P(l) V P(‘2). The
other parts of this exercise are similar. Note that by De Morgan’s laws, the expression in part (c) is logically
equivalent to the expression in part (f), and the expression in part. (d) is logically equivalent to the expression
in part b) P(—2) A P(—l) A P(0) A P(1) A P(2) c) ﬂP(—2) V ﬁP(—1) V ﬂP(0) V IP(1) V ﬁP(2) d) —.P(—2) /\ aP(—1)/\ aPUJ) /\ aP(1)/\ —.P(2) e) This is just the negation of part (a): ‘(P(—2) V P(—l) V P(0) V P(1) V P(2)) f) This is just the negation of part (b): i(P(72) A P(—1)/\ P(U) A P(1) A P(‘2)) Existential quantiﬁers are like disjunctions. and universal quantiﬁers are like conjunctions. See Examples ll
and 16. a) We want to assert that P(JI) is true for some .1: in the domain, so either P(—5) is true or P(~3) is true or
P(«l) is true or P(1) is true orP(3) is true or P(5) is true. Thus the answer is P(;5) V P(~3) V P(~1) V
P(1) V V P(5). b) P(—5) A P(~3) A P(—1) A P(l) A P(3) /\ P(5) c) The formal translation is as follows: ((4') gé 1) a P(—5)) A gé 1) ~> P(—3)) A ((—l l) «r P(—1))A
((1 ¢ 1) —+ P(1)) A ((3 7E 1) —> A 322 1) 7r P(5)). However, since the hypothesis .1: aé 1 is false when
a: is 1 and true when 59 is anything other than 1, we have more simply P(*5) A P(—3) A P(—1)f\P(3)A P(5).
d) The formal translation is as follows: ((—5 2 0) AP(—5))V((~3 2 0)A P(~3)) V((—l 2 0) AP(—1))V((1 2
0) A P(1)) V 2 0) A 17(3)) V ((5 2; ) A P(5)). Since only three of the :r’s in the domain meet the condition,
the answer is equivalent to P(1) V P(3) V P(5). , e) For the second part we again restrict the domain: (—:P(g5) V:P(;3) VﬁP(‘1)VuP(1)V‘P(3)V1P(5))A
(P(~1) A 13(4)) A P(~5)). This is equivalent to (IP(1) V 'P(3) V nP(5)) A (P(»1) A P(~3) A P(—5)). Many answer are possible in each case. a) A domain consisting of a few adults in certain parts of India would make this true. If the domain were all
residents 01' the United States, then this is certainly false. 1)) 1f the domain is all residents of the United States, then this is true. If the domain is the set of pupils in a
first grade class, it is false. c) If the domain consists of all the United States Presidents whose last name is Bush, then the statement is
true. If the domain consists of all United States Presidents, then the statement is false. d) if the domain were all residents of the United States, then this is certainly true. If the domain consists of
all babies born in the last five minutes, one would expect the statement to be false (it’s not even clear that
these babies “know” their mothers yet). 14 24. 26. 28. 32. . a) P(1,3)VP(2,3)VP(3,3) Chapter 1 The Foundations: Logic and Proofs
In order to do the translation the second way, we let C(rr) be the propositional function “.1: is in your class.”
Note that for the secoan way, we always want to use conditional statements with universal quantiﬁers and
conjunctions with existential quantiﬁers. a) Let P(:::) be “a: has a cellular phone.” Then we have Va: P[:i:) the ﬁrst way, or —> the
second way. b) Let Fm) be “a: has seen a foreign movie.” Then we have 3.1717(32) the ﬁrst way, or Ela:(C'(:r) A F(:r)) the
second way. C) Let S(:r) be “:1: can swim.” Then we have 3:1: ’nSCL‘) the ﬁrst way, or EIa:(C(a) A ﬁS(ar)) the second way.
(:1) Let he “:1: can solve quadratic equations.” Then we have V3: the ﬁrst way, or —» the second way. ' e) Let be “a: wants to be rich.” Then we have ELI oR(:r) the ﬁrst way, or AIR(:r)) the second way. In all of these, we will let Y(:r) be the propositional function that. :r: is in your school or class, as appropriate.
3) Ifwe let U(:I:) be “a: has visited Uzbekistan," then we have 33: U(a:) if the domain is just your schoolmates,
or EI:c(Y(;r:) A U{:r)) if the domain is all people. If we let V(;r,y) mean that person .17 has visited country y,
then we can rewrite this last one as 3$(Y(.i7) A V(:c, Uzbekistan)). b) If we let C(:c) and P(:c) he the propositional functions asserting that .11 has studied calculus and C++,
respectively, then we have V:t(C(.r)/\P(:c)) ifthe domain isjust your schoolmates, or Va:(l’(rr) —% (C(17)I\P(SL‘)))
if the domain is all people. If we let S{rr, mean that person a; has studied subject 3;, then we can rewrite
this last one as VJZ(Y(.’C) —> (S(:r, calculus) A S(:r, C++))). C) If we let B(.1:) and iii/1(1) be the propositional functions asserting that :r owns a. bicycle and a. motorcycle,
respectively, then we have Vm(I(B{rr)AM(s:))) if the domain is just your schoolmates, or —+ o(B(.”c)A
M(:c))) if the domain is all people. Note that “no one” became “for all . . . not.” If we let O(.r, y) mean that
person a: owns item y, then we can rewrite this last one as V17(Y(.1:) —r o(0(a:, bicycle) A O(cr,motorcycle))).
d) If we let H(a:) be “:c is happy,” then we have 355 uH{:r) if the domain is just your schoolmates, or
3:C(Y(rr) A—‘H(.'L‘)) if the domain is all people. If we let E(rr, y) mean that person .1 is in mental state 3;, then
we can rewrite this last one as El:r:(Y(:c) A 'E(:c, happy)). 9) If We let T(.r) be “1' was born in the twentieth century,” then we have V3:T(:i;) if the domain is just your
schoolmates, or VTL’(Y(:L') —> T(:c)) if the domain is all people. If we let B(rc,y) mcan that. person .r. was born
in the y”‘ century, then we can rewrite this last one as Vail/(cc) a) B(:L‘, 20)). Let be “:r: is in the correct place”; let be “a: is in excellent condition”; let T(:r) he “:5 is a [or
your] tool”; and let the domain of discourse be all things. 21) There exists something not in the correct place: 33; ﬁR(cr). b) If something is a tool, then it is in the correct place place and in excellent condition: Va:(T(1:) 7) (12(1) A
Elm)» C) V37 A d) This is saying that everything fails to satisfy the condition: V3: (R(:L') A e) There exists a tool with this property: 3.1: A with?) A E(.i:)). b) P(1, 1) A P(1, 2) A P(1,3) c) ﬁP(2, 1) V —'P(2, 2) V —P(2, 3) d) P(1, 2) A ﬁP(2,2) A —IP(3,2)
In each case we need to specify some propositional functions (predicates) and identify the domain of discourse.
a) Let be “a: has ﬂeas,” and let the domain of discourse be dogs. Our original statement is V3: F(.1').
Its negation is Ea:~uF(ac). In English this reads “There is a dog that. does not have ﬂeas.” Section 1.3 34. 36. 38. 40. 42. Predicates and Quantiﬁers 15
b) Let H(rt) be “I can add.” where the domain ofdiscourse is horses. Then our original statement is ELL" H(.’L‘).
Its negation is VJ: oH(a;). In English this is rendered most simply as “No horse can add.” G) Let C(m) be “:r can climb.” and let the domain of discourse be koalas. Our original statement is Vft' C(rr).
Its negation is Eb: C(:r:). In English this reads “There is a koala that cannot climb.” (1) Let F(:r:) be “:r can speak French.” and let the domain of discourse be monkeys. Our original statement
is —33:F(.7;) or Va; nF(:r). Its negation is 3::F(n:). In English this reads “There is a monkey that can speak
French.” e) Let 5(3)) be “.17 can swim” and let C(32) be “it? can catch ﬁsh.” where the domain of discourse is pigs. Then
our original staten'ient is 33: (5(1) A Its negation is V;i:—'(.S'(:r:) /\ which could also be written
VJ: (:S(:r) V —C(:r.')) by De Morganis law. In English this is “No pig can both swim and catch ﬁsh.” or “Every
pig either is unable to swim or is unable to catch ﬁsh.” a) Let .S'(:r) be “:c obeys the speed limit.” where the domain of discourse is drivers. The original statement
is 3:6 w.S'(:i:). the negation is Va: 5(a). “All drivers obey the speed limit.” b) Let S(;L') be “:r: is serious.” where the domain of discourse is Swedish movies. The original statement is
W: S(:r.). the negation is 3.1 ﬁS(:r). “Some Swedish movies are not serious.” e) Let be “:1: can keep a secret,” where the domain of discourse is people. The original statement is
ﬁEls:S(3;), the negation is its S(:r). “Some people can keep a secret.” d) Let .'—l(:c) be “:1: has a good attitude,” where the domain of discourse is people in this class. The original
statement is darﬁACr). the negation is V$A(3:). “Everyone in this class has a good attitude.” it) Since 12 : 1, this statement is false; .1? : 1 is a counterexample. So is r = 0 (these are the only two
counterexamples).
b) There are two counterexamples: (c : x/E and :r : —\/§. c) There is one counterexample: 'J.‘ : 0. a) Some system is open. b) Every system is either malfunctioning or in a diagnostic state. C) Some system is open, or some system is in a diagnostic state. d) Some system is unavailable.
9) No system is working. (We could also say “Every system is not working.” as long as we understood that this is different from “Not every system is working”) There are many ways to write these. depending on what we use for predicates. a) Let be “There is less than IL' megabytes free on the hard disk,” with the domain of discourse being
positive inimbers. and let lV(:c) be “User 1' is sent a warning message.” Then we have F(30) —> Var. li"(:r:).
b) Let 0(1) be “Directory a: can be opened,” let C(rc) be “File a; can be closed.” and let E be the proposition
“System errors have been detected.” Then we have E «r ((VJ: ﬂO(rr)) A (V9: C(n:))). e) Let B be the proposition “The ﬁle system can be backed up.“ and let L(:1:) be “User I is currently logged
on.” Then we have (Elm 4: ﬁB. d) Let D(a:) be “Product .1: can be delivered.” and let M(3:) be “There are at least :2: megabytes of mem
ory available” and 5(3) be “The connection speed is at least .’L‘ kilobits per second.” where the domain of
discourse for the last two propositional functions are positive numbers. Then we have (3H8) /\ S(56)) —>
D(video on demand). There are many ways to write these. depending on what we use for predicates. a) Let .ri(;.c) be “User .7; has access to an electronic mailbox.” Then we have VmA(;r). b) Let A(;‘r.y) be “Group member :13 can access resource y,” and let. S(:1:.y) be “System .7; is in state y.”
Then we have 5(ﬁle system. locked) 7* Va: A(:L',systeln mailbox). 16 Chapter 1 The Foundations: Logic and Proofs (1) Let S(.t, y) be “System 2: is in state y.” Recalling that “only if” indicates a necessary condition, we have
S(f1rewall, diagnostic) a S(proxy server, diagnostic). (1) Let T(ar) be “The throughput is at least 35 kbps,” where the domain of discourse is positive numbers,
let ild’(:r.,y) be “Resource .1: is in mode 3;," and let S(3:,y) be “Router :r is in state y.” Then we have
(T(100) A ﬁT(500) A w’lﬂproxy server, diagnosticJ) + 3.1: .S(:r:, normal). 44. We want propositional functions P and Q that are sometimes, but not always, true (so that the second
biconditional is F H F and hence true), but such that there is an :1: making one true and the other false. For
example, we can take P(:t‘) to mean that a: is an even number (a multiple of 2) and (2(1) to mean that .1) is
a multiple of 3. Then an example like a: = 4 or a: = 9 shows that Va:(P(a:) 4—: (3(a)) is false. 46. a) There are two cases. If A is true, then (V:L'P(Jr)) V A is true, and since V A is true for all :12, VJ:(P(.1:) V A) is also true. Thus both sides of the logical equivalence are true (hence equivalent). Now suppose
that A is false. if P(:t) is true for all a), then the left—hand side is true. Furthermore, the right—hand side is
also true (since 13(2) V A is true for all 3;). On the other hand, if P(a:) is false for some .t, then both sides
are false. Therefore again the two sides are logically equivalent.
b) There are two cases. if A is true, then V A is true, and since V A is true for some (really
all) 3:, Elcc(P(:L‘) V A) is also true. Thus both sides of the logical equivalence are true (hence equivalent). Now
suppose that A is false. If P(rr) is true for at least one 3:, then the left—hand side is true. Furthermore, the
right—hand side is also true (since P(:r) V A is true for that On the other hand, if 13(1) is false for all .12,
then both sides are false. Therefore again the two sides are logically equivalent. 48. a) There are two cases. If A is false, then both sides of the equivalence are true, because a conditional statement with a false hypothesis is true. if A is true, then A a P(:r) is equivalent to for each :13, so
the lefthand side is equivalent to \7‘9: P(;c), which is equivalent to the right—hand side.
b) There are two cases. If A is false, then both sides of the equivalence are true, because a conditional
statement with a false l'iypothesis is true (and we are assuming that the domain is nonempty). if A is true,
then A a is equivalent to for each 1‘, so the left—hand side is equivalent to 35:: P(.’l:), which is
equivalent to the righthand side. 50. it is enough to find a counterexample. It is intuitively clear that the ﬁrst proposition is asserting much more
than the second. it is saying that one of the two predicates, P or Q, is universally true; whereas the second
proposition is simply saying that for every at either 01' (2(35) holds, but which it is may well depend
on As a simple counterexample, let be the statement that :L' is odd, and let Q(.1:) be the statement
that I is even. Let the domain of discourse be the positive integers. The second proposition is true, since
every positive integer is either odd or even. But the first proposition is false, since it is neither the case that
all positive integers are odd nor the case that all of them are even. 52. a) This is false, since there are many values of :1: that make 3 > 1 true.
b) This is false, since there are two values of :1: that make 1'2 = 1 true.
c) This is true, since by algebra we see that the unique solution to the equation is .1: = 3. d) This is false, since there are no values of :i: that make a; = :1: + 1 true. 54. There are only three cases in which Hrs!P(:r) is true, so we form the disjunction of these three cases. The
answer is thus (P(1) A 1P(2) A nP(3)) V (APO) A P(2) A nP(3)) V (ﬁPU) A P(2) A 56. A Prolog query returns a yes/no answer if there are no variables in the query, and it returns the values that
make the query true if there are. Section 1.4 58. 60. 62. Nested Quantiﬁers 17
21) None of the facts was that Kevin was enrolled in RE 222. So the response is no. b) One of the facts was that Kilro was enrolled in Math 273. So the response is yes. c) Prolog returns the names of the courses for which Grossnian is the instructor, namer just cs301. cl) Prolog returns the names of the instructor for CS 301, namer grossman. e) Prolog returns the names of the instructors teaching any course that Kevin is enrolled in, namely Chan,
since Chan is the instructor in Math 273. the only course Kevin is enrolled in. Following the idea and syntax of Example 28, we have the following rule:
grandfatherCK ,Y) :— fatherOi ,Z) , father(Z,Y); father(K ,Z) , mother(Z ,Y).
Note that we used the comma to mean “and” and the semicolon to mean “or.” For X to be the grandfather of Y, X must be either if ’s father’s father or Y’s mother’s father. a) V1:(P(;r) a (2(:t)) b) 31;(R(;1:)/‘\ c) Ela:(1?.(:t‘) A ﬁP(1:])
cl) Yes. The unsatisfactory excuse guaranteed by part (b) cannot be a clear explanation by part I) a) V.‘E(P(.1:) ~r ﬁ3(.’t)) b) V:L'(R(:c) —> S(:I:)) c) V:r(Q(;t) —+ P(:c)) d) V;i;(Q(;i:) —» n 3) Since (
e) Yes. If :1: is one of my poultry, then he is a duck (by part (c)), hence not willing to waltz (part (a
ofﬁcers are always willing to waltz (part (b)), :1; is not an ofﬁcer. ...
View Full
Document
 Spring '09
 Ming

Click to edit the document details