Commutative Law Worksheet - GeeksforGeeks

Commutative Law Worksheet

Last Updated : 21 Oct, 2026

The commutative law states that for certain mathematical operations like addition and multiplication, changing the order of the numbers being operated on does not change the result.

Stated otherwise, A + B equals B + A, and A × B equals B × A.

Solved Examples

Addition: Changing the order of operands does not affect the result.

Example: 3 + 5 = 5 + 3
Solution:
3 + 5 = 8
5 + 3 = 8
Therefore, 3 + 5 = 5 + 3 = 8.

Multiplication: Changing the order of factors does not affect the result.

Example: 2 x 4 = 4 x 2
Solution:
2 x 4 = 8
4 x 2 = 8
Therefore, 2 x 4 = 4 x 2 = 8.

Matrix Addition: Changing the order of matrices does not affect the result.

Example:
A = [[1, 2], [3, 4]], B = [[5, 6], [7, 8]]
A + B = [[1+5, 2+6], [3+7, 4+8]] = [[6, 8], [10, 12]]
B + A = [[5+1, 6+2], [7+3, 8+4]] = [[6, 8], [10, 12]]
Therefore, A + B = B + A = [[6, 8], [10, 12]].

Vector Addition: Changing the order of vectors does not affect the result.

Example:
v = [1, 2, 3], w = [4, 5, 6]
v + w = [1+4, 2+5, 3+6] = [5, 7, 9]
w + v = [4+1, 5+2, 6+3] = [5, 7, 9]
Therefore, v + w = w + v = [5, 7, 9].

Intersection of Sets: The order of sets does not affect the result of intersection.

Example: A ∩ B = B ∩ A
If A = {1, 2, 3} and B = {3, 4, 5},
A ∩ B = {3}
B ∩ A = {3}
Therefore, A ∩ B = B ∩ A = {3}.

Union of Sets: Commutative Law: The order of sets does not affect the result of union.

Example: A ∪ B = B ∪ A
If A = {1, 2, 3} and B = {3, 4, 5},
A ∪ B = {1, 2, 3, 4, 5}
B ∪ A = {1, 2, 3, 4, 5}
Therefore, A ∪ B = B ∪ A = {1, 2, 3, 4, 5}.

Function Composition: Changing the order of function composition does not affect the result.

Example: (f ∘ g)(x) = (g ∘ f)(x)
Solution:
Let f(x) = x2 and g(x) = 2x
(f ∘ g)(x) = f(g(x)) = f(2x) = (2x)2 = 4x2
(g ∘ f)(x) = g(f(x)) = g(x2 ) = 2x2
Therefore, (f ∘ g)(x) = (g ∘ f)(x) = 4x2 = 2x2 .

Function Addition: Changing the order of function addition does not affect the result.

Example: (f + g)(x) = (g + f)(x)
Solution:
Let f(x) = 2x and g(x) = 3x
(f + g)(x) = f(x) + g(x) = 2x + 3x = 5x
(g + f)(x) = g(x) + f(x) = 3x + 2x = 5x
Therefore, (f + g)(x) = (g + f)(x) = 5x.

Scalar Multiplication: Changing the order of scalar multiplication does not affect the result.

Example: 2 x (3 x v) = (2 x 3) x v
Solution:
Let v = [1, 2, 3]
2 x (3 x v) = 2 x [3, 6, 9] = [6, 12, 18]
(2 x 3) x v = 6 x [1, 2, 3] = [6, 12, 18]
Therefore, 2 x (3 x v) = (2 x3) x v = [6, 12, 18].

Union of Intervals: Changing the order of interval union does not affect the result.

Example: [1, 3] ∪ [4, 6] = [4, 6] ∪ [1, 3]
Solution:
[1, 3] ∪ [4, 6] = [1, 3] ∪ [4, 6] = [1, 6]
[4, 6] ∪ [1, 3] = [4, 6] ∪ [1, 3] = [1, 6]
Therefore, [1, 3] ∪ [4, 6] = [4, 6] ∪ [1, 3] = [1, 6].

Practice Questions

Question 1: Check the commutative laws of multiplication for the numbers 6 and 7 and addition for the numbers 5 and 9.

Question 2: Check that the addition commutative property holds for the integers -3 and 4.

Question 3: Check that the multiplication commutative property holds for the integers -2 and 10.

Question 4: Check the 3/4 and 1/4 fractions' commutative rule of addition.

Question 5:Check the 2/5 and 5/2 fractions' commutative rule of multiplication.

Comment

Explore