Article - Modular arithmetic explained: basics, applications and examples - Casio Calculators

Modular arithmetic explained: basics, applications and examples

Learn what your students will need to know when solving problems using modular arithmetic

A Level students using the fx-CG50 graphing calculator

Modular arithmetic is a topic that is reserved for Further Maths papers at A-level. It’s something only a small proportion of students will come across, but those who do will need to be prepared to answer these questions in exams and beyond. Modular arithmetic has a range of uses that are central to many parts of our day-to-day lives, especially when it comes to areas such as computer science that much modern technology depends on.

In this guide, we’ll explain how this area of maths works, what students need to know in order to answer any questions correctly and how the concepts can be applied to real-world problems.

Teacher and students in the Classroom

What is modular arithmetic and how does it work?

Modular arithmetic focuses only on integers and is defined by the way in which numbers ‘wrap around’ back to zero at a defined point, known as the modulus, or mod. It is closely related to number theory, which looks at the properties and relationships of numbers.
 
One of the most common places where modular arithmetic is used in the real world is on the face of a clock. This is a great way to introduce the topic to students, as it’s something they’ll have been familiar with since primary school – they just won’t have known until A-level that it’s actually modular arithmetic.
 
For example, students will know that if it’s 10am now, in five hours it will be 3pm, because after 12, the next number on the clock is 1, not 13. Therefore, in this case, the modulus is 12.
 
Another way to look at modular arithmetic is to think of it as finding the remainder of a number when it is divided by another number. When two integers (a and b) leave the same remainder when divided by the modulus (n), this is called congruence and is illustrated by the symbol ≡.
 
For example, in the clock face example above, since both 15 and 3 leave the same remainder when divided by 12, they are congruent, so we can express this as:
 
15≡3(mod12)

Students and teacher

Common rules and properties

There are several modular arithmetic properties students must be aware of when performing addition, subtraction and multiplication calculations.
 
For addition, the key modular arithmetic rules and properties are as follows:
 
If a + b = c, then a (mod n) + b (mod n) ≡ c (mod n)
If a ≡ b (mod n), then a + k ≡ b + k (mod n) for any integer k
If a ≡ b (mod n) and c ≡ d (mod n), then a + b ≡ b + d (mod n)
If a ≡ b (mod n), then -a ≡ -b (mod n)
 
The properties of multiplication in modular arithmetic are:
 
If a ⋅ b=c, then a (mod n) ⋅ b (mod n) ≡ c (mod n)
If a ≡ b (mod n), then ka ≡ kb (mod n) for any integer k
If a ≡ b (mod n) and c ≡ d (mod n), then ac ≡ bd (mod n)

Students using the Casio fx-CG50

Applications of modular arithmetic

Modular arithmetic has a wide range of practical applications. As you’ve seen above, it’s essential when working with times and days. If you want to know what time it will be 32 hours from now, for example, or what day of the week it will be in 100 days’ time, modular arithmetic is the fastest and easiest way to answer these questions.

However, uses go far beyond this. For example, it plays a crucial role in cryptography, as encryption and decryption algorithms often use modular arithmetic operations to ensure the confidentiality of data and generate secure keys. In computer science, it is used in checksums to validate data such as credit card or ISBN numbers.

Another practical application that may be highly relevant in exams is using modular arithmetic as a quick check that any workings have been done correctly. Using mod 10 to look at numbers can be very useful in verifying answers.

For example, if a student needs to multiply 152 by 28, they can use modular arithmetic to know that the correct answer will end in a 6, as the product of the digits in the units column will be 2×8=16≡6(mod10). If it doesn’t, this is a quick sign there has been a mistake in the arithmetic, such as entering the wrong value into their calculator or errors when doing the work by hand.

How to solve problems using modular arithmetic

Students can use modular arithmetic to simplify problems they may be faced with in exams, provided they bear in mind some key concepts, such as congruence. Identifying the correct modulo and remainders of division are key to reaching the correct answer.

Calculators can be used in modular arithmetic to assist with finding the remainder of division, which is essential in identifying congruences. This can be found using the MOD function to obtain the quotient and remainder in a division calculation.

As a simple example, consider the below question:

“If the time is currently 7pm, what time will it be in 1,000 hours?”

The easiest way to answer this is with modular arithmetic. As a day consists of 24 hours, and there will be 41 full days in 1,000 hours, we can use mod 24 to find the answer as follows:

1000 ≡ 16 + (24×41) ≡ 16 (mod 24)

This shows us that the time in 1,000 hours is equivalent to the time in 16 hours. Therefore, we can simply add 16 hours to 7pm to find that it will be 11am in 1,000 hours. On the fx-CG50, this can be calculated using MOD (1000,24).

Do you want to go further with our products?

Designed to benefit teachers and students alike, our webinars deliver the skills and knowledge necessary to optimise the use of our products. Learn from experts, gain valuable skills and uncover strategies to improve teaching and learning.

Blog

  • Graphing technology
  • Scientific calculators
  • Exams
  • Curriculum
  • Classroom
  • Students