Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department.

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

Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
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.
Denoting the beginning
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 Mathematics Lecture 4 Harper Langston New York University.
Chapter 2 The Basic Concepts of Set Theory
Discrete Mathematics Lecture 5
Sets 1.
Sets 1.
1 Set Theory. 2 Set Properties Commutative Laws: Associative Laws: Distributive Laws:
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.
Mathematics.
Operations on Sets – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Operations on Sets Reading: Kolman, Section 1.2.
Set theory Sets: Powerful tool in computer science to solve real world problems. A set is a collection of distinct objects called elements. Traditionally,
2.1 – Sets. Examples: Set-Builder Notation Using Set-Builder Notation to Make Domains Explicit Examples.
Chapter 3 – Set Theory  .
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Set, Combinatorics, Probability & Number Theory Mathematical Structures for Computer Science Chapter 3 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Set,
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:
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
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.
CS201: Data Structures and Discrete Mathematics I
CompSci 102 Discrete Math for Computer Science
Copyright © Cengage Learning. All rights reserved.
Week 6 - Friday.  What did we talk about last time?  Solving recurrence relations.
ELEMENTARY SET THEORY.
Discrete Mathematical Structures 4 th Edition Kolman, Busby, Ross © 2000 by Prentice-Hall, Inc. ISBN
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.
Introduction to Set theory. Ways of Describing Sets.
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.
Discrete Mathematics CS 2610 August 31, Agenda Set Theory Set Builder Notation Universal Set Power Set and Cardinality Set Operations Set Identities.
Basic Probability. Introduction Our formal study of probability will base on Set theory Axiomatic approach (base for all our further studies of probability)
Week 15 - Wednesday.  What did we talk about last time?  Review first third of course.
Thinking Mathematically Venn Diagrams and Set Operations.
The Basic Concepts of Set Theory. Chapter 1 Set Operations and Cartesian Products.
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)
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.
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.
Set. Outline Universal Set Venn Diagram Operations on Sets.
Dr. Ameria Eldosoky Discrete mathematics
CHAPTER 3 SETS, BOOLEAN ALGEBRA & LOGIC CIRCUITS
Set Theory.
Lecture 04 Set Theory Profs. Koike and Yukita
Set, Combinatorics, Probability & Number Theory
Sets Section 2.1.
Week 7 - Monday CS322.
Chapter 5, Set Theory 1.
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.
Exercises Show that (P  Q)  (P)  (Q)
CS100: Discrete structures
Set Operations Section 2.2.
The Basic Concepts of Set Theory
Session – 2 SETS & Operations of SETS
Discrete Mathematics R. Johnsonbaugh
Sets & Set Operations.
Presentation transcript:

Discrete Structures Chapter 3 Set Theory Nurul Amelina Nasharuddin Multimedia Department

Basics of Set Theory Sets are used to group objects together Set notation: {1, 2, 3}, {{1, 2}, {3}, {1, 2, 3}}, {1, 2, 3, …}, , {x  R | -3 < x < 6} Set A is called a subset of set B, written as A  B, when  x, x  A  x  B (A is contained in B and B contains A)  is a subset for every set Any set is a subset of itself Visual representation of the sets Distinction between  and 

Basics of Set Theory A is a proper subset of B, written as A  B, when A is a subset of B and  x  B and x  A (every element A is in B but there is at least one element B not in A) When A is a proper subset of B, A  B Eg: The set of all men is a proper subset of the set of all people. {1, 3}  {1, 2, 3, 4} {1, 2, 3, 4}  {1, 2, 3, 4}

Example Let U = {1, 2, 3, 4, 5, 6, x, y, {1, 2}, {1, 2, 3}, {1, 2, 3, 4}} Then |U| = 11. (a)If A = {1, 2, 3, 4} then |A| = 4 and A  U A  U A  U {A}  U {A}  U{A}  U (b) Let B = {5, 6, x, y, A} = {5, 6, x, y, {1, 2, 3, 4}}. Then |B| = 5, not 8. And A  B {A}  B {A}  B {A}  B A  B (that is, A is not a subset of B) A  B (that is, A is not a proper subset of B).

Cardinality of Sets If A is a finite set, then cardinality of A, denoted by n(A) or |A|, the number of elements A contains Eg: A = {x, y, z}. n(A) = 3 Eg: Let S be the set of odd positive integers less than 10 Then |S| = 5 We see that A  B  |A|  |B|, and A  B  |A|  |B|.

Example For U = {1, 2, 3, 4, 5}, A = {1, 2}, and B = {1, 2}, we see that A is a subset of B (that is, A  B), but it is not a proper subset of B (or, A  B). A  B  |A|  |B|, 2  2 so it is true that A  B A  B  |A|  |B|, 2  2 false so it is false that A  B.

Set Operations Set A equals set B, written A = B, iff every element of set A is in set B and vice versa (A  B and B  A) Proof technique for showing sets equality Eg: Let A = {n  Z | n = 2p, for some integer p}, B = {k  Z | k = 3r + 1, for some integer r}. Is A = B? Ans: No. 2  A since 2 = 2(1); but 2  B. 3r + 1= 2 3r = 1 r= 1/3 (not an integer), so 2  B There is an element in A that not in B, A  B.

Set Operations Union of two sets (A  B) is a set of all elements that belong to at least one of the sets Intersection of two sets (A  B) is a set of all elements that belong to both sets Difference of two sets (B – A) is a set of elements in one set, but not the other Complement of a set (A c or ) is a difference between universal set and a given set Symmetric difference of two sets (A  B) is the set that contains the elements which is in A but not in B and in B but not in A

Set Operations Symbolically: A  B = {x  U | x  A or x  B} A  B = {x  U | x  A and x  B} B – A = {x  U | x  B and x  A} A c = {x  U | x  A} A  B = {x | x  A  B but x  A  B} Eg: Let U = {a, b, c, d, e, f, g}, A = {a, c, e, g}, B = {d, e, f, g} A  B = A c = A  B =A  B = {a, c, d, f} B – A =

Venn Diagrams Union Intersection Difference ( A – B)Complement Difference

Empty Set Empty set (null set) is the set containing no elements Denoted by  or {} Eg: {1, 3}  {2, 5} =  Eg: Describe the set D = {x  R | 3  x  2}  D =  Empty set is a subset of any set There is exactly one empty set

Disjoint Set Two sets are disjoint, iff they have no elements in common A and B are disjoint, A  B =  Eg: Are A = {1, 3, 5} and B = {2, 4, 6} disjoint? Yes. {1, 3, 5}  {2, 4, 6} =  Sets A 1, A 2, …, A n are mutually disjoint, iff no two sets A i and A j with distinct subscripts have any elements in common A i  A j =  whenever i  j Eg: Are B 1 = {2, 4, 6}, B 2 = {3, 7}, B 3 = {4, 5} mutually disjoint? No. B 1 and B 3 both contain 4.

Power Set Power set of A, denoted by P(A), is the set of all subsets of A Theorem: If A  B, then P(A)  P(B) Theorem: If set X has n elements, then P(X) has 2 n elements Eg: P({x, y}) = { , {x}, {y}, {x, y}}

Power Set Eg: Let C = {1, 2, 3, 4}. What is the power set of C? P(C) = { , {1}, {2}, {3}, {4}, {1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}, {1, 2, 3}, {1, 2, 4}, {1, 3, 4},{2, 3, 4}, C}

Cartesian Products Ordered n-tuple is a set of ordered n elements Two ordered n-tuples (x 1, x 2, …, x n ) and (y 1, y 2, …, y n ) are equal iff x 1 = y 1, x 2 = y 2, …, x n = y n Eg: Is (1, 2) = (2, 1)? No. By definition of equality of ordered pair, (1, 2) = (2, 1)  1 = 2 and 2 = 1 Cartesian product of A and B, denoted by A x B, is the set of all ordered pairs (a, b) where a is in A and b is in B. A x B = {(a, b) | a  A and b  B} Eg: Let A = {x, y} and B = {1, 2, 3} A x B = {(x, 1), (x, 2), (x, 3), (y, 1), (y, 2), (y, 3)}

Set Properties and Laws of Set Theory Inclusion of Intersection: A  B  A and A  B  B Inclusion in Union: A  A  B and B  A  B Transitivity of Inclusion: (A  B  B  C)  A  C Set Definitions: i.x  X  Y  x  X or x  Y ii.x  X  Y  x  X and x  Y iii.x  X – Y  x  X and x  Y iv.x  X c  x  X v.(x, y)  X  Y  x  X and y  Y

RulesName of rule A  B = A  B A  B = B  A Commutative Laws (A  B)  C = A  (B  C) (A  B)  C = A  (B  C) Associative Laws A  (B  C) = (A  B)  (A  C) A  (B  C) = (A  B)  (A  C) Distributive Laws A  U = A A   = A Identity Law A  A c =  A  A c = U Complement Law (A c ) c = ADouble Complement Law A  A = A A  A = A Idempotent Laws A   =  A  U = U Universal Bound Laws (A  B) c = A c  B c (A  B) c = A c  B c De Morgan’s Laws A  (A  B) = A A  (A  B) = A Absorption Laws A – B = A  B c Set Difference Law U c =   c = U Complements of U and  If A  B, then A  B = A and A  B = B Intersection and Union with a subset

Formal Proving for Set Identities Basic method for proving that sets are equal: Let sets X and Y be given. To prove that X = Y: 1.Prove that X  Y 2.Prove that Y  X.

Proving: Distributive Law Proof by cases Prove that A  (B  C) = (A  B)  (A  C) We must show that A  (B  C)  (A  B)  (A  C) and (A  B)  (A  C)  A  (B  C) For A  (B  C)  (A  B)  (A  C): Suppose that x  A  (B  C). Then x  A or x  (B  C) Case 1: (x  A) Since x  A, then x  A  B and also x  A  C by definition of union Hence x  (A  B)  (A  C) by definition of intersection

Case 2: (x  B  C) Since (x  B  C), then x  B and x  C Since x  B, then x  A  B and since x  C, then x  A  C by definition of union Hence x  (A  B)  (A  C) In both cases, x  (A  B)  (A  C) Hence A  (B  C)  (A  B)  (A  C) by definition of subset Do for (A  B)  (A  C)  A  (B  C)! Proving: Distributive Law Proof by cases

Prove that A  (B  C) = (A  B)  (A  C) A  (B  C) = {x | (x  A)  (x  (B  C))} = {x | (x  A)  (x  B  x  C)} = {x | ((x  A)  (x  B))  ((x  A)  (x  C))} = {x | (x  A  B)  (x  A  C)} = (A  B)  (A  C) Proving: Distributive Law Proof by cases

Prove that (A  B) c = A c  B c (A  B) c = {x | x  (A  B)} = {x | ~ (x  A  x  B)} = {x | ~ (x  A)  ~ (x  B)} = {x | x  A  x  B} = {x | x  A c  x  B c } = {x | x  (A c  B c )} = A c  B c Proving: De Morgan’s Law Proof by cases

Algebraic Proofs of Set Identities Can use set identities to derive new set identities or to simplify a complicated set expression, eg. (A  B) c  A c  B c Eg: Prove that (A  B) – C = (A – C)  (B – C) (A  B)–C= (A  B)  C c by the set difference law = C c  (A  B) by the comm. law = (C c  A)  (C c  B) by the distributive law = (A  C c )  (B  C c ) comm. law = (A - C)  (B - C) by the set difference law

Example of Simplification Using laws of set theory, simplify the expression: De Morgan’s Law Double Complement Law Associative Law Commutative Law Associative Law Absorption Law

Membership table To establish set equalities We observe that for sets A, B  U, an element x  U satisfies exactly one of the following four situations: a)x  A, x  B b)x  A, x  B c)x  A, x  B d)x  A, x  B When x is an element of a given set, we write a 1(T); when x is not in the set, we enter a 0 (F). 3 rd row of the table shows that x  A, but x  B. So, x  A  B but x is in A  B. ABAcAc A  BA  B

Membership Table Using membership table, prove the A  (B  C) = (A  B)  (A  C) ABC B  CA  (B  C)A  BA  C(A  B)  (A  C) Since these columns are identical, A  (B  C) = (A  B)  (A  C)

Duality The dual of s, denoted s d is obtained from a statement, s by replacing –  by U and U by  and –  by  and  by  Eg: s: s d :

Counting and Venn Diagrams By using Venn diagrams, show that For example, Set = regions 1, 3, 4, 6; while set = regions 1, 2, 4, 7. Therefore, = regions 1, 4. Set C = regions 4, 6, 7, 8; therefore set = regions 1, 2, 3, 5. = regions 1, 2, 3, 4, 5. ?

Counting and Venn Diagrams If A and B are finite sets, then n(A  B) = n(A) + n(B) - n(A  B). In particular, if A and B are disjoint then n(A  B) = n(A) + n(B). If A and B are finite sets, then n(AB) = n(A)*n(B)

Example In a class of 50 college freshmen, 30 are studying C++, 25 are studying Java, and 10 are studying both languages. How many freshmen are studying either computer language? We let U be the class of 50 freshmen, A is the subset of those students studying C++, and B is the subset of those studying Java. n(A) = 30, n(B) = 25, n(A  B) = 10 n(A  B) = n(A) + n(B) - n(A  B) = – 10 = 45