20104136 ----set operations

Ramkumar2162 63 views 14 slides Sep 20, 2021
Slide 1
Slide 1 of 14
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14

About This Presentation

set operation


Slide Content

BY
D.SHANMUGAPRIYA

SECTION SUMMARY
Set operations
Union
Intersection
Complementation
Difference
More on set cardinality
Set identities
Proving identities
Membership tables

UNION
DEFINITION:
Let A and B be sets.theunion of the sets A and B
,denoted by AUB,isthe set:

Example:whatis{1,2,3} U {3,4,5}?
Solution:{1,2,3,4,5}
{X|XE A V XE B}
U
A B

INTERSECTION
Definition:Theintersection of sets A and B,denotedby
AnB,is
Then A and B are said to be disjoint
Example:whatis {123}n {345}
Solution:[3]
{X|X E A ^ X E B
U
A B

COMPLEMENTED
Definition:IfA is set,thenthe complement of the A
denoted by A is the set U-A
Example:ifU is the positive integers less than 100,what is
the complement of{x |x>70}
A={X E U| X E|A
A
AA

DIFFERENCE
Definition:LetA and B be sets.thedifference ofAand B
,denoted by A-B,isthe set containing the elements of A
that are not inB,
The difference of A and B is called complement of B with
respect to A.
Venn diagram A-B
A-B={X|X E A^ X E B}=AnB
COMPLEMENT
A B
U

CARDINATY OF THE UNION
OF TWO SETS
EXAMPLE:
 Let A be the math majors in your class and B be the
CS majors.
To count the number of students who are either math
major or CS major,addthe number of math majors and the
numbers of CS majors,andsubtract the number of joints
CS\math majors.

REVIEW QUESTIONS
1.Example:U={0,1,2,3,4,5,6,7,8,9,10}A={1,2,3,4,5},B={4
,5,6,7,8}
2.AUB:{1,2,3,4,5,6,7,8}
3.AnB;{4,5}
4.A COMPLEMENT:{0,6,7,8,9,10}
5.B COMPLEMENT:{O,1,2,3,9,10}
6.A-B:{1,2,3}
7.B-A:{6,7,8}

SYMMETRIC DIFFERENCE
Definition:Thesymmetric difference of AandB
denoted by AOB is the set
(A-B)U(B-A)
EXAMPLE:
U={0,1,2,3,4,5,6,7,8,9,10}
A={1,2,3,4,5} B={4,5,6,7,8}
SOLUTION:
{1,2,3,6,7,8}
A B
dffierenced

VENN DIAGRAM WITH 3 SETS
A
AUB
BnC
C”
AnBnC
2 3
1 8
5 C
A
B
C
U
9

SET IDENTITES
IDENTITY LAWS
A U =A AnU=A
Domination laws
AuU=U An=0
Idempotent laws
AUA=A AnA=A
Complementation law
(A)=A

TYPES OF LAWS
COMMUTATIVE LAWS
 AUB=BUA ANB=BnA
ASSOCIATIVE LAWS
AU(BUC)=(AUB)UC
 An(BnC)=(AnB)nC
DISTRIBUTIVE LAWS
 An(BUC)=(AnB)U(AnC)
 AU(BnC)=(AU B)n(AUC)

PROVING SET IDENTITES
Different ways to prove set identites:
Prove that each set is a subset of the other.
Use set builder notation and propositional logic.
membership tables:verifythat elements in the same
combination of sets always either belong or do not belong
to the same side of the identity.
Use 1 to indicate it is the set and a 0 to indicate that it is
not.

CONCLUSION
Restored sets of values in a dynamic databases are simply
read and write operations with respect to the databases
respectively.althoughthe values used during restortation
are typically two operations reading and writing.