topic badge

12.01 Subsets and sample spaces

Introduction

In 7th grade, we were introduced to sample spaces and represented them in lists, tables, and tree diagrams. In Algebra 1 lesson  8.01 Two way frequency tables  , we represented bivariate data using two-way frequency tables. This lesson will review those concepts and teach you how to represent bivariate data in a new way, using Venn diagrams.

Subsets and sample spaces

There are two important types of visual models we can use when dealing with bivariate data.

Venn diagram

A diagram which shows all possible logical relations between two or more sets

Each circle in a Venn diagram represents a particular set or category.

The overlapping region in the middle, labeled b, represents elements that belong to both sets.

Region a represents elements that belong only to the first set and not to the second set. Similarly, region c represents elements that belong only to the second set and not to the first set.

Region d represents all elements that are included in the data but do not belong to either set.

Two-way frequency table

A data display that can be used to summarize bivariate categorical data. Also known as a joint frequency table.

A two-way frequency table also displays how elements are distributed across two sets:

A\text{Not }A\text{Total}
B51015
\text{Not }B121325
\text{Total}172340

Each row sums to give the totals on the right, and each column sums to give the totals along the bottom.

A collection of items is called a set. There are many situations which we can describe and explore mathematically using sets, and to do so we will make use of some new terminology.

Set

A collection of items, which are usually called elements. Sets are usually denoted using capital letters.

Example: The set of elements in A

A Venn diagram showing two circles A and B. Circle A is highlighted.
Element

A single member of a set. Elements are usually denoted using lower case letters.

A set can be described by listing its elements inside a pair of braces, and we call this set notation. For example, if the set A is "the set of positive integers smaller than nine", we can write this asA = \left\{1, 2, 3, 4, 5, 6, 7, 8\right\}

If there are too many elements to write out but there is a clear pattern to the elements, we can use three dots to indicate that a pattern continues. For example, if the set B is "the set of even whole numbers", we can write this as B = \left\{2, 4, 6, 8, 10, \ldots \right\}

A special set, called the empty set, is the set which contains no elements. It is usually represented by the symbol \emptyset, but can also be expressed in set notation as\emptyset = \left\{\right\}

Sample space

A set from which all elements of the other sets in a problem can be found. Sometimes called a universal set.

A Venn diagram showing two circles A and B. The entire rectangle is highlighted.
Complement

The complement of a set A, denoted A' or "not A" is the set of all elements of the sample space which are not elements of A.

A Venn diagram showing two circles A and B. Everything inside the rectangle except for the interior of circle A is highlighted.
Intersection

The intersection of two sets A and B, denoted {A \cap B}, is the set of all elements which belong to both A and B

A Venn diagram showing two circles A and B. The region that is inside both circles A and B is highlighted.
Union

The union of two sets A and B, denoted {A \cup B}, is the set of all elements which belong to either A or B

A Venn diagram showing two circles A and B. The entirety of both circles A and B is highlighted.
Subset

A set B is a subset of another set A, denoted B \subseteq A, if every element of B is also an element of A

To summarize the images above, we can use Venn diagrams to represent sets. The large outer rectangle represents the sample space, and each circle in the Venn diagram represents a set. We can also see their intersection as the region where the circles overlap, and their union as the collection of all parts of each circle.

We can also see these components of sets in two-way tables:

A\text{Not }A\text{Total}
Bwxw + x
\text{Not }Byzy + z
\text{Total}w + yx + zw + x + y + z

In the table above, the number of elements in set A would be the total w + y, while the number of elements in the complement of A would be x + z. We get similar results for B and its complement by looking at the rows.

The number of elements in the intersection A \cap B would be w. The number of elements in the union A \cup B would be w + x + y. There are w + x + y + z elements in total in the sample space.

Examples

Example 1

P is the set of odd numbers between 2 and 16, and Q is the set given by Q = \left\{1, 2, 3, 5, 8, 13, 21\right\}.

Determine the set given by P \cap Q.

Worked Solution
Create a strategy

P \cap Q is the intersection of P and Q. That is, P \cap Q contains all of the elements that belong to both P and Q. In other words, we are looking for all the elements that are in Q and are also an odd number between 2 and 16.

Apply the idea

We can see that the odd elements of Q are 1, 3, 5, 13, and 21.

Of these, 3, 5, and 13 lie between 2 and 16 and are therefore also elements of P.

So, we have thatP \cap Q = \left\{3, 5, 13\right\}

Reflect and check

We can construct a Venn diagram to see the relationship between sets P and Q, particularly the elements they have in common.

Example 2

In the sample spaceS = \left\{\text{square, triangle, rhombus, parallelogram, hexagon, circle, trapezoid, rectangle}\right\}the subset A is "quadrilaterals" and the subset B is "words beginning with the letter t".

a

Describe the set "not A" using words, then express it using set notation.

Worked Solution
Create a strategy

The keyword "not" indicates that we want to take the complement of A. In order to think about this, it might be useful to first list out the elements of A.

Apply the idea

The set A is the set of "quadrilaterals" from the sample space S. So we haveA = \left\{\text{square, rhombus, parallelogram, trapezoid, rectangle}\right\}

The complement of A is the set of all elements of S that are not in A. We can describe this as "the set of shapes which do not have four sides". In set notation, this will beA' = \left\{\text{triangle, hexagon, circle}\right\}

Reflect and check

This Venn diagram represents the sample space with A\rq highlighted.

b

Describe the set "B or not A" using words, then express it using set notation.

Worked Solution
Create a strategy

We determined the set "not A" in the first part of this question. The keyword "or" indicates that we want to take the union of this with set B. This means we need to include everything that is in set B as well as everything in "not A". This time it might be useful to list out the elements of B.

Apply the idea

The set B is the set of "words beginning with the letter t" from the sample space S. So we have B = \left\{\text{triangle, trapezoid}\right\}.

A\rq=\left\{\text{triangle, hexagon, circle}\right\} as we found in part (a).

The union of two sets will include any element that is in at least one of those sets. We can desribe the set "B or not A" as "the set of shapes that begin with the letter t or are not quadrilaterals." In set notation, this will beB \cup A' = \left\{\text{triangle, hexagon, circle, trapezoid}\right\}

Reflect and check

Taking the complement of A:

and combining it with set B:

We get the following Venn diagram:

Notice that the element "triangle" appears in both B and A'. This element is still included in the union, since appearing in both sets means that it appears in at least one of the two sets.

We only need to list it once; we do not need to write the element twice in the union even though it appears in both sets.

Example 3

Consider the sets shown in the following Venn diagram:

A Venn diagram showing circles A and B and a number of elements. See your teacher for more information.
a

State the sample space.

Worked Solution
Create a strategy

The sample space contains all the possible elements that can appear in any set in the context. For a Venn diagram, this includes any element within the outer rectangle (whether or not it is inside any circles).

Apply the idea

In this case, every number from 1 to 20 appears exactly once, so the sample space isS=\left\{1, 2, 3, \ldots, 19, 20\right\}

Reflect and check

In any sample space, the sets A and B are subsets of the sample space. Using geometric notation, we can write A\subseteq S (A is a subset of S) and B\subseteq S (B is a subset of S).

There are many other subsets in a sample space such as A\rq and A\cup A\rq and A\cap B, to name a few.

b

Indicate the region which represents A \cap B' on the diagram, and state the elements of this set.

Worked Solution
Create a strategy

B' is the complement of B which is the region outside of circle B.

We then want to take the intersection of that with set A.

A Venn diagram showing two circles A and B. Circle A is highlighted.

The intersection will be the region where the shading overlaps.

Apply the idea

We want to include everything that is inside circle A but not inside circle B:

A Venn diagram showing circles A and B and a number of elements, with one region highlighted. See your teacher for more information.

In set notation, this isA \cap B' = \left\{1, 4, 16\right\}

Reflect and check

In part (a), we found that the sample space for this Venn diagram is "all integers from 1 to 20 inclusive".

Within this sample space, we can describe set A as "the set of square numbers", and we can describe set B as "integers between 6 and 12 inclusive".

Within the sample space, we could also describe the set A \cap B\rq as "square numbers that are not between 6 and 12" The set A \cap B\rq is a subset of the sample space.

Example 4

Using the following two-way table, determine the number of elements in the set given by X \cup Y\rq.

YY\rq\text{Total}
X821294
X\rq415394
\text{Total}12365188
Worked Solution
Create a strategy

While a two-way table contains row and column totals, we need to be careful about using these as we don't want to count elements multiple times. It will be easier to use the four values not in any total row or column.

Apply the idea

We want to include all elements that appear in either the row X or the column Y\rq.

There are 12 elements that appear in both of these. There are also 82 other elements in the row for X, and 53 other elements in the column for Y\rq.

Putting this all together, there are 12 + 82 + 53 = 147 elements in the set X\cup Y\rq.

Reflect and check
A Venn diagram showing circles X and Y with the number 82 in their intersection, 12 in X but not the Y, 41 in Y but not X, and 53 outside of the two cirlce, but inside the rectangle.

We could also convert this two-way table to a Venn diagram to confirm our answer.

After placing the known information into the diagram, we need to shade the region that represents X\cup Y\rq.

From here, we can see that if we want the number of elements that are in X or are not in Y, we want to add 53+12+82=147.

Example 5

One hundred students in a school are asked about the subjects that they study. 58 of them are studying both math and science, 12 are studying math but not science, and 23 are not studying either math or science.

a

Create a model to represent the sample space. Explain why you chose that model.

Worked Solution
Create a strategy

This data is organized as sets and their complements. There are two sets of data: students who study math and students who study science. We are also considering their complements: students who do not study math and students who do not study science.

Apply the idea

One way to represent this data is by using a two-way frequency table. Because the complements are involved, it is easier to organize the information into a table.

Studies scienceDoes not study science
Studies math
Does not study math

Entering the given information into the appropriate cells of the table, we get:

Studies scienceDoes not study science
Studies math5812
Does not study math23
Reflect and check

Alternatively, we could have chosen to use a Venn diagram. There are two categories of data here: students who study math and students who study science.

We know that 58 students study both math and science. This is the intersection of the sets, so we can put this number in the center section where the two circles overlap:

We also know that 12 students are studying math but not science. These students belong in the left circle but not the right circle:

Lastly, we have also been told that 23 students are not studying either of these subjects. This number should be in the rectangle that represents the whole set, but not in either of the circles:

b

Use your model from part (a) to determine how many students are in the set of students studying science.

Worked Solution
Create a strategy

We can solve this by first finding the number of students who study science but not math, and then adding that amount to 58.

Apply the idea

We can use the fact that there are 100 students in the data set in total to find how many study science. If we let the number of students who study science but not math be x, then we can sum all of the values together to get {x + 23 + 12 + 58 = 100}.

Solving this gives x = 7, and so there are 7 students who study science but not math.

Studies scienceDoes not study science
Studies math5812
Does not study math723

To find the total number of students who study science, we simply need to add the numbers in column "Studies science". There are 58+7=65 students who study science.

Reflect and check

To solve this with the Venn diagram we created in the reflection for part (a), we know the students who are studying science will be those in the circle on the right. This includes both the 58 students in the overlap who study both math and science, as well as the unknown number who study science but not math.

We can solve for the number of students who study science but not math the same way as we did above, by creating the equation {x + 23 + 12 + 58 = 100} and solving to get x = 7. This number goes in the right side of the circle for science.

To find the total number of students who study science, we simply need to add the numbers in right circle. There are 58+7=65 students who study science.

Idea summary

When working with bivariate data, we often want to find new subsets of a sample space, S, by combining portions of two existing subsets (A and B) using intersections (\cap), unions (\cup), complements (A\rq or B\rq), or some combination of these. Venn Diagrams and two-way frequency tables can help us visualize the various subsets to answer questions.

Venn diagram
Two-way frequency table

Outcomes

S.CP.A.1

Describe events as subsets of a sample space (the set of outcomes) using characteristics (or categories) of the outcomes, or as unions, intersections, or complements of other events ("or," "and," "not").

S.CP.A.4

Construct and interpret two-way frequency tables of data when two categories are associated with each object being classified. Use the two-way table as a sample space to decide if events are independent and to approximate conditional probabilities.

What is Mathspace

About Mathspace