Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sets CSLU Fall 2007 Cameron McInally

Similar presentations


Presentation on theme: "Sets CSLU Fall 2007 Cameron McInally"— Presentation transcript:

1 Sets CSLU 1100.003 Fall 2007 Cameron McInally cameron.mcinally@nyu.edu
Fordham University

2 Sets When Georg Cantor invented sets he described them as...
“By a set we understand any collection S of definite, distinct objects s of our perception or of our thought into a whole.” What that means… “A set is a group of objects, with no duplicates.”

3 Sets {} Set basics: {a} {a,b,c,apple,e} {a,b,{joe,d},e}
Sets are always enclosed in curly brackets. E.g. {a} Objects in sets are separated by commas. E.g. {a,b,c,apple,e} Sets can contain other sets. E.g. {a,b,{joe,d},e} Sets can be empty. E.g. {}

4 Sets Don’t list any object more than once in a set
2 major rules: Don’t list any object more than once in a set The order of a set does not matter

5 Sets {a,b,d,d,e} {a,b,c,d,e} {a,b,c,b,b}
1) Don’t list any object more than once: {a,b,d,d,e} {a,b,c,d,e} {a,b,c,b,b}

6 Sets {a,b,c,d,e} != {e,d,c,a,f} {a,b,c,d,e} == {e,d,c,b,a}
2) The order of a set does not matter: {a,b,c,d,e} != {e,d,c,a,f} {a,b,c,d,e} == {e,d,c,b,a} {a,b,c,d,e} == {b,e,d,a,c}

7 Sets To represent a set as a whole, we use capital letter names. E.g. A = {x,y,z} So, we can say that set A contains elements x, y and z.

8 Sets Cardinality |A| = 3 Cardinality is the size of a set.
If set A contains 3 elements, we can write… |A| = 3

9 Sets What is the size of each of these sets? A = {a,b,c,d,e,f,g}
B = {x,y,z} C = {{},{},10,11} D = {} E = {{a,b},{c,d}} |A| = 7 |B| = 3 |C| = Not a Set!! |D| = 0 |E| = 2

10 Sets Infinite Sets “N” is the natural numbers {0, 1, 2, 3, 4, 5, …}
“Z” is the set of integers {…-2,-1,0,1,2,…} “Q” is the set of rational numbers (any number that can be written as a fraction “R” is the set of real numbers (all the numbers/fractions/decimals that you can imagine

11 Sets 7 What is the cardinality? A = {alpha, beta, gamma}
C = {{a,{b}},{c,d}} D = {{},{},10,11} E = {} |A| = |B| + |C| = |D| + |E| - |A| = |B| + |D| = 3 6 1 7

12 Sets Set Builder Notation
How do we represent the elements in a set, without specifically writing them out. This is read, “x, such that x is an element of N”. In general; “:” means “such that” “Є“ means “element of” Here, N is the set of Natural Numbers.

13 Sets Two symbols that we will need: Is a subset of: Is an element of:

14 Sets Element of and Subset of…

15 Sets Set builder notation:
Everything before the “:” gives a description of what values we want to include in our set Everything after the “:” places constraints on which of the values mentioned in the first half we will actually use.

16 Sets Examples of Set Builder Notation

17 Sets Understanding Set Builder Notation

18 Sets Union ( ) This creates a new set from the elements in A and B. Duplicates are discarded.

19 Sets

20 Sets Intersection ( ) This creates a new set that contains the elements that both A and B have in common. Other elements are discarded.

21 Sets

22 Sets Difference (-) This creates a new set that contains the elements of set A without any element in set B.

23 Sets

24 Sets Practice Set Operations

25 Sets Power Set (2S) Given a set S, this creates a set which contains all the subsets of S. Power Sets include the empty set. Power Sets include the set S. Power Sets are represented by 2S Power Sets can also be written as P(S)

26 Sets Power Set For A = {1,2,3} 2a = P(A)= {{},{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3}} For B = {a,b,c,d} 2B = P(B) = {{},a,b,c,d,{a,b}, {a,c}, {a,d}, {b,c}, {b,d}, {c,d},{a,b,c}, {a,b,d}, {a,c,d}, {b,c,d}, {a,b,c,d}}

27 Sets Cartesian Product (X) Coordinate Pairs from a Cartesian Product
Creates a set consisting of all coordinate pairs. Coordinate Pairs from a Cartesian Product Every combination of one element from the first set with one element from the second set.

28 Sets Cartesian Product

29 Homework (Always Due in One Week)
Sets Homework (Always Due in One Week) Read Section 3.1, 3.2 Complete Section 3.1 pages : 1(a-e), 2(a-d)[super hard], 4(a-d), 11(b,d) Note: These homework problems are unusually hard. I will give you hints, if needed. Complete Section 3.2 pages : 1(a-e), 3(a-c), 13(a-e) Hint: n(A) == |A|


Download ppt "Sets CSLU Fall 2007 Cameron McInally"

Similar presentations


Ads by Google