CS1502, Fall 2004 Some practice questions for Exam 2. I'm preparing a solution and will post it soon. This doesn't have questions covering all the things that will be on the exam. I think it will be useful practice to supplement the lecture notes and assignments. Part I:==================== Which of the following are true, and which are false? (Read the first one as "A logically follows from A^B" or "A is entailed by A^B". Though the book does not use this terminology often, it is common terminology). 1. A ^ B |= A T 2. A |= A ^ B F 3. A v B |= B F 4. B |= A v B T 5. ~(P ^ A) |= ~P v ~A T 6. ~P v ~A |= ~(P ^ A) T 7. P |= Q F 8. Q |= P F 9. ~P |= P F 10. P |= ~P F 11. P ^ (~P v Q) |= Q T 12. Q |= P ^ (~P v Q) F 13. all x P(x) |= ~exists x ~P(x) T 14. ~exists x ~P(x) |= all x P(x) T *A* Which of the following are logical truths? *B* Which are logically satisfiable but not logical truths? *C* Which are not logically satisfiable? (Note: these involve the same sentences as above) 16. (A ^ B) --> A *A* 17. A --> (A ^ B) *B* 18. (A v B) --> B *B* 19. B --> (A v B) *A* 20. ~(P ^ A) --> (~P v ~A) *A* 21. (~P v ~A) --> ~(P ^ A) *A* 22. P --> Q *B* 23. Q --> P *B* 24. ~P --> P *B* P v P equiv P The sentence is satisfiable -- it is true if P is true! 25. P --> ~P *B* 26. (P ^ (~P v Q)) --> Q *A* 27. Q --> (P ^ (~P v Q)) *B* 28. all x P(x) --> ~exists x ~P(x) *A* 29. ~exists x ~P(x) --> all x P(x) *A* 31. (A ^ B) <--> A *B* 33. (A v B) <--> B *B* 35. ~(P ^ A) <--> (~P v ~A) *A* 36. (~P v ~A) <--> ~(P ^ A) *A* 37. P <--> Q *B* 39. ~P <--> P *C* 43. all x P(x) <--> ~exists x ~P(x) *A* 44. ~exists x ~P(x) <--> all x P(x) *A* 45. (P ^ (~P v Q)) <--> Q *B* Which of the following pairs are logically equivalent? (Note1: these involve the same sentences as above) 46. (A ^ B), A no 48. (A v B), B no 50. ~(P ^ A), (~P v ~A) yes 52. P, Q no 54. ~P, P no 56. (P ^ (~P v Q)), Q no 58. all x P(x), ~exists x ~P(x) yes Which of the following are logically valid arguments? (Note: these involve the same sentences as above) 60.5 yes - everything follows from a contradiction! P ^ ~P ------ Q v R 61. yes (A ^ B) --- A 62. no A --- (A ^ B) 63. no (A v B) --- B 64. B yes --- (A v B) 65. ~(P ^ A) yes --- (~P v ~A) 66. (~P v ~A) yes --- ~(P ^ A) 67. P no --- Q 69. ~P no -- P 71. (P ^ (~P v Q)) yes --- Q 72. Q no --- (P ^ (~P v Q)) 73. all x P(x) yes --- ~exists x ~P(x) 74. ~exists x ~P(x) yes --- all x P(x) Part II:============================= For each of the following, state whether it is a valid argument. If it is not valid, give a counter example showing it is not. 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 consider a world with only: tom, who is not a student and who is not smart (so sentence 1 is true) goofy, who is a student who is not smart (so sentence 2 is true) The premises are true, but the conclusion is false -------------------------- exists x Student(x) exists x Smart(x) --- exists x (Student(x) ^ Smart(x)) no consider a world with only: goofy, a student who is not smart tom, a dentist who is smart but not a student -------------------------- -------------------------- Are the following pairs logically equivalent? If not, give an example that shows 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 a world with some men and some women -------------------------- 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) no a world with a minor and an astronaut who are not the same person Part III:============================= Consider a world with only two shapes. They are both tets and they are in the same row. Is the following sentence true? all x all y ((cube(x) ^ cube(y)) --> (leftof(x,y) v rightof(x,y))) No, 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 ((shape(x) ^ shape(y)) --> (leftof(x,y) --> 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(x,y) 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))