Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK [email protected]...

22
Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK [email protected] Mathematics for Computing

Transcript of Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK [email protected]...

Page 1: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Lecture 5:Set Theory 1

Dr Andrew Purkiss-TrewCancer Research UK

[email protected]

Mathematics for Computing

Page 2: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Material to be covered today

Set Theory 1

What are sets?

How are they represented?

Special and subsets

Set Operations

Power Sets

Cartesian Products

Page 3: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

What are Sets?

A set is a well defined group of items.

Sets are made up of elementse.g. The set of students studying at Birkbeck College

Page 4: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Set representation 1

Enumerated form:{2,4,6,8} Positive even numbers <10{2,4,6,8,…,50} Positive even nos. <=50{2,4,6,8,…} Positive even numbers{2,3,5,7,11,13,17,19} Prime numbers <20

Page 5: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Set Representation 2

Predicate form{x:x is even and 0 < x <= 50}{x:P(x)}

Letters can represent setsA = {1,2,3,4,5}B = {x:x is a multiple of 2}

Page 6: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Set Representation 3

A = {1,2,3,4,5}, B = {x:x is a multiple of 2}

Representation of elements3 A, 2 B6 A, 3 B

Special Sets:N = {1,2,3,4,…}J = {…,-3,-2,-1,0,1,2,3,…}Q = {x: x = m/n for the integers m and n}R is the set of real numbers

Page 7: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Special Sets

The null set:

enumerated form {} or predicate form {x: xx}

The universal set:

examples: = R, = J

Page 8: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Subsets

Two sets A and BB is defined as a subset of A (represented B A), when all elements of B are also elements in A.

Example: A = {1,2,3,4,5,6}, B = {2,3,5}, C = {2,4,6,8}.BA but as 8C, but 8A, C is not a subset of A.

Page 9: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Set Representation 4

A={1,2,3,4,5,6},B={2,3,5},C={2,4,6,8}

3 5 2 4

681

A

B

C

7

Venn Diagrams

Page 10: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

More on subsets

Another example:N J Q R

Other pointsFor any set A, AA and A

Page 11: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Set equality

Two sets A and BDefinition A = B if AB and B

Implications1) {1,2,3} = {3,1,2} = {3,2,1} = {2,1,3}2) {a,a,b} = {a,b}

Page 12: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Proper Subset

B is a proper subset of A if:B A andB A.

Page 13: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Set operations

Union A B

Intersection A B

Complement Ā

Difference A – B

Page 14: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Union

A B = {x:x A or x B}

A B

Page 15: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Intersection

A B = {x:x A and x B}

A B

Page 16: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Complement

Ā = {x:x and x }

A

Page 17: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Difference

A - B = {x:x A and x B}

A B

Page 18: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Difference 2

A B

A - B = A B̄

Page 19: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Cardinality

Cardinality. The number of elements in the set

A = {1,2,3,4,5}, |A| = 5B = {2,4,6,…,20}, |B| = 10

Page 20: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Power sets

If A is a set, the power set of A, (A) is the set of all subsets of A

A = {1,2,3}, (A) = {, {1}, {2}, {3}, {1,2}, {1,3}, {2,3}, {1,2,3}}

Page 21: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Cartesian Products

A x B = {(x,y): x A and y B}

Example: A = {1,3,5}, B = {2,4}A x B = {(1,2),(1,4),(3,2),(3,4),(5,2),(5,4)}

Page 22: Lecture 5: Set Theory 1 Dr Andrew Purkiss-Trew Cancer Research UK a.purkiss@mail.cryst.bbk.ac.uk Mathematics for Computing.

Home time

End of Set Theory 1