Chapter one, Revision Examples. Flashcards
Let S(x) be the predicate “x is a student,” F(x) the predicate “x is a faculty member,” and A(x, y) the predicate
“x has asked y a question,” where the domain consists of
all people associated with your school.
f ) Some student has asked every faculty member a question.
f) This is a little ambiguous in English. If the statement is that there is a very inquisitive student, one
who has gone around and asked a question of every professor, then this is similar to part ( d), without the
negation: 3x(S(x) /\ :/y(F(y) —> A(x, y))). On the other hand, the statement might be intended as asserting
simply that for every professor, there exists some student who has asked that professor a question. In other
words, the questioner might depend on the questionee. Note how the meaning changes with the change in
order of quantifiers. Under the second interpretation the answer is \fy(F(y)—> 3x(S(x) /\ A(x, y))). The first
interpretation is probably the intended one.
Let S(x) be the predicate “x is a student,” F(x) the predicate “x is a faculty member,” and A(x, y) the predicate
“x has asked y a question,” where the domain consists of
all people associated with your school.
g) There is a faculty member who has asked every other
faculty member a question.
g) This is pretty straightforward, except that we have to rule out the possibility that the askee is the same
as the asker. Our sentence needs to say that there exists a faculty member such that for every other faculty
member, the first has asked the second a question: 3x(F(x) /\ \fy((F(y) /\ y -:f x)—> A(x, y))).
Let S(x) be the predicate “x is a student,” F(x) the predicate “x is a faculty member,” and A(x, y) the predicate
“x has asked y a question,” where the domain consists of
all people associated with your school.
d) Some student has not asked any faculty member a
question.
e) There is a faculty member who has never been asked
a question by a student.
d) There is a student such that for every faculty member, that student has not asked that faculty member a
question. Note how we need to include the Sand F predicates: 3x(S(x) /\ ‘Vy(F(y)-> -,A(x, y))). We could
also write this as 3x(S(x) /\ -i3y(F(y) /\ A(x, y))).
e) This is very similar to part (d), with the role of the players reversed: 3x(F(x) /\ ‘Vy(S(y)-> -iA(y,x))).
26 Chapter 1 The Foundations: Logic and Proofs
Let T(x, y) mean that student x likes cuisine y, where the
domain for x consists of all students at your school and
the domain for y consists of all cuisines. Express each of
these statements by a simple English sentence.
d) ∀x∀z∃y((x ≠ z) → ¬(T(x, y) ∧ T(z, y)))
e) ∃x∃z∀y(T(x, y) ↔ T(z, y))
f ) ∀x∀z∃y(T(x, y) ↔ T(z, y))
d) For every pair of distinct students at
your school, there is some cuisine that at least one them does
not like. e) There are two students at your school who like
exactly the same set of cuisines. f) For every pair of students
at your school, there is some cuisine about which they have
the same opinion (either they both like it or they both do not
like it).
Determine whether ∀x(P(x) → Q(x)) and ∀xP(x) →
∀xQ(x) are logically equivalent. Justify your answer.
They are not equivalent. Let P(x) be any propositional function that is sometimes true and sometimes false, and let Q(x) be any propositional function that is always false. Then ∀x(P(x) → Q(x)) is false but ∀xP(x) → ∀xQ(x) is true
Express each of these statements using logical operators,
predicates, and quantifiers.
a) Some propositions are tautologies.
b) The negation of a contradiction is a tautology.
c) The disjunction of two contingencies can be a tautology.
d) The conjunction of two tautologies is a tautology
- Let T(x) mean that x is
a tautology and C(x) mean that x is a contradiction. a) ∃x T(x)
b) ∀x(C(x) → T(¬x)) c) ∃x∃y(¬T(x) ∧ ¬C(x) ∧ ¬T(y) ∧
¬C(y)∧T(x ∨ y)) d) ∀x∀y((T(x) ∧T(y)) → T(x∧y))
Sudoku
suuji wa dokushin ni kagiru
“the digits must remain single”
To assert that no cell contains more than one number, we take the conjunction over all
values of n, n′
, i, and j, where each variable ranges from 1 to 9 and n ≠ n′ of p(i, j, n) →
¬p(i, j, n′).
The n-Queens Problem
Read it, please. u have to do your best to get in IIIT H.
- ¬p(i, j) ∨ ¬p(i, k) asserts that
at least one of ¬p(i, j) and ¬p(i, k) is true, which means that at least one of p(i, j) and p(i, k) is
false. think on this one, why not p v q.
Each inhabitant of a remote village always tells the truth
or always lies. A villager will give only a “Yes” or a “No”
response to a question a tourist asks. Suppose you are a
tourist visiting this area and come to a fork in the road.
One branch leads to the ruins you want to visit; the other
branch leads deep into the jungle. A villager is standing
at the fork in the road. What one question can you ask the
villager to determine which branch to take?
“If I were to ask you whether
the right branch leads to the ruins, would you answer yes?”
Determine whether these system specifications are consistent:
“The diagnostic message is stored in the buffer or it is retransmitted.”
“The diagnostic message is not stored in the buffer.”
“If the diagnostic message is stored in the buffer, then it is retransmitted.”
Let p denote “The diagnostic message is stored in the buffer” and let q
denote “The diagnostic message is retransmitted.” The specifications can then be written as
p ∨ q, ¬p, and p → q
we conclude that these specifications
are consistent, because they are all true when p is false and q is true. We could come to the same
conclusion by the use of a truth table to examine the four possible assignments of truth values to p
and q.
“You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16
years old.”
Let q, r, and s represent “You can ride the roller coaster,” “You are under 4 feet tall,”
and “You are older than 16 years old,” respectively. Then the sentence can be translated to
(r ∧ ¬s) → ¬q.
For hiking on the trail to be safe, it is necessary but
not sufficient that berries not be ripe along the trail
and for grizzly bears not to have been seen in the area.
(h →(¬b ∧ ¬g)) ∧ ¬((¬b ∧ ¬g) → h)
- 5
- Express each of these system specifications using predicates, quantifiers, and logical connectives, if necessary.
b) There is a process that continues to run during all error conditions only if the kernel is working correctly.
b) 3pVe((H(e)–> S(p,running))–> S(kernel,working correctly)), where H(e) means that error condition e is
in effect and S(x,y) means that the status of xis y. Obviously there are other ways to express this with
different choices of predicates. Note that “only if” is the converse of “if,’’ so the kernel’s working properly is
the conclusion, not the hypothesis.
- 5
- Express each of these system specifications using predicates, quantifiers, and logical connectives, if necessary.
c) All users on the campus network can access all websites whose url has a .edu extension.
c) Vu\ls(E(s, .edu)–+ A(u,s)), where E(s,x) means that websites has extension x, and A(u,s) means that
user u can access website s
1.5
17. Express each of these system specifications using predicates, quantifiers, and logical connectives, if necessary.
∗d) There are exactly two systems that monitor every remote server.
d) This is tricky, because we have to interpret the English sentence first, and different interpretations would
lead to different answers. We will assume that the specification is that there exist two distinct systems such
that they monitor every remote server, and no other system has the property of monitoring every remote
system. Thus our answer is 3x3y(x -1- y /\ Vz((Vs M(z, s)) f-7 (z = x V z = y))), where M(a, b) means that
system a monitors remote server b. Note that the last part of our expression serves two purposes-it says
that x and y do monitor all servers, and it says that no other system does. There are at least two other
interpretations of this sentence, which would lead to different legitimate answers.