Skip to content Skip to navigation Skip to collection information

OpenStax_CNX

You are here: Home » Content » ENGR 2113 ECE Math » Difference of sets

Navigation

Table of Contents

Recently Viewed

This feature requires Javascript to be enabled.
 

Difference of sets

Module by: Sunil Kumar Singh. E-mail the author

We can extend the concept of subtraction, used in algebra, to the sets. If a set “B” is subtracted from set “A”, the resulting difference set consists of elements, which are exclusive to set “A”. We represent the symbol of difference of sets as “A-B” and pronounce the same as “A minus B”.

Definition 1: Difference of sets
The difference of sets “A-B” is the set of all elements of “A”, which do not belong to “B”.

In the set builder form, the difference set is :

A - B = { x : x A a n d x B } A - B = { x : x A a n d x B }

and

B - A = { x : x B a n d x A } B - A = { x : x B a n d x A }

On Venn’s diagram, the difference "A-B" is the region of “A”, which excludes the common region with set “B”.

Figure 1: The difference of two sets is a disjoint set.
Difference of two sets
 Difference of two sets  (d1.gif)

Interpretation of difference set

Let us examine the defining set of intersection :

A - B = { x : x A a n d x B } A - B = { x : x A a n d x B }

We consider an arbitrary element, say “x”, of the difference set. Then, we interpret the conditional meaning as :

I f x A - B x A a n d x B . I f x A - B x A a n d x B .

The conditional statement is true in opposite direction as well. Hence,

I f x A a n d x B x A - B . I f x A a n d x B x A - B .

We can summarize two statements with two ways arrow as :

I f x A - B x A a n d x B . I f x A - B x A a n d x B .

Composition of a set

From Venn’s diagram, we observe that if we derive union of ( A B A B ) to either of the difference sets, then we get the complete individual set.

Figure 2: The difference of two sets is a disjoint set.
Difference of two sets
 Difference of two sets  (d1.gif)

A = A - B A B A = A - B A B

and

B = B - A A B B = B - A A B

Difference of sets is not commutative

The positions of sets about minus operator affect the result. It is clear from the figure above, where “A-B” and “B-A” represent different regions on Venn’s diagram. As such, the difference of sets is not commutative. Let us consider the example used earlier, where :

A = { 1,2,3,4,5,6 } A = { 1,2,3,4,5,6 }

A = { 4,5,6,7,8 } A = { 4,5,6,7,8 }

Then,

A B = { 1,2,3 } A B = { 1,2,3 }

and

B A = { 7,8 } B A = { 7,8 }

Clearly,

A B B A A B B A

Symmetric difference

From the Venn’s diagram, we can see that union of two sets is equal to three distinct regions. Alternatively, we can say that the region represented by the union of two sets is equal to the sum of the regions representing three “disjoint” sets (i) difference set A-B (ii) intersection set " A B A B " and (iii) difference set B-A.

Figure 3: The difference of two sets is a disjoint set.
Difference of two sets
 Difference of two sets  (d1.gif)

We use the term “symmetric set” for combining two differences as marked on Venn’s diagram. It is denoted as “ A Δ B A Δ B ”.

A Δ B = A B B A A Δ B = A B B A

Complement of a set

The complement is a special case of the difference operation. The set in question is subtracted from universal set, “U”. Thus, one of the sets in difference operation is fixed. We define complement of a set as its difference with universal set, "U". The complement of a set is denoted by the same symbol as that of set, but with an apostrophe. Hence, complement of set A is set A’.

Definition 2: Complement of a set
The complement of a set “A” consists of elements, which are elements of “U”, but not the elements of “A”.

We write the complement set in terms of set builder form as :

A = { x : x U a n d x A } A = { x : x U a n d x A }

Note that elements of A’ does not belong to set “A”. On Venn’s diagram, the complement of “A” is the remaining region of the universal set.

Figure 4: The complement of a set is the remaining region of the universal set.
Complement of a set
 Complement of a set  (d2.gif)

Interpretation of complement

Proceeding as before we can read the conditional statement for the complement with the help of two ways arrow as :

x A x U a n d x A x A x U a n d x A

In terms of minus or difference operation,

A = U A A = U A

It is clear from the representation on Venn’s diagram that the universal set comprises of two distinct sets – set A and complement set A’.

U = A A U = A A

Compliment of universal set

The complement of universal set is empty set. It is so because difference of union set with itself is the empty set (see Venn's diagram).

U = { x : x U a n d x U } = φ U = { x : x U a n d x U } = φ

Complement of empty set

The complement of the empty set is universal set. It is so because difference of union set with the empty set is universal set (see Venn's diagram).

φ = { x : x U a n d x φ } = U φ = { x : x U a n d x φ } = U

Complement of complement set is set itself

The complement of complement set is set itself. The complement set is defined as :

A = U A A = U A

Now, complement of complement set is :

A = U A A = U A

Let us consider the example, where :

U = { 1,2,3,4,5,6,7,8 } U = { 1,2,3,4,5,6,7,8 }

A = { 1,2,3,4,5,6 } A = { 1,2,3,4,5,6 }

Then,

A = { 1,2,3,4,5,6,7,8 } - { 1,2,3,4,5,6 } = { 7,8 } A = { 1,2,3,4,5,6,7,8 } - { 1,2,3,4,5,6 } = { 7,8 }

Again taking complement, we have :

A = { 1,2,3,4,5,6,7,8 } - { 7,8 } = { 1,2,3,4,5,6 } = A A = { 1,2,3,4,5,6,7,8 } - { 7,8 } = { 1,2,3,4,5,6 } = A

Union with complement set

The union of a set with its complement is universal set :

A A = { x : x U a n d x A } { x : x U a n d x A } = U A A = { x : x U a n d x A } { x : x U a n d x A } = U

From Venn’s diagram also, we see that universal set consists of set A and component A’.

U = A A U = A A

The two sets on the right side of the equation are disjoint sets. Hence,

A A = U A A = U

Intersection with complement set

There is nothing common between set A and its component A’. Thus, intersection of a set with its complement yields the empty set,

A A = φ A A = φ

De-morgan’s laws

In the real world situation, we want to negate a condition of incidence. For example, consider a class in the school. Some students play either basketball or football or both, but there are students, who play neither basketball nor football. We have to identify later category of students as a set.

Let the set of students playing basketball be “B” and that playing football be “F”. Then, students who do not play basketball is complement set B’ and students who do not play football is complement set F’. We have shown these complement sets separately for visualization. Actually, these complement sets are drawn to the same universal set, "U".

Two complement sets are but overlapping sets. There are students in the set B’ who play football and there are students in the set F’, who play basketball. In order to remove those students playing other game, we intersect two complements. The members of the intersection of two complements, therefore, represent students who play neither basketball nor football. This intersection is shown as third bottom Venn’s diagram in the figure.

Figure 5: Intersection of two component sets
Intersection
 Intersection  (d3.gif)

Looking at the intersection of two complement sets, however, we observe that this is equal to the complement of union “ B F B F ”. This conclusion can be derived from basic interpretation as well. We know that union “ B F B F ” represents students, who play either or both games. The component of the union, therefore, represents, who neither play basketball nor football.

This fact, as a matter of fact, is the first De-morgan’s law. Symbolically,

B F = B F B F = B F

The second De-morgan’s law is :

B F = B F B F = B F

In the parlance of illustration given earlier, let us interpret right hand side of the second De-morgan's law. The intersection “ B F B F ” represents students playing both games. Its complement, therefore, represents students who do not play both games, but may play one of them.

Figure 6: Component of intersection of two sets
Component set
 Component set  (d4.gif)

Analytical proof

Here, we shall prove first De-morgan’s law in this section. The second law can be proved in similar fashion. Let us consider an arbitrary element “x” belonging to set ( A B A B )’.

x A B x A B

x A B x A B

Then, by definition of union,

x { x : x A o r x B } x { x : x A o r x B }

Here, “not or” is interpreted same as “and”,

x A a n d x B x A a n d x B

x A a n d x B x A a n d x B

x A B x A B

But, we had started with ( A B A B )’ and used its definition to show that “x” belongs to another set. It means that the other set consists of the elements of the first set – at the least. Thus,

A B A B A B A B

Similarly, we can start with A B A B and reach the conclusion that :

A B A B A B A B

If sets are subsets of each other, then they are equal. Hence,

A B = A B A B = A B

Example

Problem 1: In the reference of students in a class, the set “B” represents students, who play basketball. The set “F” represents students, who play football. The set “B” and “F” are left and right circles respectively on the Venn's diagram shown below. Identify regions marked 1 to 8 on the Venn’s diagram. Also interpret regions identified by combination U – (6+7).

Figure 7: Interpreting sets
sets
 sets  (d5.gif)

Solution :The meaning of regions market 1 – 8 are as given hereunder :

1 : B-F : It represents the difference of “B” and “F”. It consists of students, who play basketball, but not football.

2 : F-B : It represents the difference of “F” and “B”. It consists of students, who play football, but not basketball.

3 : B F B F : It represents the intersection of two sets. It consists of students, who play both basketball and football.

4 : B: It represents the set “B”. It is union of two disjoint sets “B-F” and “ B F B F ”. It consists of students, who play basketball.

5 : F: It represents the set “F”. It is union of two disjoint sets “F-B” and “ B F B F ”. It consists of students, who play football.

6 : B∪F: It represents the union set of set “B” and “F”. Equivalently, it is union of three disjoint sets “B-F”, “ B F B F ” and “F-B”. It consists of students, who play either of two games or both.

7 : ( B F B F )’: It represents the component of union set “ B F B F ”. It consists of students, who play neither basketball nor football.

8 : B - F F - B B - F F - B : It represents union of two disjoint difference sets “B-F” and “F-B”. It consists of students, who play only one game.

The region, identified by U – (6+7), is complement of “ B F B F ”. It represents students, who do not play both games, but may play one of them.

Collection Navigation

Content actions

Download:

Collection as:

PDF | EPUB (?)

What is an EPUB file?

EPUB is an electronic book format that can be read on a variety of mobile devices.

Downloading to a reading device

For detailed instructions on how to download this content's EPUB to your specific device, click the "(?)" link.

| More downloads ...

Module as:

PDF | More downloads ...

Add:

Collection to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks

Module to:

My Favorites (?)

'My Favorites' is a special kind of lens which you can use to bookmark modules and collections. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need an account to use 'My Favorites'.

| A lens I own (?)

Definition of a lens

Lenses

A lens is a custom view of the content in the repository. You can think of it as a fancy kind of list that will let you see content through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

| External bookmarks