Omni Calculator logo

Is Modulo Multiplication and Addition Associative, Distributive, and Commutative?

Created by Anna Szczepanek, PhD
Reviewed by Rijk de Wet
Last updated: Jun 05, 2023


Let's discuss the algebraic properties of the integer modulo addition and multiplication operations — their associativity, distributivity, and commutativity. We will also briefly explain what each of these properties means in algebra.

Addition and multiplication modulo n

Select a non-zero integer n. The symbol [x] will denote the set of all integers congruent to x mod n, i.e. the numbers of the form x + n*y, where y is an integer.

  • The "addition modulo n" operation is defined as [a]+[b] = [a+b]. In other words:

    (a + b) mod n = (a mod n + b mod n) mod n.

  • The "multiplication modulo n" operation is defined as [a]*[b] = [a*b]. So:

    (a * b) mod n = ((a mod n) * (b mod n)) mod n.

We will now discuss various properties of both these modular operations.

Is modular arithmetic associative?

Associativity means that the result will not change when we rearrange the parentheses in an expression. It turns out that:

  • Modulo addition is associative:

    ([x] + [y]) + [z] = [x] + ([y] + [z])

  • Modular multiplication is also associative:

    ([x] * [y]) * [z] = [x] * ([y] * [z])

In the next section, we will show you how to prove that modular multiplication is associative.

💡 Check our associative property calculator first to understand this subject better.

Proof that multiplication modulo n is associative

We will now prove that

([x] * [y]) * [z] = [x] * ([y] * [z]).

Let's start from the left-hand side. Below, each line is equivalent to the preceding one.

([x] * [y]) * [z]

By the definition of modular multiplication, we get:

([x * y]) * [z]

Again by the definition of modular multiplication:

[(x * y) * z]

We use the associativity of the multiplication of real numbers:

[x * (y * z)]

By the definition of modular multiplication again, we get:

[x] * ([y * z])

Again by the same definition:

[x] * ([y] * [z])

And look, we have arrived at the right-hand side. Hence, we have proved that multiplication modulo n is associative!

Is modulo arithmetic commutative?

Commutativity means that the result will not change when we change the order of the operands. One can easily show that:

  • Modulo addition is commutative:

    [x] + [y] = [y] + [x])

  • Modular multiplication is also commutative:

    [x] * [y] = [y] * [x]

The proof is very similar to what we've seen above for associativity. This time, you'll need to use the fact that the multiplication/addition of real numbers is commutative.

Is modulus function distributive?

Distributivity is a property that involves both addition and multiplication at once. We say that multiplication distributes over addition if instead of multiplying a sum of several terms by a factor, we can multiply each summand by this factor individually and then add these partial results together to obtain the final answer. So, for example, 5*12 = 5*(10+2) = 5*10 + 5*2 = 60.

It turns out that modular multiplication is distributive over addition:

([x] + [y]) * [z] = [x] * [z] + [y] * [z]

and

[x] * ([y] + [z]) = [x] * [y] + [x] * [z]

In proving this, you'll need to evoke the fact that for real numbers, multiplication distributes over addition.

🙋 Our distributive property calculator will clear every doubt you have about the distributive property!

Anna Szczepanek, PhD
x mod y = r
x (dividend)
y (divisor)
r (remainder)
Check out 75 similar arithmetic calculators ➗
Absolute changeAbsolute valueAdding and subtracting fractions… 72 more
People also viewed…

Expanded form

The expanded form calculator takes the number you feed it and expands it with respect to the decimal base. It even has three different representations to choose from!

Millionaire

This millionaire calculator will help you determine how long it will take for you to reach a 7-figure saving or any financial goal you have. You can use this calculator even if you are just starting to save or even if you already have savings.

Multiplicative inverse modulo

Quickly find the inverse of modulus and learn how to find multiplicative inverse modulo with our easy-to-use calculator. What are you waiting for?

Social Media Time Alternatives

Check what you could have accomplished if you get out of your social media bubble.
Copyright by Omni Calculator sp. z o.o.
Privacy, Cookies & Terms of Service