Commutative, Associative and Distributive Laws

TLDR:

Commutative Laws:a + b  =  b + a
a * b  =  b * a
Associative Laws:(a + b) + c  =  a + (b + c)
(a * b) * c  =  a * (b * c)
Distributive Law:a * (b + c)  =  a * b  +  a * c

Commutative law

The “Commutative Laws” say we can swap numbers over and still get the same answer.

Why “commutative”, because the numbers can travel back and forth like a commuter.

When we add:

a = 10
b = 20
print(a + b == b + a)

When we multiply:

a = 3
b = 21.42
print(a * b == b * a)

When we do percentages:

# 8% of 50 = 50% of 8 = 4
percent = lambda part, whole:float(whole) / 100 * float(part)
a = 8
b = 50
print(percent(a, b) == percent(b, a))

NOTE

The Commutative Law does not work for subtraction or division: , but

Associative Laws

The “Associative Laws” say that it doesn’t matter how we group the numbers (i.e. which we calculate first).

When we add:

a = 1.1
b = 2.1
c = 3.1
print((a + b) + c == a + (b + c))

This: , has the same answer as this:

When we multiply:

a = 3.18
b = 5
c = 3.1
print((a * b) * c == a * (b * c))

This: , has the same answer as this:

Sometimes it is easier to add or multiply in a different order:

What is 19 + 36 + 4? Try to use associative law.

Or to rearrange a little:

What is 2 * 16 * 5? Try to use associative law.

NOTE

The Associative Law does not work for subtraction or division: , but 9 – (4 – 3) = 9 – 1 = 8

Distributive Law

The “Distributive Law” is the BEST one of all, but needs careful attention.

3 lots of (2+4) is the same as 3 lots of 2 plus 3 lots of 4 So, the 3 can be “distributed” across the 2+4, into 32 and 34.

And we write it like this:

Try the calculations yourself:

With distributive law we get the same answer when we:

  • multiply a number by a group of numbers added together, or
  • do each multiply separately then add them

What is 6 * 204? Try to use distributive law to simplify.

What is 16 * 6 + 16 * 4? Try to use distributive law with combining.

We can use it in subtraction too:

What is 263 - 243? Try to use distributive law.

What is 67 + 27 + 37 + 57 + 4*7?

NOTE

The Distributive Law does not work for division: , but