CS1502, Spring 2009 Part I:==================== Which of the following are true, and which are false? A ^ B |= A T A |= A ^ B F A v B |= B F B |= A v B T ~(P ^ A) |= ~P v ~A T ~P v ~A |= ~(P ^ A) T P |= Q F Q |= P F ~P |= P F P |= ~P F P ^ (~P v Q) |= Q T Which of the following are logical truths? Which are logically satisfiable but not logical truths? Which are not logically satisfiable? (Note: these involve the same sentences as above) (A ^ B) --> A Logical truth A --> (A ^ B) (logically satisfiable but not a logical truth) Not a logical truth: It does not have to be true. E.g.: woman(mary) --> woman(mary) ^ man(mary) clearly that could be false. is it satisfiable? is there a world in which it is true? Sure. Suppose in our world, a is a cube and b is a tet. Let A be cube(a) and B be tet(b). cube(a) --> (cube(a) ^ tet(b)) -- that's true in our world. (A v B) --> B satisfiable but not a logical truth Not a logical truth: hockeyteam(penguins) v hockeyteam(steelers) --> hockeyteam(steelers) NOT true in our world. Is it satisfiable? yes. A: tet(a) B: cube(a) (tet(a) v cube(a)) --> cube(a) If cube(a) is true in the world, then the sentence is true. It is also true if dodec(a) is true! B --> (A v B) logical truth ~(P ^ A) --> (~P v ~A) logical truth (~P v ~A) --> ~(P ^ A) logical truth P --> Q logically satisifiable but not LT Q --> P logically satisfiable but not LT ~P --> P P v P equiv P The sentence is satisfiable -- it is true if P is true! P --> ~P The sentence is satisfiable! ~P v ~P equiv ~P The sentence is true if P is false. (Contrast the to P |= ~P above!!!) (P ^ (~P v Q)) --> Q logical truth Q --> (P ^ (~P v Q)) satisfiable but not a logical truth equivalent to: ~Q v (P ^ Q) (~Q v P) ^ (~Q v Q) ~Q v P Clearly that may be true but does not have to be. all x P(x) --> ~exists x ~P(x) logical truth ~exists x ~P(x) --> all x P(x) logical truth (P ^ (~P v Q)) --> Q (same as above by mistake) (A ^ B) <--> A satisfiable, but not a logical truth (A ^ B) --> A always true A --> A ^ B could be true A <--> (A ^ B) not any different from previous sentence (A v B) <--> B satisfiable but not a logical truth (A v B) --> B satisfiable but not a logical truth B --> (A v B) logical truth B <--> (A v B) this is the same as just above ~(P ^ A) <--> (~P v ~A) logical truth (~P v ~A) <--> ~(P ^ A) same P <--> Q satisfiable not logical truth Q <--> P satisfiable not logical truth Interesting! Not satisfiable ~P <--> P (~P --> P) ^ (P --> ~P) (P v P) ^ (~P v ~P) (P ^ ~P) cannot be true! P <--> ~P same (P ^ (~P v Q)) <--> Q satisfiable but not logical truth Q <--> (P ^ (~P v Q)) same all x P(x) <--> ~exists x ~P(x) logical truth ~exists x ~P(x) <--> all x P(x) logical truth (P ^ (~P v Q)) <--> Q (repeated one by mistake) Which of the following pairs are logically equivalent? (Note1: these involve the same sentences as above) [These match the are the <--> logical truths?] (A ^ B), A no A, (A ^ B) no (A v B), B no B , (A v B) no ~(P ^ A), (~P v ~A) yes (~P v ~A) , ~(P ^ A) yes P, Q no Q, P no ~P, P no P, ~P no (P ^ (~P v Q)), Q no Q, (P ^ (~P v Q)) no all x P(x), ~exists x ~P(x) yes ~exists x ~P(x), all x P(x) yes (P ^ (~P v Q)), Q no Which of the following are logically valid arguments? (Note: these involve the same sentences as above) [These match the |= sentences above] (A ^ B) --- A valid A --- (A ^ B) nope (A v B) --- B nope B --- (A v B) valid ~(P ^ A) --- (~P v ~A) valid (~P v ~A) --- ~(P ^ A) valid P --- Q nope Q --- P nope ~P -- P nope P --- ~P nope (P ^ (~P v Q)) --- Q valid Q --- (P ^ (~P v Q)) nope all x P(x) --- ~exists x ~P(x) valid ~exists x ~P(x) --- all x P(x) valid (P ^ (~P v Q)) --- Q valid Part II:============================= For each of the following, state whether it is a valid argument. If it is not valid, show that it is not valid. all x (Student(x) --> Smart(x)) all x Student(x) --- all x Smart(x) valid -------------------------- all x Student(x) all x Smart(x) --- all x (Student(x) ^ Smart(x)) valid -------------------------- exists x (Student(x) --> Smart(x)) exists x Student(x) --- exists x Smart(x) no -------------------------- exists x Student(x) exists x Smart(x) --- exists x (Student(x) ^ Smart(x)) no -------------------------- -------------------------- Are the following pairs logically equivalent? If not, show that they are not. all x (P(x) ^ Q(x)), all x P(x) ^ all x Q(x) Yes -------------------------- all x (P(x) v Q(x)), all x P(x) v all x Q(x). no -------------------------- exists x (P(x) v Q(x)), exists x P(x) v exists x Q(x) yes -------------------------- exists x (P(x) ^ Q(x)), exists x P(x) ^ exists x Q(x) Ans: no (goes ==> but not <==) Part III:============================= Consider a world with only two shapes. They are both cubes and they are in the same row. Is the following sentence true? [Note: this question was revised 3-17-09; it originally said "both tets", a cut-and-paste mistake] all x all y ((cube(x) ^ cube(y)) --> (leftof(x,y) v rightof(x,y))) Not if we assume that a shape cannot be leftof or rightof itself. As an aside: how can we say that a shape cannot be leftof or rightof itself? all x,y (leftof(x,y) --> ~(x = y)) or, equivalently, all x,y (x = y --> ~leftof(x,y)) ---------------------------- Express the following sentences in English (where taken(x,y) means that student x took class y): exists x exists y taken(x,y) There is a student who took a class exists x all y taken(x,y) There is a student who has taken all classes all x exists y taken(x,y) All students have taken at least one class (but could be different classes by different students) exists y all x taken(x,y) There is a class that all students have taken all y exists x taken(x,y) for all cs classes, there is at least one student who took it (but it can be different for different students) exists y (small(y) ^ all x(small(y) --> y=x)) There is exactly one small thing in the world. ------------- Suppose Q(x,y,z) is the statement x+y=z The domain of discourse is the real numbers. Are the following sentences true? all x all y exists z Q(x,y,z) True. exists z all x all y Q(x,y,z) False. --------- Express the following sentences in logic (where L(x,y) means that x loves y, and the domain of discourse for both x and y is the set of all people in the world) everybody loves fred all x L(x,fred) every loves somebody all x exists y L(x,y) there is someone whom no one loves exists x all y ~L(y,x) [changed 3-17-09: the y and x were backwards] everyone loves himself or herself all x L(x,x) -------------------- Express the following in logic. First do this using both function and predicate symbols, and then do it using only predicate symbols. Everyone has exactly one mother, who is a woman. Domain of discourse: people Assuming "mother" is defined for each element in the domain of discourse: all x Olderthan(mother(x),x) Here is the version with predicate symbols. all x exists y (Motherof(y,x) ^ Olderthan(y,x) ^ all z(MotherOf(z,x) --> y=z))