=============================================================== Lect 6 - October 14, 2008 - ECS 20 - Fall 2008 - Phil Rogaway =============================================================== Today: o Quiz #1 (20 mins) o Set theory, continued NOTE: Sorry but these notes are rather sketchy .... ------------------------------------- 1. Specifying Sets and Set Operations ------------------------------------- \N, \R, \Z, \Q What set is this? Many ways to specif sets: P = {n: n is a prime number} Let P be the set of prime numbers. P = {n \in N : i | n -> i \in {-n,-1,1,n}} P = {2,3,5,7,11,...} No good: No number divides it. P = {primes} Operations = \ne \in \not\in \subset \subseteq \supset \supseteq union intersection complement *alwasy relative to some universe U* xor set difference exclusive or A\B \cup B\A define DISJOINT: Sets A and B are *disjoint* if \neg \exists a\in A\cap B define when a set is FINITE exists a function define when a set is INFINITE Draw some VENN DIAGRAMS A \cup (B\cap C) "Laws of the algebra of sets: A u A = A A\cap A = A A u (B u C) = (A u B) u C A\cap (B \cap C) = (A\cap B)\cap C A u B = B u A A\cap B = B\cap A A u (B\cap C) = A u C \cap B u C A \cap (B u C) = A\cap B u A\cap C A u \emptyset = A A \cap \emptyset = \emptyset A u U = U A \cap U = A (A^c)^c = A A u A^c = U A \cap A^c = \emptyset U^c = \emptyset \emptyset^c = U (A u B)^c = A^c \cap B^c (A\cap B)^c = A^c u B^c <-- DeMorgan's laws Prove one, say the first. a \in (A\cup B)^c iff a \not\in A\cup B a \not\in A and a \not\in B a \in A^c and a \in B^c a \in A^c \cap a\in B^c |S| = the number of element in S if S is finite, \infinity otherwise A= {{a},b,\emptyset}. |A| = 3 A = {emptyset, {emptyset}, {{emptyset}}} |A|=3. AVOID TYPE ERRORS!!! ... in a proof, x and y are real numbers. "Suppose x\subseteq y" .... and many other such problems. CROSS PRODUCT A x B = {(a,b): A\in A, B\in B} UNORDERED PRODUCT A & B = {{a,b}: A\in A, B\in B} // when I learned graph theory -- never saw it since! \R^2 points in the plane Do problem 5 from the HW: The variables are V = {P_{i,j}^k | i,j \in \N, k \in [1..t]} { OR_{i,j,k} P_{i,j}^k | (i,j)\in \N^2} u { AND_{k,k} P_{i,j}^k -> \neg P_{i,j}^k'} u { P_{i,j}^k \land \neg P_{i,j+1}^k' -> S(k,k') | k\ne k\, i,j\in \N} u { P_{i,j}^k \land \neg P_{i+1,j}^k' -> T(k,k') | k\ne k\, i,j\in \N} Exercise: carefully write an expression for the following sets: - A tile type is a four-tuple of integers \N \times \N \times \N \times N. ------------------------------------------------------ 2. Sets STRINGS (elements of formal language theory) ------------------------------------------------------ Define and give examples: Alphabet String operation: concatenation Language extend concatenation to this set Class a set of languages Empty string (\epsilon) (\Lambda) A* A^0 = {\emptyset} (why? For recursive definition clean) \Sigma^* ----------------------- 3. Elements of counting ----------------------- If A and B are disjoint finite sets, then |A\cup B| = |A| \cup |B| More generally, |A\cup B| = |A| + |B| - |A\cap B| for any finite sets A, B "inclusion-exclusion principle" If ecs20 has 70 students and ecs30 has 100 students and 10 students are taking both classes, how many are taking ecs20 or ecs30? 70 + 100 - 10 = 160