4.2 Venn Diagrams and the Complement of a Set
Venn Diagrams and the Complement of a Set
A source-bound narrated opening with a worked example, an eight-second thinking pause, a checked result, English captions, and a transcript.
Read the transcriptDownload the videoNarration credits and licences
Have you ever ordered a new dresser or bookcase that required assembly? When your package arrives you excitedly open it and spread out the pieces. Then you check the assembly guide and verify that you have all the parts required to assemble your new dresser. Now, the work begins. Luckily for you, the assembly guide includes step-by-step instructions with images that show you how to put together your product. If you are really lucky, the manufacturer may even provide a URL or QR code connecting you to an online video that demonstrates the complete assembly process. We can likely all agree that assembly instructions are much easier to follow when they include images or videos, rather than just written directions. The same goes for the relationships between sets.
Interpreting Venn Diagrams
Venn diagrams are the graphical tools or pictures that we use to visualize and understand relationships between sets. Venn diagrams are named after the mathematician John Venn, who first popularized their use in the 1880s. When we use a Venn diagram to visualize the relationships between sets, the entire set of data under consideration is drawn as a rectangle, and subsets of this set are drawn as circles completely contained within the rectangle. The entire set of data under consideration is known as the universal set.
import numpy as np
import matplotlib.pyplot as plt
# EDIT the two lines below. `a` is True inside circle A, `b` is True inside B.
NAME = "A union B"
region = lambda a, b: a or b
# others to try, in this section's notation:
# A intersection B lambda a, b: a and b
# A' lambda a, b: not a
# A' intersection B lambda a, b: (not a) and b
# (A union B)' lambda a, b: not (a or b)
# A but not B lambda a, b: a and not b
n = 420
x, y = np.meshgrid(np.linspace(-2.55, 2.55, n), np.linspace(-1.75, 1.75, n))
inA = (x + 0.6) ** 2 + y ** 2 <= 1.2 ** 2
inB = (x - 0.6) ** 2 + y ** 2 <= 1.2 ** 2
shaded = np.vectorize(region)(inA, inB)
fig, ax = plt.subplots(figsize=(6.2, 4.3))
# The raster must span EXACTLY the U rectangle: a wider extent paints the
# complement outside the universal set, which says those points are in U.
ax.imshow(shaded, extent=(-2.55, 2.55, -1.75, 1.75), origin="lower",
cmap="Blues", vmin=0, vmax=1.6, alpha=0.85, aspect="equal")
for cx, lab in ((-0.6, "A"), (0.6, "B")):
ax.add_patch(plt.Circle((cx, 0), 1.2, fill=False, lw=2, color="black"))
ax.text(cx * 2.0, 1.42, lab, fontsize=15, ha="center")
ax.add_patch(plt.Rectangle((-2.55, -1.75), 5.1, 3.5, fill=False, lw=1.5, color="black"))
ax.text(-2.38, 1.5, "U", fontsize=13)
ax.set_title("shaded region: " + NAME, fontsize=13)
ax.set_xticks([]); ax.set_yticks([])
for spine in ax.spines.values(): # only OUR rectangle should read as U
spine.set_visible(False)
plt.show()
# Two circles cut the universal set into FOUR regions. The picture and this
# table say the same thing; if you cannot see the shading, read the table.
print("the four regions of a two-set Venn diagram")
labels = {(True, True): "in both A and B (the overlap)",
(True, False): "in A but not B",
(False, True): "in B but not A",
(False, False): "in neither (outside both circles)"}
for key, text in labels.items():
print(f" {text:<34} {'SHADED' if region(*key) else 'not shaded'}")Consider the statement: All trees are plants. This statement expresses the relationship between the set of all plants and the set of all trees. Because every tree is a plant, the set of trees is a subset of the set of plants. To represent this relationship using a Venn diagram, the set of plants will be our universal set and the set of trees will be the subset. This relationship is expressed symbolically as: To create a Venn diagram, first we draw a rectangle and label the universal set “” Then we draw a circle within the universal set and label it with the word “Trees.”

This section will introduce how to interpret and construct Venn diagrams. In future sections, as we expand our knowledge of relationships between sets, we will also develop our knowledge and use of Venn diagrams to explore how multiple sets can be combined to form new sets.
So far, the only relationship we have been considering between two sets is the subset relationship, but sets can be related in other ways. Lions and tigers are both different types of cats, but no lions are tigers, and no tigers are lions. Because the set of all lions and the set of all tigers do not have any members in common, we call these two sets disjoint sets, or non-overlapping sets.
Two sets and are disjoint sets if they do not share any elements in common. That is, if is a member of set , then is not a member of set . If is a member of set , then is not a member of set . To represent the relationship between the set of all cats and the sets of lions and tigers using a Venn diagram, we draw the universal set of cats as a rectangle and then draw a circle for the set of lions and a separate circle for the set of tigers within the rectangle, ensuring that the two circles representing the set of lions and the set of tigers do not touch or overlap in any way.

Creating Venn Diagrams
The main purpose of a Venn diagram is to help you visualize the relationship between sets. As such, it is necessary to be able to draw Venn diagrams from a written or symbolic description of the relationship between sets.
Procedure
To create a Venn diagram:
- Draw a rectangle to represent the universal set, and label it .
- Draw a circle within the rectangle to represent a subset of the universal set and label it with the set name.
The Complement of a Set
If set is a proper subset of set , the universal set (written symbolically as ), then there is at least one element in set that is not in set . The set of all the elements in the universal set that are not in the subset is called the complement of set , . In set builder notation this is written symbolically as: The symbol is used to represent the phrase, “is a member of,” and the symbol is used to represent the phrase, “is not a member of.” In the Venn diagram below, the complement of set is the region that lies outside the circle and inside the rectangle. The universal set includes all of the elements in set and all of the elements in the complement of set , and nothing else.

Consider the set of digit numbers. Let this be our universal set, Now, let set be the subset of consisting of all the prime numbers in set , The complement of set is The following Venn diagram represents this relationship graphically.

For the following exercises, interpret each Venn diagram and describe the relationship between the sets, symbolically and in words.







Describe the relationships depicted in this diagram model. The drawing does not establish that real card games and video games can never overlap.

For the following exercises, create a Venn diagram to represent the relationships between the sets.
All birds have wings.
All cats are animals.
All almonds are nuts, and all pecans are nuts, but no almonds are pecans.
Use the exclusive definition of trapezoid: a quadrilateral with exactly one pair of parallel sides. Under this convention, all rectangles and all trapezoids are quadrilaterals, but no rectangles are trapezoids.
Lizards Reptiles.
Ladybugs Insects.
Ladybugs Insects and Ants Insects, but no Ants are Ladybugs.
Lizards Reptiles and Snakes Reptiles, but no Lizards are Snakes.
and are disjoint subsets of
and are disjoint subsets of .
is a subset of .
is a subset of .
Jazz, Music, and .
Reggae, Music, and .
Jazz, Reggae, and Music are sets with the following relationships: and is disjoint from .
Jazz, Bebop, and Music are sets with the following relationships: and .
For the following exercises, the universal set is the set of single digit numbers, . Find the complement of each subset of .
For the following exercises, the universal set is {Bashful, Doc, Dopey, Grumpy, Happy, Sleepy, Sneezy}. Find the complement of each subset of .
{Happy, Bashful, Grumpy}
{Sleepy, Sneezy}
{Doc}
{Doc, Dopey}
{Doc, Grumpy, Happy, Sleepy, Bashful, Sneezy, Dopey}
For the following exercises, the universal set is . Find the complement of each subset of .
For the following exercises, use the Venn diagram to determine the members of the complement of set .




Corequisite Skills for Introductory Statistics is a custom course edition compiled for Introductory Statistics corequisite courses from OpenStax Contemporary Mathematics, Elementary Algebra 2e, Intermediate Algebra 2e, Prealgebra 2e. Content by OpenStax is reproduced as published, apart from any corrections recorded for this edition. Sections are renumbered to follow the course outline. The course outline is adapted from Larry Green's Support Course for Elementary Statistics (LibreTexts, https://stats.libretexts.org/Bookshelves/Introductory_Statistics/Support_Course_for_Elementary_Statistics), used under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Lessons 2.4 and 6.7 are written for this edition by XYZ Homework. Every OpenStax lesson is abridged to the subsections and practice exercises this course uses. Lessons are headed with their course titles, not the source section titles. Access the complete originals free at openstax.org. License: CC-BY-NC-SA-4.0.