|
▭\:\longdivision{▭} | \times \twostack{▭}{▭} | + \twostack{▭}{▭} | - \twostack{▭}{▭} | \left( | \right) | \times | \square\frac{\square}{\square} |
|
- \twostack{▭}{▭} | \lt | 7 | 8 | 9 | \div | AC |
+ \twostack{▭}{▭} | \gt | 4 | 5 | 6 | \times | \square\frac{\square}{\square} |
\times \twostack{▭}{▭} | \left( | 1 | 2 | 3 | - | x |
▭\:\longdivision{▭} | \right) | . | 0 | = | + | y |
Some math ideas are about measuring how much. Modulo is about measuring what’s left. Modulo is a way of finding the remainder when one number is divided by another. It’s written as: $a \bmod n$. For example: $14 \bmod 5 = 4$ because 5 fits into 14 twice, with 4 left over. You’ve seen it in real life, even if you didn’t know it. If today is Monday, what day will it be 10 days from now? Not “Day 10,” but Thursday because $10 \bmod 7 = 3$.
In this article, we’ll walk through how modulo works, step by step. You’ll learn how to solve equations with it, understand its patterns, and see how to use Symbolab’s Modulo Calculator to check your work and explore further. Whether you’re new to this or brushing up, you’re in the right place.
Let’s now explore how modulo works when we add, subtract, or multiply numbers. This branch of math is called modular arithmetic, and once you learn its patterns, you’ll start seeing it all around you. Modular arithmetic is like regular arithmetic, except all the results are “wrapped around” a fixed number — the modulus. Think of it like a number line that loops back on itself, like a clock face.
Let’s look at the main rules using real examples.
If:
$ a \mod n = r_1 \quad \text{and} \quad b \mod n = r_2 $
then:
$ (a + b) \mod n = (r_1 + r_2) \mod n $
Real-Life Example: Time on a Clock
Suppose it's 8 o’clock now, and your train leaves in 11 hours. What time will it be then?
That’s really:
$ 8 + 11 = 19 $ (in regular time)
But on a 12-hour clock, you want:
$ 19 \mod 12 = 7 $
So the train leaves at 7 o’clock.
Math Check:
$ 8 \mod 12 = 8 \quad \text{and} \quad 11 \mod 12 = 11 $
$ (8 + 11) \mod 12 = 19 \mod 12 = 7 $
The rule holds and helps us make sense of time that wraps around.
If:
$ a \mod n = r_1 \quad \text{and} \quad b \mod n = r_2 $
then:
$ (a - b) \mod n = (r_1 - r_2) \mod n $
Real-Life Example: Scheduling Days of the Week
Let’s say today is Friday, and you’re thinking about something that happened 9 days ago. What day was that?
Start by assigning numbers: Friday is day 5 (if Sunday is day 0). So:
$ 5 - 9 = -4 $
We need to find:
$ -4 \mod 7 $
To make this positive, we add 7:
$ -4 + 7 = 3 $
Day 3 is Wednesday.
Math Check:
Let $ a = 5 $, $ b = 9 $, $ n = 7 $
Then:
$ (5 - 9) \mod 7 = (-4) \mod 7 = 3 $
So 9 days before Friday is Wednesday. The subtraction rule helps you step backward through cycles.
If:
$ a \mod n = r_1 \quad \text{and} \quad b \mod n = r_2 $
then:
$ (a \cdot b) \mod n = (r_1 \cdot r_2) \mod n $
Real-Life Example: Rotating Turns in a Game
Imagine four friends are taking turns in a board game: Players 1 through 4. You want to know whose turn it will be after 6 more moves, starting from Player 2.
That’s:
$2 + 6 = 8\quad\text{and}\quad8 \bmod 4 = 0$
So it’ll be Player 4’s turn.
Now try a different version: what if you multiply the number of turns taken?
Let’s say Player 2 takes 6 turns in a row:
$2 \cdot 6 = 12\quad\text{and}\quad12 \bmod 4 = 0$
It loops back to Player 4 again. The multiplication rule shows how even large numbers can fit into a simple repeating system.
Division in modular arithmetic doesn’t behave the way we might expect. You can’t divide the remainders and assume the result will follow the rule.
For example:
$ (6 \div 2) \mod 5 = 3 \mod 5 = 3 $
But:
$ 6 \mod 5 = 1, \quad 2 \mod 5 = 2, \quad 1 \div 2 = 0.5 \quad \text{(not useful here)} $
So division in modular systems requires a new tool: the modular inverse.
You’ve seen how modular arithmetic works with addition, subtraction, and multiplication. But what about division?
In regular math, dividing is easy. If you have $6 \div 2$, the answer is $3$ because $2 \times 3 = 6$. But in modular arithmetic, we can’t always divide in the usual way. Instead, we need a tool called the modular inverse.
The modular inverse of a number $a$ (modulo $n$) is a number $x$ such that:
$a \cdot x \equiv 1 \mod n$
We write this as:
$x = a^{-1} \mod n$
This means $x$ is the modular inverse of $a$ modulo $n$, because multiplying $a$ by $x$ gives $1$ in modulo $n$.
For example, in modulo $7$, the modular inverse of $3$ is $5$ because:
$3 \cdot 5 = 15 \mod 7 = 1$
You can check it the other way too:
$5 \cdot 3 = 15 \mod 7 = 1$
It works both ways.
Why is this useful?
Let’s say you have a machine that takes any input number, multiplies it by $3$, and then reduces the result modulo $7$. If you enter $4$, the machine does:
$3 \cdot 4 = 12 \mod 7 = 5$
You get $5$ as the output. But what if someone else sees $5$ and wants to figure out what number was entered? You can’t divide by $3$ directly. Instead, you multiply by the modular inverse of $3$:
$5 \cdot 5 = 25 \mod 7 = 4$
Now you’ve recovered the original input. That’s what the modular inverse does. It lets you reverse multiplication in a modular system.
When does a modular inverse exist?
A modular inverse of $a$ modulo $n$ exists only if $a$ and $n$ are coprime. That means they have no common divisors other than $1$:
$\gcd(a, n) = 1$
If $a$ and $n$ share any common factor greater than $1$, then the modular inverse does not exist.
Example: Find the modular inverse of $3 \mod 7$
We want a number $x$ such that:
$3 \cdot x \equiv 1 \mod 7$
Try small values:
So the modular inverse is:
$3^{-1} \mod 7 = 5$
Example: Does $2$ have an inverse modulo $6$?
We want to find $x$ such that:
$2 \cdot x \equiv 1 \mod 6$
Try a few values:
None of these give $1$. That’s because $2$ and $6$ are not coprime. They share a factor of $2$, so: $\gcd(2, 6) = 2$
And the modular inverse does not exist.
Why does this matter when solving equations?
Let’s say you are solving a modular equation like:
$4x \equiv 8 \mod 11$
To isolate $x$, you need to divide both sides by $4$. But since division doesn’t work directly in modular arithmetic, you use the modular inverse of $4$ modulo $11$.
Try values to find it:
So:
$4^{-1} \mod 11 = 3$
Now multiply both sides of the original equation by $3$:
$3 \cdot 4x \equiv 3 \cdot 8 \mod 11$
But we simplify:
$x \equiv 24 \mod 11 = 2$
So the solution is:
$x=2$
Modular inverses unlock the power of division in systems where numbers repeat in cycles. They don’t always exist, but when they do, they let you solve equations, reverse operations, and understand the structure behind patterns in programming, cryptography, and more.
You’ve learned that division doesn’t work the usual way in modular arithmetic. But when a number has a modular inverse, we can still solve equations that look like division problems — we just do it step by step, using multiplication instead.
Let’s look at how this works using a single example.
Example: Solve $4x \equiv 8 \mod 11$
Step 1: Understand what you're solving
You’re given the modular equation: $4x \equiv 8 \mod 11$
This means you’re looking for a number $x$ such that when $x$ is multiplied by $4$, the result is congruent to $8$ modulo $11$.
Step 2: Check if a modular inverse of $4$ modulo $11$ exists
To solve this equation, we need to find the modular inverse of $4$ modulo $11$. That inverse only exists if $4$ and $11$ are coprime — that is:
$\gcd(4, 11) = 1$
Since $4$ and $11$ have no common divisors other than $1$, the inverse exists.
Step 3: Find the modular inverse of $4 \mod 11$
Now try small values of $x$ to find the number that makes:
$4 \cdot x \equiv 1 \mod 11$
Try:
There it is. So:
$4^{-1} \mod 11 = 3$
Step 4: Multiply both sides of the original equation by the inverse
Take the original equation:
$4x \equiv 8 \mod 11$
Now multiply both sides by $3$, the modular inverse of $4$:
$3 \cdot 4x \equiv 3 \cdot 8 \mod 11$
Simplify both sides:
Now reduce modulo $11$:
$12x \equiv 24 \mod 11$
But $12 \mod 11 = 1$, so:
$x \equiv 24 \mod 11$
And $24 \mod 11 = 2$, so:
$x=2$
Final Answer:
The solution to the equation $4x \equiv 8 \mod 11$ is: $x=2$
What happens when the number is negative? Modulo still works, you just shift it back into the positive range. Remember, modulo always gives a result between $0$ and $n - 1$. So if you end up with a negative number, you can add the modulus until you get something positive.
Real-Life Example: Going Back in Time
Let’s say today is Monday. If we number the days of the week starting with Sunday as $0$, then Monday is $1$.
Now someone asks: “What day was it 4 days ago?”
You subtract:
$1−4=−3$
Now take:
$-3 \mod 7 = 4$
That means 4 days before Monday is Thursday (day $4$). You didn’t go off the calendar you just wrapped around.
Even once you understand how modulo works, it’s easy to make small mistakes. Here are a few to watch out for:
Keep these in mind as you practice. Modulo is a loop, not a straight line — when in doubt, go back to the basics: divide, subtract, and see what’s left.
Symbolab’s Modulo Calculator doesn’t just give answers. It shows you how each step works so you can learn, check your work, or explore new problems with confidence.
There are a few ways to input your math problem:
Once your expression is entered, press Go.
After you click Go, Symbolab shows a clear, step-by-step explanation of how the problem is solved. You’ll see:
You can also turn on “One step at a time” to follow the process more slowly and understand each move clearly.
If something doesn’t make sense, open the chat with Symbo. You can ask follow-up questions and get explanations right there, like having a tutor walk you through it.
Modulo helps you work with patterns, remainders, and repeating systems. It shows up in math, coding, calendars, and more. Whether you're solving by hand or using Symbolab to guide you, understanding modulo builds real problem-solving confidence. Keep practicing, and remember that every remainder tells you something about where you are in the cycle.
modulo-calculator
en
Please add a message.
Message received. Thanks for the feedback.