Lecture 6 Set Theory.

Slides:



Advertisements
Similar presentations
More Set Definitions and Proofs 1.6, 1.7. Ordered n-tuple The ordered n-tuple (a1,a2,…an) is the ordered collection that has a1 as its first element,
Advertisements

Discrete Mathematics I Lectures Chapter 6
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
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
Week 21 Basic Set Theory A set is a collection of elements. Use capital letters, A, B, C to denotes sets and small letters a 1, a 2, … to denote the elements.
1 Section 1.7 Set Operations. 2 Union The union of 2 sets A and B is the set containing elements found either in A, or in B, or in both The denotation.
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.
CSE115/ENGR160 Discrete Mathematics 02/14/12 Ming-Hsuan Yang UC Merced 1.
1 CSE 20: Lecture 7 Boolean Algebra CK Cheng 4/21/2011.
Lecture 3 Operations on Sets CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Operations on Sets – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Operations on Sets Reading: Kolman, Section 1.2.
Section Section Summary Introduction to Boolean Algebra Boolean Expressions and Boolean Functions Identities of Boolean Algebra Duality The Abstract.
Chapter 2 The Basic Concepts of Set Theory © 2008 Pearson Addison-Wesley. All rights reserved.
Partially borrowed from Florida State University
Course Outline Book: Discrete Mathematics by K. P. Bogart Topics:
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Sets.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
CS201: Data Structures and Discrete Mathematics I
CompSci 102 Discrete Math for Computer Science
SECTION 2-3 Set Operations and Cartesian Products Slide
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Basic Structure : Sets, Functions, Sequences, and Sums Sets Operations.
Chapter 2 With Question/Answer Animations. Section 2.1.
Discrete Mathematics SETS. What is a set? ^A set is a unordered collection of “objects”  People in a class: {A yşe, B arış, C anan }  Cities in Turkey.
Discrete Mathematics. Set Theory - Definitions and notation A set is an unordered collection of elements. Some examples: {1, 2, 3} is the set containing.
Discrete Mathematics CS 2610 January 27, part 2.
Discrete Mathematics Set.
1 Section 1.2 Sets A set is a collection of things. If S is a set and x is a member or element of S we write x  S. Othewise we write x  S. The set with.
Module #3 - Sets 3/2/2016(c) , Michael P. Frank 2. Sets and Set Operations.
Set Operations Section 2.2.
1 Set Theory Second Part. 2 Disjoint Set let A and B be a set. the two sets are called disjoint if their intersection is an empty set. Intersection of.
Notions & Notations (2) - 1ICOM 4075 (Spring 2010) UPRM Department of Electrical and Computer Engineering University of Puerto Rico at Mayagüez Spring.
Basic Probability. Introduction Our formal study of probability will base on Set theory Axiomatic approach (base for all our further studies of probability)
Lecture 5 Set Theory. Plan of lecture Why set theory? Sets and their properties Membership and definition of sets “Famous” sets Types of variables and.
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)
CPCS 222 Discrete Structures I
Section 6.1 Set and Set Operations. Set: A set is a collection of objects/elements. Ex. A = {w, a, r, d} Sets are often named with capital letters. Order.
Set. Outline Universal Set Venn Diagram Operations on Sets.
Dr. Ameria Eldosoky Discrete mathematics
Applied Discrete Mathematics Week 1: Logic and Sets
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Discrete Structures – CNS 2300
Discrete Mathematical The Set Theory
Chapter 11 (Part 1): Boolean Algebra
Set, Combinatorics, Probability & Number Theory
Sets Section 2.1.
Week 7 - Monday CS322.
What is Probability? Quantification of uncertainty.
Chapter 5, Set Theory 1.
CS1022 Computer Programming & Principles
The Basic Concepts of Set Theory
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.
The Basic Concepts of Set Theory
Week #2 – 4/6 September 2002 Prof. Marie desJardins
Discrete Mathematics R. Johnsonbaugh
CS 250, Discrete Structures, Fall 2013
… and now for something completely different…
CSC102 - Discrete Structures (Discrete Mathematics) Set Operations
Presentation transcript:

Lecture 6 Set Theory

Plan of lecture Algebra of sets Laws of the algebra of sets Proofs with algebra of sets Cardinality of sets Principle of inclusion and exclusion Ordered pairs and Cartesian product

Algebra of sets (aka Mathematic Structure) Various properties of sets can be derived using the operations such as union, intersection, etc. Some are obvious, some aren’t They all need proofs, though! Proofs exploit correspondence between logic/sets Set Logic  not  or  and  

Example Solution Prove that for any sets A and B, (A  B) = A  B (A  B) = {x : x  (A  B)} = {x : not(x  (A  B))} = {x : not((x  A) and (x  B))} = {x : not(P and Q)} A  B = {x : (x  A) or (x  B)} = {x : (not(x  A)) or (not(x  B))} = {x : (not(P)) or (not(Q))} P Q not P not Q P and Q not (P and Q) (not P) or (not Q) T F

Example (2) Since the predicates defining (A  B) and A  B are equivalent, we have (A  B) = A  B The logical expressions show one of “De Morgan’s Laws”. The set expressions follow the same pattern. Fundamental properties of sets Principles of the algebra of sets In the following tables, notice left- and right-hand sides for union and intersection. Augustus De Morgan

Laws of the algebra of sets (1) Associativity Laws A  (B  C) = (A  B)  C A  (B  C) = (A  B)  C Commutative Laws A  B = B  A A  B = B  A Identity Laws A   = A A  U = A A  U = U A   = 

Laws of the algebra of sets (2) Idempotent Laws A  A = A A  A = A Distributive Laws A(BC) = (AB)(AC) A(BC) = (AB)(AC) Complement Laws A  A = U A  A =  U =   = U (A) = A Universe of Discourse. Universe of Discourse. De Morgan’s Laws (A  B) = A  B (A  B) = A  B

Proofs with laws of algebra (1) We can use the laws to prove further results Prove that for any sets A and B, A  B = (A  B)  (A  B)

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) The claim

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) The claim [De Morgan’s Laws]

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) = ((A  B)  (A))  ((A  B)  (B)) The claim [De Morgan’s Laws] [Distributive Laws]

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) = ((A  B)  (A))  ((A  B)  (B)) = ((A)  (A  B))  ((B)  (A  B)) The claim [De Morgan’s Laws] [Distributive Laws] [Commutative Laws]

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) = ((A  B)  (A))  ((A  B)  (B)) = ((A)  (A  B))  ((B)  (A  B)) = (((A)  A)  ((A)  B)))  (((B)  A)  ((B)  B))) The claim [De Morgan’s Laws] [Distributive Laws] [Commutative Laws]

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) = ((A  B)  (A))  ((A  B)  (B)) = ((A)  (A  B))  ((B)  (A  B)) = (((A)  A)  ((A)  B)))  (((B)  A)  ((B)  B))) = ((A  (A))  (B  (A)))  ((A  (B))  (B  (B))) The claim [De Morgan’s Laws] [Distributive Laws] [Commutative Laws]

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) = ((A  B)  (A))  ((A  B)  (B)) = ((A)  (A  B))  ((B)  (A  B)) = (((A)  A)  ((A)  B)))  (((B)  A)  ((B)  B))) = ((A  (A))  (B  (A)))  ((A  (B))  (B  (B))) = (  (B  (A)))  ((A  (B))  ) The claim [De Morgan’s Laws] [Distributive Laws] [Commutative Laws] [Complement Laws]

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) = ((A  B)  (A))  ((A  B)  (B)) = ((A)  (A  B))  ((B)  (A  B)) = (((A)  A)  ((A)  B)))  (((B)  A)  ((B)  B))) = ((A  (A))  (B  (A)))  ((A  (B))  (B  (B))) = (  (B  (A)))  ((A  (B))  ) = (B  (A))  ((A  (B)) The claim [De Morgan’s Laws] [Distributive Laws] [Commutative Laws] [Complement Laws] [Identity Laws]

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) = ((A  B)  (A))  ((A  B)  (B)) = ((A)  (A  B))  ((B)  (A  B)) = (((A)  A)  ((A)  B)))  (((B)  A)  ((B)  B))) = ((A  (A))  (B  (A)))  ((A  (B))  (B  (B))) = (  (B  (A)))  ((A  (B))  ) = (B  (A))  ((A  (B)) = ((A  (B))  (B  (A)) The claim [De Morgan’s Laws] [Distributive Laws] [Commutative Laws] [Complement Laws] [Identity Laws]

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) = ((A  B)  (A))  ((A  B)  (B)) = ((A)  (A  B))  ((B)  (A  B)) = (((A)  A)  ((A)  B)))  (((B)  A)  ((B)  B))) = ((A  (A))  (B  (A)))  ((A  (B))  (B  (B))) = (  (B  (A)))  ((A  (B))  ) = (B  (A))  ((A  (B)) = ((A  (B))  (B  (A)) = (A  B)  (B  A) The claim [De Morgan’s Laws] [Distributive Laws] [Commutative Laws] [Complement Laws] [Identity Laws] clean up extra brackets

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) = ((A  B)  (A))  ((A  B)  (B)) = ((A)  (A  B))  ((B)  (A  B)) = (((A)  A)  ((A)  B)))  (((B)  A)  ((B)  B))) = ((A  (A))  (B  (A)))  ((A  (B))  (B  (B))) = (  (B  (A)))  ((A  (B))  ) = (B  (A))  ((A  (B)) = ((A  (B))  (B  (A)) = (A  B)  (B  A) = definition above The claim [De Morgan’s Laws] [Distributive Laws] [Commutative Laws] [Complement Laws] [Identity Laws] clean up extra brackets

Proofs with laws of algebra (2) Solution By definition, A  B = (A  B)  (B  A), now (A  B)  (A  B) = (A  B)  ((A)  (B)) = ((A  B)  (A))  ((A  B)  (B)) = ((A)  (A  B))  ((B)  (A  B)) = (((A)  A)  ((A)  B)))  (((B)  A)  ((B)  B))) = ((A  (A))  (B  (A)))  ((A  (B))  (B  (B))) = (  (B  (A)))  ((A  (B))  ) = (B  (A))  ((A  (B)) = ((A  (B))  (B  (A)) = (A  B)  (B  A) is the definition above Hence A  B = (A  B)  (A  B) as claimed!! The claim [De Morgan’s Laws] [Distributive Laws] [Commutative Laws] [Complement Laws] [Identity Laws] clean up extra brackets

Proofs with laws of algebra (3) We started from the claim, and obtained definition We can start from definition, and work towards claim We can start from both ends, and meet “in the middle” Whichever way, we must use the laws at each step Notice that A, B in the laws may be sets with operations, not necessarily a set: ((A  B)  (C  D))   = E   =  (A  (B – C))  (A  (B – C)) = D  D = D = (A  (B – C))

Cardinality of sets We sometimes need to count elements of sets For instance, we might need to make provisions for their implementation, so we need to consider how much space needed... The cardinality of a finite set S is the number of elements in S, represented as |S| Examples: A = {1, 2, 34, 3}; |A| = 4 B = {bob, sue, 3, sue} = {bob, sue, 3}; |B| = 3 || = 0: the cardinality of the empty set is zero

Principle of inclusion & exclusion (1) Counting rule for the union of two sets: |A  B| = |A| + |B| – |A  B| Venn diagram: A  B = (A – B)  (A  B)  (B – A) Proof: suppose that |A – B|= m |A  B| = n |B – A|= p Then, |A  B| = |A – B| + |A  B| + |B – A| = m + n + p = (m + n) + (n + p) – n = |A| + |B| – |A  B| (add the sections and see for yourself) To avoid double counting. A B A–B AB B–A

Principle of inclusion & exclusion (2) Example: 63 first-year students choose optional courses 16 chose Accounting 37 chose Business 5 chose both Accounting and Business How many took neither Accounting or Business? Solution: U = {all first-year students who chose optional courses} A = {students who took Accounting} B = {students who took Business} Then |A| = 16, |B| = 37 and |A  B| = 5. |U| = 63. So |A  B| = |A| + |B| – |A  B| = 16 + 37 – 5 = 48 Hence, 63 – 48 = 15 students took neither A B A–B AB B–A

Ordered pairs & Cartesian product (1) An ordered pair is (a, b), where a is an element of a set A (a  A) b is an element of a set B (b  B) The set of all ordered pairs of sets A and B is called the Cartesian product of A and B, denoted by A  B Formally: A  B = {(a, b) : (a  A) and (b  B)} Important operation for Functions & relations (very important for computing) Information modelling

Ordered pairs & Cartesian product (2) Let A = {coffee, tea} and B = {cake, muffin, donut} A  B = {(coffee,cake),(coffee,muffin),(coffee,donut), (tea,cake),(tea,muffin),(tea,donut)} B  A = {(cake,coffee),(muffin,coffee),(donut,coffee), (cake,tea),(muffin,tea),(donut,tea)} B  B = {(cake,cake),(cake,muffin),(cake,donut), (muffin,cake),(muffin,muffin),(muffin,donut), (donut,cake),(donut,muffin),(donut,donut)}

Ordered pairs & Cartesian product (3) if A  B, then A  B  B  A If |A| m and |B| n, then |A  B| mn Let R be the set of real numbers The set R  R or R2 are all pairs of real numbers (x, y) The elements of R2 can be displayed as coordinates of a two-dimensional space R2 is called the Cartesian plane y x (3,2)

Ordered pairs & Cartesian product (4) Given a collection of sets A1, A2,..., An We can define its Cartesian product as A1  A2  ...  An = {(a1, a2, ..., an) : ai  Ai, i = 1, 2, ..., n} If A1 = A2 = ... = An (the same set) then we write An for the Cartesian product of n copies of A Example: Let B = {0,1}; describe the set Bn Solution: the elements of Bn are lists of zeros and ones of length n There are also called bit strings of size n

Summary You should now know: Laws of the algebra of sets How to use the laws when proving claims Cardinality of sets Principle of inclusion and exclusion Cartesian product Cartesian plane Bit strings

Further reading R. Haggarty. “Discrete Mathematics for Computing”. Pearson Education Ltd. 2002. (Chapter 3) Wikipedia’s entry Wikibooks entry