Basic Definitions of Set Theory Lecture 25 Section

Basic Definitions of Set Theory Lecture 25 Section 5. 1 Mon, Mar 5, 2007

Disjoint Sets A and B are disjoint if A B = . ¢ A collection of sets A 1, A 2, …, An are mutually disjoint, or pairwise disjoint, if Ai Aj = for all i and j, with i j. ¢

Examples ¢ The following sets are mutually disjoint. {0} l {1, 2, 3, …} = N+ l {-1, -2, -3, …} = Nl ¢ The following sets are mutually disjoint. {…, -3, 0, 3, 6, 9, …} = {3 k | k Z} l {…, -2, 1, 4, 7, 10, …} = {3 k + 1 | k Z} l {…, -1, 2, 5, 8, 11, …} = {3 k + 2 | k Z} l

Partitions ¢ A collection of sets {A 1, A 2, …, An} is a partition of a set A if A 1, A 2, …, An are mutually disjoint, and l A 1 A 2 … An = A. l

Examples {{0}, {1, 2, 3, …}, {-1, -2, -3, …}} is a partition of Z. ¢ {{…, -3, 0, 3, 6, …}, {…, -2, 1, 4, 7, …}, {…, -1, 2, 5, 11, …}} is a partition of Z. ¢

Example For each positive integer n N, define f(n) to be the number of distinct prime divisors of n. ¢ For example, ¢ f(1) = 0. l f(2) = 1. l f(4) = 1. l f(6) = 2. l

Example Define Ai = {n N | f(n) = i}. ¢ Then A 0, A 1, A 2, … is a (infinite) partition of N. ¢ Verify that ¢ Ai Aj = for all i, j, with i j. l A 0 A 1 A 2 … = N. l

Power Sets Let A be a set. The power set of A, denoted P(A), is the set of all subsets of A. ¢ If A = {a, b, c}, then P(A) = { , {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}. ¢ What is P( )? ¢ What is P(P( ))? ¢ What is P(P({a}))? ¢ If A contains n elements, how many elements are in P(A)? ¢

Cartesian Products Let A and B be sets. Define the Cartesian product of A and B to be A B = {(a, b) | a A and b B}. ¢ R R = set of points in the plane. ¢ R R R = set of points in space. ¢ What is A ? ¢ How many elements are in {1, 2} {3, 4, 5} {6, 7, 8}? ¢

Representing Sets in Software Given a universal set U of size n, there are 2 n subsets of U. ¢ Given an register of n bits, there are 2 n possible values that can be stored. ¢ This suggests a method of representing sets in memory. ¢

Representing Sets in Software For simplicity, we will assume that |U| 32. ¢ Let U = {a 0, a 1, a 2, …, an – 1}. ¢ Using a 32 -bit integer to represent a set S, let bit i represent the element ai. ¢ If i = 0, then ai S. l If i = 1, then ai S. l ¢ For example, 10011101 represents the set S = {a 0, a 2, a 3, a 4, a 7}.

Example: Sets. cpp
- Slides: 12