Вы находитесь на странице: 1из 28

CMSC 250 Discrete Structures

Set Theory

Sets
Definition of a Set:
NAME = {list or description of elements} Examples
B = {1,2,3} C = {xZ+ | - 4 < x < 4}

Axiom of Extension
A set of elements is completely defined by elements, regardless of order and duplicates Example: {a,b}={b,a}={a,b,a}={a,b,a,b,b,a}
3 July 2007 Set Theory 2

Notation
Sets defined by property
C = {xZ+ | - 4 < x < 4} C = {1,2,3,4}

Consider elements: glue, tape, pen


Sets are not equivalent to elements
{glue} glue

Sets can be elements of other sets


{pen, {glue, tape}}
3 July 2007 Set Theory 3

Subset
AB xU, xA xB
A is contained in B B contains A

AB xU, xA xB Relationship between membership and subset:


xU, xA {x} A

Definition of set equality:


A = B AB BA

3 July 2007

Set Theory

Same Set or Not???


X={xZ | pZ, x = 2p} Y={yZ | qZ, y = 2q-2} A={xZ | iZ, x = 2i+1} B={xZ | iZ, x = 3i+1} C={xZ | iZ, x = 4i+1}

3 July 2007

Set Theory

Versus
glue {glue, tape, pen} {glue} {glue, tape, pen} {glue} {{glue}, {tape}, pen} {glue} {{glue}, {tape}, pen}

3 July 2007

Set Theory

Sets
C = {x | x > - 4 and x < 4} C = {xZ+ | x > - 4 and x < 4}
What is the first element?

3 July 2007

Set Theory

Set Operations
Formal Definitions and Venn Diagrams
Union:

A U B = {x U | x A x B} A I B = {x U | x A x B}

Intersection: Complement: c Difference:

A = A' = {x U | x A}

3 July 2007

A B = {x U | x A x B} A B = A I B'
Set Theory

Procedural Versions of Set Definitions


Let X and Y be subsets of a universal set U and suppose x and y are elements of U.
1. 2. 3. 4. 5.

x(XY) xX or xY x(XY) xX and xY x(XY) xX and xY xXc xX (x,y)(XY) xX and yY


Set Theory 9

3 July 2007

Venn Diagrams
A={1,2,5,7}; B= {1,5}; C={3,7} U={1,2,3,4,5,6,7}
2 1 5 7 C 3
3 July 2007

BA

2 B 1B 5 4 6 4 6 A 7 C 3
10

Set Theory

Venn Diagram for R, Z, Q

3 July 2007

Set Theory

11

Ordered n-Tuple
Ordered n-tuple (x1,x2,x3,,xn)
takes order and multiplicity into account

n values not necessarily distinct in the order given

(x1,x2,x3,,xn) = (y1,y2,y3,,yn) iZ1in, xi=yi Examples


{a,b} = {b,a} {(a,b)} {(b,a)} Cartesian coordinate system
3 July 2007 Set Theory 12

Cartesian Product

A B = {( a, b) | a A b B}
Example
A = {x,y,z} B = {5,7} C = {a,b}

A B C (A B) C

3 July 2007

Set Theory

13

Empty Set Properties


1. 2. 3. 4. 5. 6. 7.

is a subset of every set. There is only one empty set. The union of any set with is that set. The intersection of any set with its own complement is . The intersection of any set with is . The Cartesian Product of any set with is . The complement of the universal set is and the complement of the empty set is the universal set.
Set Theory 14

3 July 2007

Other Definitions
Proper Subset

A B A B A B
Disjoint Set: A and B are disjoint

A and B have no elements in common xU, xAxB ^ xBx A


AB = A and B are Disjoint Sets
3 July 2007 Set Theory 15

Partitions of a Set
A collection of nonempty sets {A1,A2,,An} is a partition of the set A If and only if
1. A = A1 A2An 2. A1,A2,,An are mutually disjoint

3 July 2007

Set Theory

16

Power Sets
Power set of A =

P(A) = Set of all subsets of A

Example: A={a,b,c} Can also think of as a truth table Prove that


A,B{sets}, AB

P(A) P(B)

Prove that (where n(X) means the size of set X)


A{sets}, n(A) = k n(P(A)) = 2k
3 July 2007 Set Theory 17

Edwards-Venn Diagram

3 July 2007

Set Theory

18

Properties of Sets (Theorems 5.2.1 & 5.2.2)


Inclusion Transitivity

AI B A A AU B

AI B B B AU B

A BBC AC
DeMorgans for Complement

( A U B )' = A'I B '

( A I B )' = A'U B '

Distribution of union and intersection

A U ( B I C ) = ( A U B) I ( A U C ) A I ( B U C ) = ( A I B) U ( A I C )
3 July 2007 Set Theory 19

Element Argument
Basic Method for proving that one set is a subset of another Let sets X and Y be given. To prove XY,
Suppose that x is a particular but arbitrarily chosen element of X, Show that x is an element of Y.

3 July 2007

Set Theory

20

Set Equality
Two sets A and B are equal, if and only if, they have the same exact elements. Expressed as:
A=B A=B A=B A=B AB and BA (xA, xB) (xB, xA) xU, (xAxB xBxA) (xU, xAxB) (xU, xBxA)

3 July 2007

Set Theory

21

Prove A=C
A={nZ | pZ, n = 2p} C={mZ | qZ, m = 2q-2}

3 July 2007

Set Theory

22

Does A=D
A={xZ | pZ, x = 2p} D={yZ | qZ, y = 3q+1}

Easy to disprove universal statements!

3 July 2007

Set Theory

23

Prove A B = A (A B)
LHS: A B = {xU | xA xB} RHS: A (A B)
= = = = = = = = {xU {xU {xU {xU {xU {xU {xU {xU | | | | | | | | xA x(A B)} xA x(A B)} xA x(A B)} xA (xA xB)} (xA xA) (xA xB)} FALSE (xA xB)} xA xB} xA xB}

LHS = RHS
3 July 2007 Set Theory 24

Prove A B A
sets A,B xU x(A B) xA Choose generic sets A, B and element xU Assume x(A B)
xA xB (by def of intersection ) xA (by conjunctive simplification)

x(A B) xA (by closing cond. world) sets A,B xU x(A B) xA

3 July 2007

Set Theory

25

Using Venn Diagrams to help find counter example

( A U B ) I C = ? = A U (B I C ) A U (B I C ) = ? = ( A I B ) U ( A I C ) A U (B I C ) = ? = ( A I B ) I C
3 July 2007 Set Theory 26

Deriving new Properties using rules and Venn diagrams

( A B ) and (B A) are disjoint


A B = A (A I B) A B A C A (B I C )
3 July 2007 Set Theory 27

Formal Languages
= alphabet = a finite set of symbols string over = empty (or null) string denoted as OR ordered n-tuple of elements n = set of strings of length n * = set of all finite length strings L = {s | s=aibiai for iZ0} = ?
3 July 2007 Set Theory 28

Вам также может понравиться