Set operations

set is a well-defined collection of distinct elements.

Union

The union of two sets A and B is a new set containing all the elements present in either set A, B or both. It is represented as:

Example

 If set A={1,2,3,4}A = \{1, 2, 3, 4\} and B={6,7}B = \{6, 7\}

Then, AB={1,2,3,4,6,7}A \cup B = \{1, 2, 3, 4, 6, 7\}

Intersection

The intersection of two sets A and B is a set that contains all the elements common to both set A and set B.

It is represented as

Example

 If set A={1,2,3,4}A = \{1, 2, 3, 4\} and B={1,2,5}B = \{1, 2, 5\}

Then, AB={1,2}A \cap B = \{1, 2\}

Difference

The difference between two sets A and B is a set that contains all the elements of set A that are not present in set B.

It is represented as

Example

 If set A={1,2,3,4}A = \{1, 2, 3, 4\} and B={2,4,6}B = \{2, 4, 6\}

Then, AB={1,3}A - B = \{1, 3\}

Complement

The complement of a set A is a set that contains all the elements that are not present in set A but exist in the universal set UU.

It is represented as

Example

 If set U={1,2,3,4,5}U = \{1, 2, 3, 4, 5\} and A={1,2,4,6}A = \{1, 2, 4, 6\}

Then, A={3,5}A' = \{3, 5\}

Cartesian product

Given two sets A and B, the cartesian product is the set of all possible ordered pairs (a,b)(a, b), where aa is an element of set A, and bb is an element of set B. It is represented as

Cartesian product of A and B
Cartesian product of A and B

Example

 If set A={1,2,3}A = \{1, 2, 3\} and B={3,5}B = \{3, 5\}

Then, A×B={(1,3),(1,5),(2,3),(2,5),(3,3),(3,5)}A \times B= \{(1,3), (1,5), (2,3) , (2,5), (3,3), (3,5)\}

Conclusion

Set operations are fundamental mathematical concepts that allow us to combine, compare, and manipulate sets, providing valuable data organization and analysis tools.

1

What is the result of the intersection of two sets A = {2, 4, 6} and B = {3, 4, 5}?

A)

{2, 4, 6, 3, 5}

B)

{4}

C)

{ }

Question 1 of 40 attempted

Free Resources

Copyright ©2024 Educative, Inc. All rights reserved