Commutative and Associative Laws

Learn about commutativity and associativity of the union and intersection set operations.

Commutativity

If we say that an operation * is commutative, we mean that ab=baa*b = b*a for any two operands aa and bb. Let’s see why the commutative law holds for union and intersection operations. For that, we have to reinforce two things about a set. First, there is no particular arrangement of elements, and second, there is no repetition of elements. Keeping that in mind, if we collect all the elements of any two sets, avoiding any possible duplication, we can observe that the union operation is commutative. Similarly, if we think about the intersection of any two sets, it contains all such elements that are members of both sets. An element is in the intersection set if it is a member of both the operand sets independent of which was first and which was second. This means that the intersection operation is commutative. To further illustrate, let’s consider two sets, AA and BB, as arbitrary sets.

The same property can be generalized for more than two sets using the same principle. That is, for some sets, AA, BB, CC, and DD, we can use the commutativity for the union as follows.

Similarly, we can use the commutative law for an intersection when there are more than two sets. It’s important to note that we only consider two sets at a time for applying the commutative law.

LHS
LHS
RHS
RHS

Associativity

An operation * is called associative if a(bc)=(ab)ca*(b*c)= (a*b)*c for any three operands aa, bb, and cc. Let’s see why union and intersection operations are associative by assuming that we want to take the union of three arbitrary sets, AA, BB, and CC. The question arises: What will be the effect on the output if we first compute ABA\cup B and then (AB)C(A\cup B)\cup C , or first compute BCB\cup C followed by A(BC)A\cup (B\cup C)?

To solve this problem, let x(AB)Cx(AB)xC(xAxB)xCx\in (A\cup B)\cup C \Rightarrow x\in (A \cup B) \lor x\in C \Rightarrow (x\in A \lor x\in B )\lor x\in C.

Because logical disjunctionDisjunction is also a binary operation (requiring two operands). When two propositions are connected using the disjunction operation, it becomes a new proposition whose truth value depends on the truth values of the operands. Disjunction is also known as the OR operator. For more details, see the appendix. is associative, we have (xAxB)xCxA(xBx(x\in A \lor x\in B )\lor x\in C\Rightarrow x\in A \lor (x\in B \lor x\in . This means that xA(BC)x\in A \cup (B \cup C). So far, we have shown that (AB)CA(BC)(A\cup B)\cup C \sube A \cup (B \cup C).

For the second part of the problem, let yA(BC)y\in A\cup (B\cup C). Again, we can perform the following steps by using the definition of the union and the associativity of the logical disjunction:

This means that A(BC)(AB)CA \cup (B \cup C) \sube (A\cup B)\cup C and (AB)CA(BC)(A\cup B)\cup C \sube A \cup (B \cup C).

Therefore, we conclude that (AB)C=A(BC)(A\cup B)\cup C = A \cup (B \cup C).

By a similar argument, we can also show that (AB)C=A(BC)(A\cap B)\cap C = A \cap (B \cap C).

For a union or intersection of more than two sets, there is no need to use parentheses because every parenthesization of the sets for union or intersection results in the same set due to the associative law.

Generalized union

The union of three sets can be computed in different ways using the commutative and associative laws. One way is to compute ABA\cup B first and then take the union of the result with CC , which is (AB)C(A\cup B)\cup C. Another way is to compute A(BC)A\cup (B\cup C) or even B(AC)B\cup(A\cup C). The following animation illustrates the union of three sets using step-by-step Venn diagrams for each of the three cases and shows that the result is the same. In the animation, we show the union of the two sets—computed first in the foreground and then the third set in the background—hides the overlap of the third set with the first two.  

Venn diagram for the union of three sets
Venn diagram for the union of three sets

The union of more than three sets can be computed stepwise, taking two sets at a time. We know that the union operation is commutative and associative. For this reason, we can show the union of any two sets first and then compute the union of the resultant set with a third one. Commutative and associative properties allow us to omit the parentheses while writing the union of three or more sets. We can represent the union of nn sets using an iterated union symbol. If we have nn sets, so that A1,A2,A3,,AnA_1, A_2, A_3, \ldots , A_n, then their union can be represented as follows:

Press + to interact
The formula for the union of n sets
The formula for the union of n sets

Generalized intersection

The intersection of three sets can be taken in different ways. One way is to get ABA\cap B first and then take the intersection of the result with CC, that is, (AB)C(A\cap B)\cap C. Another way to take this intersection is A(BC)A\cap (B\cap C) or even B(AC)B\cap(A\cap C). The following animation illustrates the intersection of three sets using step-by-step Venn diagrams for all three ways to reach the same result. The intersection of the two sets taken as the first choice is highlighted first, followed by the result of the intersection with the third set.

Venn diagram for the intersection of three sets
Venn diagram for the intersection of three sets

Similar to computing the union, the intersection of three or more sets can be worked out stepwise by taking two sets at a time. We know that the intersection operation is commutative and associative. For this reason, we can take the intersection of any two sets first and then take the intersection of the resultant set with the third one, and so on. Commutative and associative properties allow us to omit parentheses while writing the intersection of three or more sets. We can represent the intersection of nn sets using an iterated intersection symbol. If we have nn sets, such as A1,A2,A3,,AnA_1, A_2, A_3, \ldots , A_n, then their intersection can be represented as follows:

Press + to interact
The formula for the intersection of n sets
The formula for the intersection of n sets

Quiz

1

Which law is required to write the following?

(AB)C=B(AC)(A\cup B)\cup C = B \cup (A \cup C)

A)

Commutative law only

B)

Associative law only

C)

Commutative and associative laws

D)

Neither commutative nor associative law

Question 1 of 20 attempted