0% found this document useful (0 votes)
118 views36 pages

Topic 1 - Modular Arithmetic

This document introduces modular arithmetic. It defines modular arithmetic as an abstraction of counting methods used in everyday situations like determining months or days from a given amount of time. The key aspects covered are: - Modular arithmetic uses the division algorithm and modulus (mod) operator to map integers to a specific range based on the divisor. - Modular operations like addition, subtraction, multiplication, and exponentiation follow specific properties and can be used to solve problems. - Examples are provided to demonstrate calculating various modular expressions like 23+16 mod 5 to show the application of modular arithmetic concepts.

Uploaded by

Domz Sensei
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views36 pages

Topic 1 - Modular Arithmetic

This document introduces modular arithmetic. It defines modular arithmetic as an abstraction of counting methods used in everyday situations like determining months or days from a given amount of time. The key aspects covered are: - Modular arithmetic uses the division algorithm and modulus (mod) operator to map integers to a specific range based on the divisor. - Modular operations like addition, subtraction, multiplication, and exponentiation follow specific properties and can be used to solve problems. - Examples are provided to demonstrate calculating various modular expressions like 23+16 mod 5 to show the application of modular arithmetic concepts.

Uploaded by

Domz Sensei
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

ABSTRAC T A LG E BR A

MODU L AR A RI TH MET I C
OBJECTIVES

• UNDERSTAND MODULAR ARITHMETIC WITH EXAMPLES


• UNDERSTAND ABOUT CONGRUENCE
• IDENTIFY VALID AND INVALID CONGRUENCE
• USE MODULO CONCEPTS AND PROPERTIES TO SOLVE
MODULAR ARITHMETIC PROBLEMS AND COMPOSE
PROOFS
MODULAR ARITHMETIC

•ANOTHER APPLICATION OF THE DIVISION


ALGORITHM THAT WILL BE IMPORTANT TO US IS
MODULAR ARITHMETIC. MODULAR ARITHMETIC
IS AN ABSTRACTION OF A METHOD OF
COUNTING THAT YOU OFTEN USE
FOR EXAMPLE
• IF IT IS NOW SEPTEMBER, WHAT MONTH WILL IT BE 25 MONTHS
FROM NOW?

• OF COURSE, THE ANSWER IS OCTOBER, BUT THE INTERESTING


FACT IS THAT YOU DIDN’T ARRIVE AT THE ANSWER BY STARTING
WITH SEPTEMBER AND COUNTING OFF 25 MONTHS.

• INSTEAD,
WITHOUT EVEN THINKING ABOUT IT, YOU SIMPLY
OBSERVED THAT 25=212+1, AND YOU ADDED 1 MONTH TO
SEPTEMBER
FOR EXAMPLE

• If it is now wednesday, you know that in 23 days it will be


friday.
• This time, you arrived at your answer by noting that
23=3+2, so you added 2 days to wednesday instead of
counting off 23 days
WHAT IS MODULAR ARITHMETIC?

•Modular arithmetic is an abstraction of a


method of counting that you often use.
Surprisingly, this simple idea has numerous
important applications in mathematics and
computer science.
THE DIVISION ALGORITHM:
• Given any positive integer n and any nonnegative integer a, if we divide a by n, we
get an integer quotient q and an integer remainder r that obey the following
relationship:

• a=qn+r 0 r<n; q = a / n

• Where x is the largest integer less than or equal to x.


E.G. Let a = 7 and n = 3, then 7 = 2  3 + 1. Here, q = 2 and r = 1,
Let a = 10 and n = 2, then 10 = 5  2 + 0. Here, q = 5 and r = 0,
Let a = -11 and n = 7, then -11 = (-2)  7 + 3. Here, q = -2 and r = 3.
WHAT IS MODULAR ARITHMETIC?

•When a=qn+r, where q is the


quotient and r is the remainder
upon dividing a by n, we write
a mod n = r.
EXAMPLE
3 mod 2 = 1 since 3= 1∙2+1
6 mod 2=0 since 6=3∙2+0,
11 mod 3=2 since 11=3∙3+2,
62 mod 85=62 since 62=0∙85+62,
-2 mod 15 = 13 since -2 =(-1)15+13
a
a: dividend
r:remainder
n:divisor
Modular arithmetic
operations:
• The (mod n) operation maps all integers into the set of integers
{0, 1, … , (n -1)}. The modular arithmetic exhibits the following
properties:
find (39 + 1 4 ) m o d 4
find (23+1 6 ) m o d 5
+ 1 5 m od 1 1 )m od 1 1
find (23 mod 11
find (39 - 1 4 ) m o d 4
find (23- 1 6 ) m o d 3
7+ 2 3 m od 7)m od 7
find (54 mod
find (3 * 1 4 ) m o d 4
find (23*1 6 ) m o d 3
od 7* 1 1 m od 7)m od 7
find (5 m
E x p o n e n t ia l
modulo
How to calculate ab mod n
Ca lcu la t e
Calculate
Calculate
Calculate
Ca lcu la t e
Calculate

You might also like