Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sets.

Similar presentations


Presentation on theme: "Sets."— Presentation transcript:

1 Sets

2

3

4

5

6 Set builder notation N = {0,1,2,3,…} the “natural numbers” R = reals Z = {… -3,-2,-1,0,1,2,3,…} Z+ = {1,2,3,4,5,…} Q = the set of rational numbers

7 Set builder notation S contains all elements from U (universal set) That make predicate P true Brace notation with ellipses (wee dots)

8 Set Membership x is in the set S (x is a member of S) y is not in the set S (not a member)

9 Am I making this up?

10

11

12

13 Set operators

14 Set empty The empty set

15 The universal set U

16 Venn Diagram U B A U is the universal set A is a subset of B

17 Venn Diagram U B A U is the universal set A united with B

18 Venn Diagram U B A U is the universal set A intersection B

19 Cardinality of a set The number of elements in a set (the size of the set)

20 Power Set The set of all possible sets

21 Power Set The set of all possible sets

22 Power Set The set of all possible sets We could represent a set with a bit string 0th element

23 Is this true for a set S?

24 Cartesian Product A set of ordered tuples

25 (improper) Subset is empty {} a subset of anything? Is anything a subset of {}? We have an implication, what is its truth table? Note: improper subset!!

26 Consequently A is strictly smaller than B
(proper) Subset Consequently A is strictly smaller than B |A| < |B|

27 Equal sets? Two show that 2 sets A and B are equal we need to show that And we know that

28 Try This Using set builder notation describe the following sets odd integers in the range 1 to 9 the integers 1,4,9,16,25 even numbers in the range -8 to 8

29 Answers Using set builder notation describe the following sets odd integers in the range 1 to 9 the integers 1,4,9,16,25 even numbers in the range -8 to 8

30 How might a computer represent a set?
Remember those bit operations?

31 Computer Representation (possible}
How do we compute the following? membership of an element in a set union of 2 sets intersection of 2 sets compliment of a set set difference (tricky?)

32 Power set Try this Compute the power set of {1,2} {1,2,3} {{1},{2}} {}

33 Power set Compute the power set of {1,2} {1,2,3} {{1},{2}} {} Think again … how might we represent sets?

34 Cartesian Product A set of ordered tuples note AxB is not equal to BxA Just reminding you (and me)

35 Try This Let A={1,2,3} and B={x,y}, find AxB BxA if |A|=n and |B|=m what is |AxB|

36 My answer Let A={1,2,3} and B={x,y}, find AxB BxA if |A|=n and |B|=m what is |AxB|

37

38

39

40

41

42

43 Power Set PS(A) The thinking behind the code 1 11 01 111 011 101 001
11 01 111 011 101 001 10 110 010 100 000 00 Go left: take Go right: don’t take

44 Power Set PS(A) The thinking behind the code ▪▪▪ ▫▫▫ don’t select
▪▪▫ ▫▫▪ ▪▪▫ ▫▫▫ ▪▫▫ ▫▫▪ ▪▫▫ ▫▪▫ ▪▫▫ ▫▫▫ ▫▪▪ ▪▫▫ ▫▫▫ ▪▫▪ ▫▫▫ ▫▫▪

45


Download ppt "Sets."

Similar presentations


Ads by Google