140 likes | 164 Views
CMSC 203 / 0201 Fall 2002. Week #2 – 4/6 September 2002 Prof. Marie desJardins. TOPICS. Predicate logic and quantifiers Sets and set operations. WED 9/4 PREDICATES AND QUANTIFIERS (1.3). ** Homework #0 due today! **. CONCEPTS / VOCABULARY. Predicate (a.k.a. propositional function)
E N D
CMSC 203 / 0201Fall 2002 Week #2 – 4/6 September 2002 Prof. Marie desJardins
TOPICS • Predicate logic and quantifiers • Sets and set operations
WED 9/4PREDICATES AND QUANTIFIERS (1.3) ** Homework #0 due today! **
CONCEPTS / VOCABULARY • Predicate (a.k.a. propositional function) • Arguments (n-tuple) • Universe of discourse, syntax vs. semantics • Universal quantification • Existential quantification • Nesting of quantifiers • Binding variables, propositions • Negated quantifiers / equivalences
Examples • H(x) = Happy(x). Which are equivalent? Negations? • x H(x) x H(x) x H(x) • x H(x) x H(x) x H(x) • Compare and contrast: • x y Likes (x,y) • x y Likes (x,y) • x y Likes (x,y) • x y Likes (x,y)
Examples II • Exercise 1.3.11: use L(x,y) (“x loves y”) to express: • Everybody loves Jerry. • Everybody loves somebody. • There is somebody whom everybody loves. • Nobody loves everybody. • There is somebody whom Lydia does not love. • There is somebody whom no one loves. • There is exactly one person whom everybody loves. • There are exactly two people whom Lynn loves. • Everyone loves himself or herself. • There is someone who loves no one besides himself or herself.
Examples III • Exercise 1.3.35: Show that the statements x y P(x,y) and x y P(x,y) have the same truth value. • Exercise 1.3.39: Establish the following equivalences: • (x P(x)) A x (P(x) A) • (x P(x)) A x (P(x) A)
An additional exercise • Consistency: Exercise 1.1.35: Are the following specifications consistent? • Definition of consistency: A set of propositions is consistent if there is an assignment of truth values to the variables that makes each expression true. • “The system is in multiuser state if and only if it is operating normally. If the system is operating normally, the kernel is functioning. The kernel is not functioning or the system is in interrupt mode. If the system is not in multiuser state, then it is in interrupt mode. The system is not in interrupt mode.”
CONCEPTS / VOCABULARY • Sets, elements, members • N, Z, Z+, R • Set equality • Intensional (set builder) vs. extensional (enumerated) set definitions • Universal set • Empty/null set (), subset, proper subset, power set • Infinite sets, finite sets, cardinality • Ordered n-tuples, Cartesian product
CONCEPTS / VOCABULARY • Venn diagram • Union, intersection, difference (complement), symmetric difference • Disjoint sets • Principle of inclusion-exclusion • Set identities (Table 1.5.1: identity, domination, idempotent, complementation, commutative, associative, distributive, and De Morgan’s laws)
Examples • Exercise 1.4.23: How many different elements does A x B have if A has m elements and B has n elements? • Example 1.5.10: Prove that A B = A B. • Exercise 1.5.15: Let A, B, and C be sets. Show that • (a) A (B C) = (A B) C • (c) A (B C) = (A B) (A C)
Examples II • Exercise 1.5.19: What can you say about the sets A and B if the following are true? • A B = A • A B = A • A – B = A • A B = B A • A – B = B – A
Examples III • Exercise 1.5.23: Find the symmetric difference of the set of computer science majors at a school and the set of mathematics majors at this school. • Exercise 1.5.39: Using the universal set U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, find the set specified by each of the following bit strings: • 11 1100 1111 • 01 0111 1000 • 10 0000 0001