0% found this document useful (0 votes)
40 views

Math 11 Set Operation 7

The document defines common set operations like union, intersection, difference and complement. It provides examples and explanations of how to calculate each operation on sets represented as lists of elements. It also discusses how sets can be represented using bit strings and how common set operations can be performed on those bit string representations using Boolean logic operations.

Uploaded by

raymundo gamboa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

Math 11 Set Operation 7

The document defines common set operations like union, intersection, difference and complement. It provides examples and explanations of how to calculate each operation on sets represented as lists of elements. It also discusses how sets can be represented using bit strings and how common set operations can be performed on those bit string representations using Boolean logic operations.

Uploaded by

raymundo gamboa
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

ECE

Discrete Mathematics
Set Operations
Engr. Marcelo V. Rivera
Union of Sets
A B (the union of A and B) - the set containing those
elements that are in at least one of A and B.
A B = {x | x A x B}
Example
The union of the sets {1, 3, 5} and {1, 2, 3} is:
Answer
The set {1, 2, 3, 5}; that is, {1, 3, 5} {1, 2, 3} = {1, 2, 3, 5}.
Intersection of Sets
A B (the intersection of A and B) - the set containing those
elements that are in both A and B.
A B = {x | x A x B}.
Example
The intersection of the sets {1, 3, 5} and {1, 2, 3} is?
Answer
{1, 3}; that is, {1, 3, 5} {1, 2, 3} = {1, 3}.
Disjoint
Disjoint if the two sets intersection is the empty set.

Illustrative Example:
Let A = {1, 3, 5, 7, 9} and B = {2, 4, 6, 8, 10}. Because A B = ,
A and B are disjoint.
Difference of Sets
AB (the difference of A and B) - the set containing those
elements that are in A but not in B.
Note: The difference of sets A and B is sometimes denoted by
A\B.
AB ={x | x A x B}.
Venn Diagram for the
Difference of A and B
Example
The difference of {1,3,5} and {1,2,3} is?
Answer
Set {5}; that is, {1, 3, 5} {1, 2, 3} = {5}.
Example
The difference of {1, 2, 3} and{1, 3, 5}.
Answer
Set {2}.
Complement of a Set
(the complement of A) - the set of elements in the
universal set that are not in A.
Venn Diagram for the Complement of the Set A:
= {x U | x A}.
Example
Let A = {a, e, i, o, u} (where the universal set is the set of
letters of the English alphabet). What is the complement of A?
Answer
= {b, c, d, f, g, h, j, k, l, m, n, p, q, r, s, t, v, w, x, y, z}.
Example
Let A be the set of positive integers greater than 10 (with
universal set the set of all positive integers). What is the
complement of A?
Answer
= {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
Set Identities
Example
Prove that = .
Membership Table
Membership table - a table displaying the membership of
elements in sets.
Example
Use a membership table to show that
A (B C) = (A B) (A C).
Answer
Example
(Let A, B, and C be sets. Show that = ( ( ) .
Answer
= ( ( ) bythe rst De Morgan law
= ( () by the second De Morgan law
= ( ) by the commutative law for
intersections
= ( ) by the commutative law for
unions.
Generalized Unions and Intersections
A B C and A B C
Example
Let A = {0, 2, 4, 6, 8}, B = {0, 1, 2, 3, 4}, and C = {0, 3, 6, 9}. What
are A B C and A B C?
Answer
The set A B C contains those elements in at least one of A,
B, and C. Hence, A B C = {0, 1, 2, 3, 4, 6, 8, 9}.
The set A B C contains those elements in all three of A, B,
and C. Thus, A B C = {0}.
Collection of Sets
The union of a collection of sets is the set that contains those
elements that are members of at least one set in the
collection.
A1 A2 An =
The intersection of a collection of sets is the set that
contains those elements that are members of all the sets in
the collection.
A1 A2 An =
Illustrative Example
For i = 1,2,..., let Ai ={i, i +1, i+2, ...}. Then,

and
Example
Suppose that Ai ={1, 2, 3, ..., i} for i = 1, 2, 3, .... Then, and is:
Answer

Computer Representation of Sets


Represent a subset A of U with the bit string of length n,
where the ith bit in this string is 1 if ai belongs to A and is 0 if
ai does not belong to A.
Example
Let U = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, and the ordering of
elements of U has the elements in increasing order; that is, a i
= i. What bit strings represent the subset of all odd integers in
U, the subset of all even integers in U, and the subset of
integers not exceeding 5 in U?
Answer
The bit string that represents the set of odd integers in U,
namely, {1, 3, 5, 7, 9}, has a one bit in the rst, third, fth,
seventh, and ninth positions, and a zero elsewhere. It is 10
1010 1010.
Similarly, we represent the subset of all even integers in U,
namely, {2, 4, 6, 8, 10}, by the string 01 0101 0101.
The set of all integers in U that do not exceed 5, namely, {1,
2, 3, 4, 5}, is represented by the string 11 1110 0000.
Example
We have seen that the bit string for the set {1, 3, 5, 7, 9} (with
universal set {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}) is 10 1010 1010. What is
the bit string for the complement of this set?
Answer
01 0101 0101, which corresponds to the set {2, 4, 6, 8, 10}.

Note: To obtain the bit string for the union and intersection of
two sets we perform bitwise Boolean operations on the bit
strings representing the two sets.
Example
The bit strings for the sets {1, 2, 3, 4, 5} and {1, 3, 5, 7, 9} are
11 1110 0000 and 10 1010 1010, respectively. Use bit strings to
nd the union and intersection of these sets.
Answer
The bit string for the union of these sets is
11 1110 0000 10 1010 1010 = 11 1110 1010, which
corresponds to the set {1, 2, 3, 4, 5, 7, 9}.
The bit string for the intersection of these sets is
11 1110 0000 10 1010 1010 = 10 1010 0000, which
corresponds to the set {1, 3, 5}.
End

You might also like