Download presentation
Presentation is loading. Please wait.
1
Sets & Set Operations
2
Basic discrete structures
Discrete math: Study of the discrete structures used to represent discrete objects Many discrete structures are built using sets Sets : collection of objects Examples of discrete structures built with the help of sets: Combinations Relations Graphs
3
Set Definition: A set is a (unordered) collection of objects. These objects are sometimes called elements or members of the set.(Cantor's naive definition). A naïve theory in the sense of "naïve set theory" is a non-formalized theory, that is, a theory that uses a natural language to describe sets and operations on sets.
4
Examples: – Vowels in the English alphabet V = { a, e, i, o, u } – First seven prime numbers. X = { 2, 3, 5, 7, 11, 13, 17 }
5
Representing sets Representing a set by:
1) Listing (tabulation method)) the members of the set. 2) Definition by property, using the set builder notation.(Rule method) {x| x has property P}. Example: Even integers between 50 and 63. 1) E = {50, 52, 54, 56, 58, 60, 62} 2) E = {x| 50 <= x < 63, x is an even integer}
6
If enumeration of the members is hard we often use ellipses.
Example: a set of integers between 1 and 100 A= {1,2,3 …, 100} Rational numbers Q = {p/q | p ∈ Z, q ∈ Z, q ≠ 0}
7
Set can be Finite set Infinite set Singleton set
8
A set is determined only when we know definitely what object it contains. There must be no ambiguity or doubt in this regard. Example: The collection of all tall students in a college does not define a set. Because there will always be some doubt about as to which boys are to be regarded as tall. For this reason the objects of a set are required to be “well defined”. Thus, if we speak of the collection of all students in a college who are above 170cms then we are actually speaking of set.
9
Interval Notation
10
Universal Set and Empty Set
The universal set U is the set containing everything currently under consideration. Content depends on the context. Sometimes explicitly stated, sometimes implicit. The empty set is the set with no elements. Symbolized by ∅ or { }
11
Things to remember
12
Equal sets Definition: Two sets are equal if and only if they have the same elements. Example: • {1,2,3} = {3,1,2} = {1,2,1,3,2} Note: Duplicates don't contribute anything new to a set, so remove them. The order of the elements in a set doesn't contribute anything new.
13
Subsets Definition: A set A is said to be a subset of B if and only if every element of A is also an element of B. We use A ⊆ B to indicate A is a subset of B. Example: A={1,2,3}, B={1,2,3,4,5}, C={2,3,5,6} Clearly A ⊆ B and A ⊄ C
14
Proper Subset proper subset / strict subset A⊂B In the example
We observe that the set B which contains A as subset, contains elements that are not in A. In such a situation we say that the set A is Properly contained in B or is a Proper subset of B. A⊂B proper subset / strict subset
15
Things to remember Every set is a subset of itself
Two sets A and B are equal if and only if A ⊆ B and B ⊆ A. The Null set ∅ is a subset of every set A. For any sets A,B,and C if A ⊆ B and B ⊆ C then A ⊆ C. For any sets A,B,C if A=B AND B=C, then A=C.
16
Venn Diagrams Relationship between the sets can be depicted in diagrams called Venn Diagrams. represent A ⊆ B B A
17
For any sets A,B,and C if A ⊆ B and B ⊆ C then A ⊆ C.
The truth of the above statement is obvious from the following Venn diagram. C B A
18
The Null set ∅ is a subset of every set S
19
Power Set Given a set S, the power set of S is the set of all subsets of S. The power set is denoted by P(S). Example: Consider set A={a,b} P(A)={∅, {a},{b}, {a,b}= )={∅, {a},{b}, A} If A={1,2,3} P(A)={∅,{1},{2},{3},{1,2},{2,3},{1,3},A} If a finite set A has n elements, then P(A) has 2n elements.
20
If a finite set has n elements, prove that the power set of A has 2n elements
If a finite set has n elements, then subset of A can have No element(Null set) One element(singleton set) Two elements(each combination of two elements of A) Three elements(each combination of three elements of A) …… n-1 elements and n elements(A itself) Null set( 1 in number) Singleton sets: n in number: nc1 Each combination of two elements of A gives a subset of A containing two elements: nc2 Each combination of 3 elements of A gives a subset of A containing 3 elements : nc3 ..... ncn-1 n elements… ncn Binomial theorem: (1+x)n 1+nc1+nc2+nc3……………+ncn-1+ncn= (1+1)n= 2n
21
Cardinality |{∅}| = 1
22
Set Operators: Union Definition: The union of two sets A and B is the set that contains all elements in A, B, r both. We write: AB = { x | (a A) (b B) } U A B
23
Set Operators: Intersection
Definition: The intersection of two sets A and B is the set that contains all elements that are element of both A and B. We write: A B = { x | (a A) (b B) } U A B
24
Disjoint Sets Definition: Two sets are said to be disjoint if their intersection is the empty set: A B = U A B
25
Set Difference Definition: The difference of two sets A and B, denoted A\B or A−B, is the set containing those elements that are in A but not in B U A B
26
Set Complement Definition: The complement of a set A, denoted A ($\bar$), consists of all elements not in A. That is the difference of the universal set and A: U\A A= AC = {x | x A } U A A
27
Set Complement: Absolute & Relative
The (absolute) complement of A is A=U\A The (relative) complement of A in B is B\A U U B A A A
28
Relative Compliment Given two sets A and B, the set of all the elements that belong to B but not A is called the compliment of A relative to B(or relative compliment of A in B) and is denoted as B-A B-A={x|x∈B and x ∉ A}. The set A-B(Relative compliment of B in A) can be defined similarly. B-A and A-B are not same
29
Things to remember For any sets A and B, the sets A-B and B-A are disjoint. If A and B are disjoint, then A-B=A, B-A=B. If U is a universal set and A ⊆ U, the U-A= Ac A=(A U B)-(B-A), B=(AUB)-(A-B) A=(A ∩ B)U(A-B),B=(A ∩ B)U(B-A)
30
Symmetric Difference For Two sets A and B, the releative compliment of A ∩ B in A U B is called symmetric difference of A and B denoted as A∆B or A⊖B. Simply A∆B= (A – B) ∪ (B – A) A⊖B=(A U B)-(A ∩ B ) ={x|x ∈ A U B and x ∉ A ∩ B }
31
Set Identities Identity laws A ∪ ∅ = A A ∪ U = U A ∪ A = A A ∩ U = A
Domination laws Idempotent laws Complementation law (A) = A Complement laws A ∩ A = ∅ A ∪ A = U
32
Set Identities (cont.) Commutative laws A ∪ B = B ∪ A Associative laws
A ∪ (B ∪ C) = (A ∪ B) ∪ C A ∩ (B ∩ C) = (A ∩ B) ∩ C Distributive laws A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C) A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) Absorption laws A ∪ (A ∩ B) = A De Morgan’s laws A ∪ B = A ∩ B A ∩ (A ∪ B) = A A ∩ B = A ∪ B
33
Duality Each union replaced by intersection
Each intersection replaced by union U by ∅ and ∅ by U If two sets P and Q are equal then their duals also equal.
34
Cartesian Product of sets
Definition: Let A and B be two sets. The Cartesian product of A and B, denoted AxB, is the set of all ordered pairs (a,b) where aA and bB AxB = { (a,b) | (aA) (b B) } The Cartesian product is also known as the cross product
35
A1A2… An ={ (a1,a2,…,an) | ai Ai for i=1,2,…,n}
Cartesian Product Cartesian Products can be generalized for any n-tuple Definition: The Cartesian product of n sets, A1,A2, …, An, denoted A1A2… An, is A1A2… An ={ (a1,a2,…,an) | ai Ai for i=1,2,…,n}
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.