1 Topic Sets (5.1, 5.2, 5.3). 2 Original author of the slides: Vadim Bulitko University of Alberta Modified by.

Slides:



Advertisements
Similar presentations
Set Operations. When sets are equal A equals B iff for all x, x is in A iff x is in B or … and this is what we do to prove sets equal.
Advertisements

Prof. Johnnie Baker Module Basic Structures: Sets
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Discrete Structures & Algorithms Basics of Set Theory EECE 320 — UBC.
Instructor: Hayk Melikya
(CSC 102) Discrete Structures Lecture 14.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Denoting the beginning
Sets Definition of a Set: NAME = {list of elements or description of elements} i.e. B = {1,2,3} or C = {x  Z + | -4 < x < 4} Axiom of Extension: A set.
Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.
Sets 1.
Sets 1.
1 CSE 20: Lecture 8 Boolean Postulates and Theorems CK Cheng 4/26/2011.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 12 Number theory Mathematical induction Proof by induction Examples.
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
1 Set Theory. Notation S={a, b, c} refers to the set whose elements are a, b and c. a  S means “a is an element of set S”. d  S means “d is not an element.
1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.
SETS A set B is a collection of objects such that for every object X in the universe the statement: “X is a member of B” Is a proposition.
Discrete Maths Objective to re-introduce basic set ideas, set operations, set identities , Semester 2, Set Basics 1.
Rosen 1.6. Approaches to Proofs Membership tables (similar to truth tables) Convert to a problem in propositional logic, prove, then convert back Use.
Boolean Algebra Dr. Bernard Chen Ph.D. University of Central Arkansas Spring 2009.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Michaelmas Term 2004 Discrete Mathematics CSC 141 Discrete Mathematics Dr. Corina Sas and Ms. Nelly Bencomo
Mt263f-11 Discrete Structures Li Tak Sing( 李德成 ) Room A
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
Mathematical Preliminaries (Hein 1.1 and 1.2) Sets are collections in which order of elements and duplication of elements do not matter. – {1,a,1,1} =
Sets Defined A set is an object defined as a collection of other distinct objects, known as elements of the set The elements of a set can be anything:
Discrete Structure Sets. 2 Set Theory Set: Collection of objects (“elements”) a  A “a is an element of A” “a is a member of A” a  A “a is not an element.
Mathematical Proofs. Chapter 1 Sets 1.1 Describing a Set 1.2 Subsets 1.3 Set Operations 1.4 Indexed Collections of Sets 1.5 Partitions of Sets.
CS201: Data Structures and Discrete Mathematics I
CompSci 102 Discrete Math for Computer Science
Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.
Naïve Set Theory. Basic Definitions Naïve set theory is the non-axiomatic treatment of set theory. In the axiomatic treatment, which we will only allude.
1 Introduction to Abstract Mathematics Sets Section 2.1 Basic Notions of Sets Section 2.2 Operations with sets Section 2.3 Indexed Sets Instructor: Hayk.
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
CSE 20: Lecture 7 Boolean Algebra CK Cheng
Sets 2/10/121. What is a Set? Informally, a collection of objects, determined by its members, treated as a single mathematical object Not a real definition:
Chapter 2 With Question/Answer Animations. Section 2.1.
Rosen 1.6, 1.7. Basic Definitions Set - Collection of objects, usually denoted by capital letter Member, element - Object in a set, usually denoted by.
Basic Definitions of Set Theory Lecture 24 Section 5.1 Fri, Mar 2, 2007.
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
Strings and Languages Denning, Section 2.7. Alphabet An alphabet V is a finite nonempty set of symbols. Each symbol is a non- divisible or atomic object.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Operations Section 2.2.
Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring.
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
Sets, Permutations, and Combinations. Lecture 4-1: Sets Sets: Powerful tool in computer science to solve real world problems. A set is a collection of.
Dr. Ameria Eldosoky Discrete mathematics
Applied Discrete Mathematics Week 1: Logic and Sets
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Set Theory.
Discrete Mathematical The Set Theory
Boolean Algebra.
Set, Combinatorics, Probability & Number Theory
Sets Section 2.1.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 2 Sets Slides are adopted from “Discrete.
… and now for something completely different…
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
Set Operations Section 2.2.
Session – 2 SETS & Operations of SETS
Discrete Mathematics CS 2610
Discrete Mathematics R. Johnsonbaugh
… and now for something completely different…
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
CSC102 - Discrete Structures (Discrete Mathematics) Set Operations
Presentation transcript:

1 Topic Sets (5.1, 5.2, 5.3)

2 Original author of the slides: Vadim Bulitko University of Alberta Modified by T. Andrew Yang

3 Sneak-preview : Sets What is a set? A collection of elements: –Order is irrelevant –No repetitions –Can be infinite –Can be empty Examples: {A, B, C} {0,1,2,3,…} N, Z, Q, R

4 Operations on sets S is a set Membership: x  S x is an element of S Subset: S 1  S Set S 1 is a subset of set S All elements of S 1 are elements of S S  S Proper subset S 1  S

5 Operations on sets S, S 1 are sets Equality: S = S 1 iff they have the same elements Difference: S - S 1 is a set of all elements that belong to S but NOT to S 1 {A,B,C} - {A,B,X,Y} = {C} {A,B,X,Y} – {A,B,C} = {X,Y}

6 Operations on sets S, S 1 are sets Intersection: S  S 1 is a set of all elements that belong to both S and S 1 {A,B,C}  {A,B,X,Y} = {A,B} Union: S  S 1 is a set of all elements that belong to either S or S 1 {A,B,C}  {A,B,X,Y} = {A,B,C,X,Y}

7 Interesting Properties of Sets S, S 1 are sets Then S – S 1 = S – (S  S 1 ) S = S 1  S – S 1 = Φ (S  S 1 ) – S 1 = S – S 1 Use a Venn diagram to see more properties S 1  S  S 1 - S = ? S 1  S  S 1  S = ? S 1  S  S 1  S = ? (S 1 – S)  (S - S 1 ) = ? Is S – (S 1  S) = (S –S 1 )  S ? Is (S  S 1 ) – S 1 = S  (S 1 – S 1 ) ?

8 More notation In mathematics, sets are often specified with a predicate and an enveloping set as follows: S={x  A | P(x)} S is the set of all elements of A that satisfy predicate P Example: Q={x  R |  a,b  Z b  0 & x=a/b}

9 Set Equality Two sets are equal iff they have the same elements Theorem: for any sets A and B, A=B iff A  B & B  A Proof

10 Subset and Membership Book example  {1,2,3} ? {2}  {1,2,3} ? 2  {1,2,3}? {2}  {1,2,3}? {2}  {{1},{2}}? {2}  {{1},{2}}? Given a set A, the power set of A, P (A), is the set of all subsets of A.

11 Universal Set If we are dealing with sets S 1, S 2, …, S n which are all subsets of a larger set U, then U is called the universal set of S 1, S 2, …, S n. All of S 1, S 2, …, S n are subsets of U When does such a U exist? Always, for we can set U to be the union of all sets involved e.g., Given sets A, B, and C: U = A  B  C ... e.g., A = all students taking math3331 in summer 2008, B = all students taking csci3134 in summer 2008, C = all students taking cinf3132 in summer 2008: What could be the universal set (or the universe of discourse)? Another example?

12 Complement So if I am dealing with set A which is a subset of the universal set U then: I can define complement of A as: A C = U - A That is the set of all elements (of U) that are not in A Often “of U” is dropped and people say that A C is the set of everything that is not in A

13 Quick questions What is the complement of U? U C = Ø What set has U as its complement? Ø C = U

14 Sets & Predicate Logic All of the set operations and relations above can be defined in terms of Boolean connectives: A  B={x | x  A v x  B} A  B={x | x  A & x  B} A-B={x | x  A & not x  B} A C ={x | not x  A} A=B iff  x x  A  x  B A  B iff  x x  A  x  B A  B iff (  x x  A  x  B) & not A=B

15 Symmetric Difference C=A  B Set C is the symmetric difference of sets A and B iff every element of C belongs to A or B but not both  A  B  C [C=A  B   a (a  C  (a  A xor a  B))]

16 Examples A={1,2}, B={2,3} A  B={1,3} A={Clinton,Reagan}, B={Gorbachov,Bregnev} A  B={Clinton,Reagan,Gorbachov,Bregnev} A={CMPUT272 students}, B={CMPUT272 students} A  B = {} A  A = {}

17 Exercise 2 Intersection of two sets is contained in their union:  A  B [ (A  B)  (A  B) ] Proof:

18 Exercise 3 Union is commutative  A  B [ A  B = B  A ]

19 Exercise 4 Intersection is commutative  A  B [ A  B = B  A ] Proof: very similar to the one we just did. Try it yourself.

20 Exercise 5 Intersection distributes over union:  A  B  C [ A  (B  C) =(A  B)  (A  C) ] Note: There is an analogy between logical operations v and & and arithmetic operations: v feels like + & feels like * So A & (B v C) = A & B v A & C [just like A*(B+C) = A*B + A*C] How about A+(B*C) --- is it (A+B)*(A+C)? NO So what about A v (B & C) = (A v B) & (A v C)?

21 The Analogy The analogy is incomplete: –Arithmetic: A+(B*C)  (A+B)*(A+C) –Logic: A v B&C = (A v B) & (A v C) Proof of the latter:

22 Exercise 6 In Exercise #5 we proved:  A  B  C [ A  (B  C) =(A  B)  (A  C) ] using the fact that A&(B v C)=A&B v A&C Given the statement just proved A v B&C = (A v B) & (A v C) What can we now prove in terms of sets? Union distributes over intersection:  A  B  C [ A  (B  C) =(A  B)  (A  C) ]

23 Proof of Exercise 6

24 More Identities See Theorem (set identities) in the book, p.272 –An identity is an equation that is universally true for all elements in some set. The proofs can often be done using: –the logical definitions of set operations –logical identities we have proven before Do some of them as an exercise

25 Boolean Algebra Are the similarities between set identities and logical identities incidental? It turns out that both systems are examples of a more general construct called Boolean algebra

26 Boolean Algebra Boolean algebra is given by a set S and two operations: + and * defined over it such that the following identities hold (here a and b are arbitrary elements of S): a+b = b+a a*b = b*a (a+b)+c = a+(b+c) (a*b)*c = a*(b*c) a*(b+c) = a*b+a*c a+(b*c) = (a+b)*(a+c) There exist distinct 0,1 in S: a+0 = a a*1 = a For each a from S there exists a complement a’ such that: a+a’ = 1 a*a’ = 0

27 Boolean Algebra Logic Sets S{true,false}P(U) (i.e., all sets) +v  *&  a+b=b+aavb=bvaa  b=b  a a*b=b*aa&b=b&aa  b=b  a (a+b)+c=a+(b+c)(avb)vc=av(bvc)(a  b)  c=a  (b  c) (a*b)*c=a*(b*c)(a&b)&c=a&(b&c)(a  b)  c=a  (b  c) a*(b+c)=(a*b)+(a*c)a&(bvc)=(a&b)v(a&c)a  (b  c)=(a  b)  (a  c) a+(b*c)=(a+b)*(a+c)av(b&c)=(avb) & (avc)a  (b  c)=(a  b)  (a  c) 0 falseØ 1 trueU a+0=aa v false = aa  Ø = a a*1=aa & true = aa  U = a complement (a’)~aa C a+a’=1a v ~a = truea  a C = U a*a’=0a & ~a = falsea  a C = Ø

28 Questions?