10+Slides--Sets

10+Slides--Sets - CS103 HO#10 Sets 4/8/11 1 Sets Sipser:...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS103 HO#10 Sets 4/8/11 1 Sets Sipser: "A set is a group of objects represented as a unit. Sets may contain any type of object, including numbers, symbols, and even other sets." If A is a set and x is an object, we write x A to mean that x is an element of (or member of) A, and x A to mean that x is not an element of (or member of) A. Sets Another definition: "A set is an unordered collection of distinct elements." One way to specify a set is to list the elements: A = {2, 3, 5, 7, 11} An object is either in a set or not, so there is no point in repeating elements in the list, nor does the order matter: {2, 3, 5, 7, 11} is the same set as {11, 7, 5, 2, 3, 7, 11} Another way to specify a set is by providing a rule or property that determines membership: A = {n | Prime(n) n < 12} This is called set builder notation. Sets Sets A and B are equal if and only if they have exactly the same members: A = B x ((x A) (x B)) A is a subset of B means that every member of A is a member of B: (A B) x ((x A) (x B)) A is a proper subset of B means that A subset of B and A is not equal to B: (A B) ((A B) (A B) Sipser writes this as A B Sets Sets A and B are equal if and only if they have exactly the same members: A = B x ((x A) (x B)) Alternate definition: A = B ((A B) (B A)) The Empty Set We say that a set A is empty if x (x A) and we denote the empty set by { } or Alternate: = {x | x x} Is the empty set unique? Suppose that x (x ) and x (x ) Then x( ((x ) (x )) ((x ) (x )) ) since both conditionals are vacuously true. So = Union of two sets We say that union of two sets A and B is the set consisting of all elements that belong to A or B, and we denote the union operator by the symbol A B = {x | x A x B} Intersection of two sets We say that intersection of two sets A and B is the set consisting of all elements that belong to both A and B, and we denote the intersection operator by the symbol A B = {x | x A x B} CS103 HO#10 Sets 4/8/11 2 The Universal Set When we write x (..) x (....
View Full Document

This note was uploaded on 06/01/2011 for the course EE 103 taught by Professor Plummer during the Spring '11 term at Stanford.

Page1 / 7

10+Slides--Sets - CS103 HO#10 Sets 4/8/11 1 Sets Sipser:...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online