Skip to content
Other

Modulo Properties Calculator: Associative, Commutative, Distributive

Enter three integers and a modulus to verify that modular addition and multiplication are associative, commutative, and distributive. The calculator shows both sides of each equation with your actual numbers so you can see exactly how the properties hold. All three properties are universally true for any non-zero modulus, and the worked steps explain why.

Your details

Any integer. Negative values are handled correctly.
Any integer.
Used in associativity and distributivity checks.
Must be a positive integer >= 2. All residues are in {0, 1, ..., n-1}.
Associative (addition)All properties verified
Yes - holds

Whether the associative law holds for addition mod n

x mod n7
y mod n5
z mod n3
(x + y) + z (mod n)4
x + (y + z) (mod n)4
(x * y) * z (mod n)6
x * (y * z) (mod n)6
Associative (multiplication)Yes - holds
x + y (mod n)1
y + x (mod n)1
Commutative (addition)Yes - holds
x * y (mod n)2
y * x (mod n)2
Commutative (multiplication)Yes - holds
x * (y + z) (mod n)1
(x*y + x*z) (mod n)1
Distributive (mul over add)Yes - holds
All properties verifiedAll 5 properties hold
Assoc Add LHS4
Assoc Add RHS4
Comm Add LHS1
Comm Add RHS1
Dist LHS1
Dist RHS1

All five modular arithmetic properties hold for n = 11.

  • With modulus n = 11, the integers mod 11 form a commutative ring under addition and multiplication.
  • Commutativity: x + y = 1 and y + x = 1 (mod 11) - equal.
  • Associativity of addition: (x+y)+z = 4 and x+(y+z) = 4 (mod 11) - equal.
  • Distributivity: x*(y+z) = 1 and x*y+x*z = 1 (mod 11) - equal.

Next stepThese properties hold for every non-zero modulus and every choice of integers. Try a prime modulus such as 7 or 13: the integers mod p form a field, adding even more structure (every non-zero element has a multiplicative inverse).

What is modular arithmetic?

Modular arithmetic is a system of integer arithmetic where numbers "wrap around" after reaching a given value called the modulus. Writing a mod n means the non-negative remainder when a is divided by n. For example, 17 mod 5 = 2 because 17 = 3 * 5 + 2. It is used everywhere from clock arithmetic (hours mod 12) to cryptography, checksums, and computer science.

Are the three core properties always true for modulo?

Yes. Modular addition and multiplication inherit their algebraic properties from ordinary integer arithmetic. Because integers satisfy (x+y)+z = x+(y+z) and x+y = y+x and x*(y+z) = x*y+x*z, the same equations hold after reducing both sides by any modulus. The formal argument is: if two integers are congruent mod n, adding or multiplying them by the same integer preserves the congruence. This guarantees all three properties for every non-zero modulus and every integer input, not just the specific values you enter above. Together, these five properties (two commutative, two associative, one distributive) mean the integers mod n always form a commutative ring.

Formulas for modular addition and multiplication

The key reduction identities are: (a + b) mod n = ((a mod n) + (b mod n)) mod n, and (a * b) mod n = ((a mod n) * (b mod n)) mod n. These let you reduce large numbers to their residues first, then combine - a trick that is essential in cryptography where intermediate values can have hundreds of digits. The associative and commutative laws follow immediately from these identities combined with the corresponding laws for integers.

When does modular arithmetic gain even more structure?

When the modulus n is a prime number, the integers mod n form a field rather than just a ring. In a field, every non-zero element has a multiplicative inverse: for every a not divisible by n there exists b such that (a * b) mod n = 1. This is not true for composite moduli in general (for example, 2 has no multiplicative inverse mod 4). Fields are the foundation of elliptic-curve cryptography, the AES block cipher, and Reed-Solomon error-correction codes.

Modular arithmetic properties at a glance

PropertyOperationEquationAlways true?
CommutativeAddition(x + y) mod n = (y + x) mod nYes
CommutativeMultiplication(x * y) mod n = (y * x) mod nYes
AssociativeAddition((x+y)+z) mod n = (x+(y+z)) mod nYes
AssociativeMultiplication((x*y)*z) mod n = (x*(y*z)) mod nYes
DistributiveMul over Add(x*(y+z)) mod n = (x*y+x*z) mod nYes

All five properties hold for every pair of integers and every modulus n >= 2. The integers mod n form a commutative ring.

Frequently asked questions

Is modulo addition commutative?

Yes. For any integers x and y and any modulus n, (x + y) mod n always equals (y + x) mod n. This follows directly from the fact that ordinary addition is commutative: x + y = y + x for all integers, so their remainders when divided by n are identical.

Is modulo multiplication commutative?

Yes. For any integers x and y and any modulus n, (x * y) mod n always equals (y * x) mod n. Integer multiplication is commutative (x * y = y * x), so their remainders mod n must agree as well.

Is modulo addition associative?

Yes. For any integers x, y, z and modulus n, ((x + y) + z) mod n = (x + (y + z)) mod n. Rearranging parentheses in modular addition never changes the result, just as in ordinary integer arithmetic.

Is modulo multiplication associative?

Yes. For any integers x, y, z and modulus n, ((x * y) * z) mod n = (x * (y * z)) mod n. The order in which you group the multiplications does not matter.

Is modulo multiplication distributive over modulo addition?

Yes. For any integers x, y, z and modulus n, (x * (y + z)) mod n = ((x * y) + (x * z)) mod n. You can expand a product over a modular sum just as in ordinary algebra.

Can a modulo property ever fail for some choice of numbers?

No. All five properties - two commutative, two associative, one distributive - hold for every triple of integers and every modulus n >= 2. They are theorems inherited from integer arithmetic, not coincidences that depend on the values you choose. This calculator shows the verification with your specific numbers to build intuition, but the result is always "Yes - holds".

What algebraic structure do the integers mod n form?

The integers mod n under addition and multiplication form a commutative ring. When n is prime, the structure becomes a field, meaning every non-zero element has a multiplicative inverse. Composite moduli can also be fields only if n is a prime power and you use a different multiplication rule, but ordinary mod n for composite n is a ring, not a field.

Sources

Written by Grace Mbeki, MSc Data Scientist & Educator · Nairobi, Kenya

Turning everyday numbers into clear, actionable answers for the decisions that matter most.

Search 3,500+ calculators

Loading search…