You are on page 1of 17

4/12/2022

CHAPTER

7
Section 7.1 Modular Arithmetic
Introduction to Modular Arithmetic
Mathematical
Systems

Copyright © Cengage Learning. All rights reserved. Copyright © Cengage Learning. All rights reserved.
3

Introduction to Modular Arithmetic Introduction to Modular Arithmetic Introduction to Modular Arithmetic


If we want to determine a time in the future or in the past, it However, to determine the time 8 hours after 9 o’clock, we We will use the symbol to denote addition on a 12-hour
is necessary to consider whether we have passed must take into consideration that once we have passed clock. Using this notation,
12 o’clock. To determine the time 8 hours after 3 o’clock, 12 o’clock, we begin again with 1. Therefore, 8 hours after and
we add 3 and 8. Because we did not pass 12 o’clock, the 9 o’clock is 5 o’clock, as shown in Figure 8.1B on a 12-hour clock.
time is 11 o’clock (Figure 8.1A).
We can also perform subtraction on a 12-hour clock. If the
time now is 10 o’clock, then 7 hours ago the time was 3
o’clock, which is the difference between 10 and 7
(10 – 7 = 3).

Figure 8.1B
Figure 8.1A

4 5 6
4/12/2022

Introduction to Modular Arithmetic Example 1 – Perform Clock Arithmetic Introduction to Modular Arithmetic
However, if the time now is 3 o’clock, then, using Figure Evaluate each of the following, where and indicate A similar example involves day-of-the-week arithmetic. If
8.2, we see that 7 hours ago it was 8 o’clock. If we use the addition and subtraction, respectively, on a 12-hour clock. we associate each day of the week with a number, as
symbol to denote subtraction on a 12-hour clock, we can a. b. b. c. c. d. shown below, then 6 days after Friday is Thursday and 16
write days after Monday is Wednesday.
and Solution:
Calculate using a 12-hour clock.
a.

b.

c. Symbolically, we write
Figure 8.2
and
d.
7 8 9

Introduction to Modular Arithmetic Introduction to Modular Arithmetic Example 2 – Determine Whether a Congruence Is True

Note: We are using the symbol for days-of-the-week Situations such as these that repeat in cycles are Determine whether the congruence is true.
arithmetic to differentiate from the symbol for clock represented mathematically by using modular arithmetic, a. 29  8 mod 3
arithmetic. or arithmetic modulo n. b. 15  4 mod 6

Solution:
a. Find Because 7 is an integer,
29  8 mod 3 is a true congruence.

b. Find Because is not an integer,


15  4 mod 6 is not a true congruence.

10 11 12
4/12/2022

Introduction to Modular Arithmetic Example 3 – A Day of the Week Example 3 – Solution cont’d

Now suppose today is Friday. To determine the day of the July 4, 2017, was a Tuesday. What day of the week is Because 1826 ÷ 7 = 260 remainder 6, 1826  6 mod 7. Any
week 16 days from now, we observe that 14 days from now July 4, 2022? multiple of 7 days past a given day will be the same day of
the day will be Friday, so 16 days from now the day will be the week.
Sunday. Solution:
There are 5 years between the two dates. Each year has So the day of the week 1826 days after July 4, 2017, will be
Note that the remainder when 16 is divided by 7 is 2, or, 365 days except 2020, which has one extra day because it the same as the day 6 days after July 4, 2017. Thus July 4,
using modular notation, 16  2 mod 7. The 2 signifies 2 is a leap year. 2022, will be a Monday.
days after Friday, which is Sunday.
So the total number of days between the two dates is
5  365 + 1 = 1826.

13 14 15

Arithmetic Operations Modulo n Example 4 – Addition Modulo n


Arithmetic modulo n (where n is a natural number) requires Evaluate: (23 + 38) mod 12
us to evaluate a modular expression after using the
standard rules of arithmetic. Solution:
Add 23 + 38 to produce 61. To evaluate 61 mod 12, divide
Thus we perform the arithmetic operation and then divide 61 by the modulus, 12. The answer is the remainder.
Arithmetic Operations Modulo n by the modulus. The answer is the remainder.

The result of an arithmetic operation mod n is always a


whole number less than n.

The answer is 1.
16 17 18
4/12/2022

Example 5 – Subtraction Modulo n Example 5 – Solution cont’d


Arithmetic Operations Modulo n
Evaluate each of the following. b. Subtract Because the answer is negative, The methods of adding and subtracting in modular
a. (33 – 16) mod 6 we must find x so that –13  x mod 5. Thus we arithmetic can be used for clock arithmetic and
b. (14 – 27) mod 5 must find x so that the value of is an days-of-the-week arithmetic.
integer.

Solution:
Trying the whole number values of x less than 5, the
a. Subtract The result is positive. Divide the modulus, we find that when x = 2,
difference by the modulus, 6. The answer is the
remainder.

(14 – 27) mod 5 = 2

(33 – 16) mod 6 = 5


19 20 21

Example 6 – Calculating Times Example 6 – Solution cont’d


Arithmetic Operations Modulo n
Disregarding A.M. or P.M., if it is 5 o’clock now, what time Evaluating the expression for whole number values of x Problems involving multiplication can also be performed
was it 57 hours ago? less than 12, we have, when modulo n.
an integer.
Solution:
The time can be determined by calculating Thus (5 – 57) mod 12 = 8.
(5 – 57) mod 12. Because 5 – 57 = –52 is a negative
number, find a whole number x less than the modulus 12,
so that –52  x mod 12. Therefore, if it is 5 o’clock now, 57 hours ago it was 8
o’clock.

This means to find x so that is an integer.

22 23 24
4/12/2022

Example 7 – Multiplication Modulo n Solving Congruence Equations


Evaluate: (15  23) mod 11 Solving a congruence equation means finding all whole
number values of the variable for which the congruence is
Solution: true.
Find the product 15  23 and then divide by the modulus,11.
The answer is the remainder. For example, to solve 3x + 5  3 mod 4, we search for
Solving Congruence Equations whole number values of x for which the congruence is true.

The answer is 4. 25 26 27

Solving Congruence Equations Example 8 – Solve a Congruence Equation Example 8 – Solution cont’d

Solve: 2x + 1  3 mod 10

Solution:
Beginning with 0, substitute each whole number less than
10 into the congruence equation.

A congruence equation can have more than one solution


among the whole numbers less than the modulus. The next
example illustrates that you must check all whole numbers The solutions between 0 and 9 are 1 and 6; the remaining
less than the modulus. solutions are determined by repeatedly adding the
modulus, 10, to these solutions. The solutions are 1, 6, 11,
16, 21, 26, … .
28 29 30
4/12/2022

Additive and Multiplicative Inverses in Modular Arithmetic Example 9 – Find the Additive Inverse
We have known that if the sum of two numbers is 0, then Find the additive inverse of 7 in mod 16 arithmetic.
the numbers are additive inverses of each other. For
instance, 8 + (–8) = 0, so 8 is the additive inverse of –8, Solution:
and –8 is the additive inverse of 8.
In mod 16 arithmetic, so the additive inverse of
7 is 9.
Additive and Multiplicative Inverses The same concept applies in modular arithmetic. For
example, (3 + 5)  0 mod 8. Thus, in mod 8 arithmetic, 3 is
in Modular Arithmetic the additive inverse of 5, and 5 is the additive inverse of 3.
Here we consider only those whole numbers smaller
than the modulus.

31 32 33

Additive and Multiplicative Inverses in Modular Arithmetic Example 10 – Find a Multiplicative Inverse Example 10 – Solution cont’d

If the product of two numbers is 1, then the numbers are In mod 7 arithmetic, find the multiplicative inverse of 2.
multiplicative inverses of each other.
Solution:
For instance, , so 2 is the multiplicative inverse of To find the multiplicative inverse of 2, solve the equation
, and is the multiplicative inverse of 2. The same 2x  1 mod 7 by trying different natural number values of x In mod 7 arithmetic, the multiplicative inverse of 2 is 4.
concept applies to modular arithmetic (although the less than the modulus.
multiplicative inverses will always be natural numbers).

34 35 36
4/12/2022

CHAPTER

7
Section 7.2 Applications of Modular
Arithmetic
ISBN and UPC
Mathematical
Systems

Copyright © Cengage Learning. All rights reserved. Copyright © Cengage Learning. All rights reserved.
3

ISBN and UPC ISBN and UPC ISBN and UPC


Every book that is cataloged in the Library of Congress If we label the first digit of an ISBN d1, the second digit d2, Suppose, however, that a bookstore clerk sends an order
must have an ISBN (International Standard Book Number). and so on to the 13th digit d13, then the check digit is given for the American Heritage Dictionary and inadvertently
This 13-digit number was created to help ensure that by the following modular formula. enters the number 978-0-395-28517-4, where the clerk
orders for books are filled accurately and that books are transposed the 8 and 2 in the five numbers that identify the
catalogued correctly. book.

The first three digits of an ISBN are 978 (or 979), followed Correct ISBN: 978-0-395-82517-4
by 9 digits that are divided into three groups of various Incorrect ISBN: 978-0-395-28517-4
lengths. These indicate the country or region, the publisher,
and the title of the book. The last digit (the 13th one) is It is this check digit that is used to ensure accuracy.
called a check digit. The receiving clerk calculates the check digit as 6.

4 5 6
4/12/2022

ISBN and UPC Example 1 – Determine a Check Digit for an ISBN ISBN and UPC
Because the check digit is 6 and not 4 as it should be, the Determine the ISBN check digit for the book The Equation Another coding scheme that is closely related to the ISBN
receiving clerk knows that an incorrect ISBN has been that Couldn’t Be Solved by Mario Livio. The first 12 digits of is the UPC (Universal Product Code). This number is
sent. the ISBN are 978-0-7432-5820-? placed on many items and is particularly useful in grocery
stores.
Transposition errors are among the most frequent errors Solution:
that occur. A check-out clerk passes the product by a scanner, which
reads the number from a bar code and records the price on
the cash register.
The ISBN coding system will catch most of them.

If the price of an item changes for a promotional sale, the


price is updated in the computer, thereby relieving a clerk
of having to reprice each item.
The check digit is 3.
7 8 9

ISBN and UPC Example 2 – Determine the Check Digit of a UPC

In addition to pricing items, the UPC gives the store Find the check digit for the UPC of the Blu-ray Disc
manager accurate information about inventory and the release of the film Jurassic World. The first 11 digits are
buying habits of the store’s customers. 0-25192-21221-?

The UPC is a 12-digit number that satisfies a modular Solution:


equation that is similar to the one for ISBNs. The last digit Credit Card Numbers
is the check digit. If we label the 12 digits of the UPC as
d1, d2, ... , d12, we can write a formula for the UPC check
digit d12.

10 The check digit is 5. 11 12


4/12/2022

Credit Card Numbers Credit Card Numbers Credit Card Numbers


Companies that issue credit cards also use modular The table below shows some of the identification prefixes The Luhn algorithm, used to determine whether a credit
arithmetic to determine whether a credit card number is used by four popular card issuers. card number is valid, is calculated as follows: Beginning
valid. with the next-to-last digit (the last digit is the check digit)
and reading from right to left, double every other digit.
This is especially important in e-commerce, where credit
card information is frequently sent over the Internet. The If a digit becomes a two-digit number after being doubled,
primary coding method is based on the Luhn algorithm, treat the number as two individual digits.
which uses mod 10 arithmetic.
Now find the sum of the new list of digits; the final sum
Credit card numbers are normally 13 to 16 digits long. The must be congruent to 0 mod 10. The Luhn algorithm is
first one to six digits are used to identify the card issuer. demonstrated in the next example.

13 14 15

Example 3 – Determine a Valid Credit Card Number Example 3 – Solution cont’d

Determine whether 5234 8213 3410 1298 is a valid credit Finally, add all digits, treating two-digit numbers as two
card number. single digits.

Solution:
Highlight every other digit, beginning with the next-to-last
digit and reading from right to left. Cryptology
Because 60  0 mod 10, this is a valid credit card number.

Next double each of the highlighted digits.

16 17 18
4/12/2022

Cryptology Cryptology Cryptology


Related to codes on books and grocery items are secret Before we discuss how messages are coded, we need to The method of changing from plaintext to ciphertext is
codes. These codes are used to send messages between define a few terms. Plaintext is a message before it is called encryption.
people, companies, or nations. coded. The line
The line from the poem was encrypted by substituting each
It is hoped that by devising a code that is difficult to break, SHE WALKS IN BEAUTY LIKE THE NIGHT letter in plaintext with the letter that is 22 letters after that
the sender can prevent the communication from being read letter in the alphabet.
if it is intercepted by an unauthorized person. from Lord Byron’s poem “She Walks in Beauty” is in
plaintext. Ciphertext is the message after it has been (Continue from the beginning when the end of the alphabet
Cryptology is the study of making and breaking secret written in code. The line is reached.) This is called a cyclical coding scheme
codes. because each letter of the alphabet is shifted the same
ODA SWHGO EJ XAWQPU HEGA PDA JECDP number of positions.

is the same line of the poem in ciphertext.


19 20 21

Cryptology Cryptology Example 4 – Write Messages Using Cyclical Coding

The original alphabet and the substitute alphabet are If a cryptologist thinks a message has been encrypted Use the cyclical alphabetic encrypting code that shifts each
shown below. using a cyclical substitution code like the one shown letter 11 positions to
previously, the key to the code can be found by taking a
word from the message (usually one of the longer words) a. code CATHERINE THE GREAT.
and continuing the alphabet for each letter of the word.
b. decode TGLY ESP EPCCTMWP.

When a recognizable word appears, the key can be


Solution:
To decrypt a message means to take the ciphertext determined.
a. The encrypting congruence is c  (p + 11) mod 26.
message and write it in plaintext. Replace p by the numerical equivalent of each letter of
plaintext and determine c.

22 23 24
4/12/2022

Example 4 – Solution cont’d


Example 4 – Solution cont’d
Cryptology
The results for CATHERINE are shown below. b. Because m = 11, n = 26 – 11 = 15. The ciphertext is The practicality of a cyclical alphabetic coding scheme is
decoded by using the congruence p  (c + 15) mod 26. limited because it is relatively easy for a cryptologist to
The results for TGLY are shown below. determine the coding scheme.

A coding scheme that is a little more difficult to break is


based on the congruence c  (ap + m) mod 26, where a
and 26 do not have a common factor.

Continuing, the ciphertext would be decoded as IVAN THE


TERRIBLE.
Continuing, the plaintext would be coded as NLESPCTYP
ESP RCPLE.
25 26 27

Example 5 – Encode a Message Example 5 – Solution cont’d


Example 6 – Decode a Message
Use the congruence c  (5p + 2) mod 26 to encode the The results for LASER are shown below. Decode the message ACXUT CXRT, which was encrypted
message LASER PRINTER. using the congruence c  (3p + 5) mod 26.

Solution:
Solution:
Solve the congruence equation for p.
The encrypting congruence is c  (5p + 2) mod 26. Replace
p by the numerical equivalent of each letter from Table 8.1
and determine c.
Continuing, the plaintext is coded in ciphertext as JGSAN
DNUTXAN.

Numerical Equivalents for the Letters of the Alphabet


Table 8.1 The decoding congruence is .
28 29 30
4/12/2022

Example 6 – Solution cont’d

Using this congruence, we will show the details for


decoding ACXUT.

Continuing, we would decode the message as PHONE


HOME.

31
4/12/2022

CHAPTER

7
Section 7.3 Introduction to Group
Theory
Introduction to Groups
Mathematical
Systems

Copyright © Cengage Learning. All rights reserved. Copyright © Cengage Learning. All rights reserved.
3

Introduction to Groups Introduction to Groups Introduction to Groups


An algebraic system is a set of elements along with one The first of these characteristics is that the set is closed The third requirement of a group is that the set must
or more operations for combining the elements. The real with respect to the operation. contain an identity element.
numbers with the operations of addition and multiplication
are an example of an algebraic system. Mathematicians Closure means that if any two elements are combined An identity element is an element that, when combined
classify this particular algebraic system as a field. using the operation, the result must be an element of the with a second element using the group’s operation, always
set. returns the second element.

The second requirement of a group is that the operation The number 0 is called an additive identity and the number
must satisfy the associative property. 1 is called a multiplicative identity. An identity element does
not always have to be zero or one.
We have known that the associative property of addition The last requirement of a group is that each element must
states that . have an inverse.
4 5 6
4/12/2022

Example 1 – Verify the Properties of a Group Example 1 – Solution cont’d


Introduction to Groups
Show that the integers with addition as the operation form a 2. The associative property of addition holds true for the We have known that the commutative property for an
group. integers. operation states that the order in which two elements are
combined does not affect the result.
Solution: 3. The identity element is 0, which is an integer. Therefore,
We must show that the four properties of a group are the integers have an identity element for addition. For example, the group {0, 1, 2, 3, 4, 5} with addition
satisfied. modulo 6 satisfies the commutative property, since, for
4. Each element has an inverse. If a is an integer, then –a instance, 2 + 5 = 5 + 2. Groups in which the operation
1. The sum of two integers is always an integer. satisfies the commutative property are called commutative
is the inverse of a.
For instance, groups or abelian groups, after Niels Abel.

Because each of the four conditions of a group is satisfied,


the integers with addition as the operation form a group. The type of group we will look at next is an example of a
Therefore, the integers are closed with respect to nonabelian group. A nonabelian group is a group whose
addition. operation does not satisfy the commutative property.
7 8 9

Symmetry Groups Symmetry Groups


The concept of a group is very general. The elements that Consider two equilateral triangles, one placed inside the
make up a group do not have to be numbers, and the other, with their vertices numbered clockwise from 1 to 3.
operation does not have to be addition or multiplication.
Also, a group does not have to satisfy the commutative The larger triangle is the reference triangle. If we pick up
property. the smaller triangle, there are several different ways in
Symmetry Groups We will now look at another group, called a symmetry
which we can set it back in its place. Each possible
positioning of the inner triangle will be an element of a
group, an extension of which plays an important role in the
group.
study of atomic reactions.

Symmetry groups are based on regular polygons. A For instance, we can pick up the triangle and replace it
regular polygon is a polygon all of whose sides have the exactly as we found it. We will call this position I; it will
same length and all of whose angles have the same represent no change in position.
measure.
10 11 12
4/12/2022

Symmetry Groups Symmetry Groups Symmetry Groups


Now pick up the smaller triangle, rotate it 120° clockwise, Now return the smaller triangle to its original position, If the original triangle were rotated 360°, there would be no
and set it down again on top of the reference triangle. The where the numbers on the vertices of the triangles apparent change. The vertex at 1 would return to 1, the
result is shown below. coincide. Consider a 240° clockwise rotation of the smaller vertex at 2 would return to 2, and the vertex at 3 would
triangle. The result of this rotation is shown below. return to 3. Because this rotation does not produce a new
arrangement of the vertices, we consider it the same as the
element we named I.

If we rotate the inner triangle counterclockwise 120°, the


effect is the same as rotating it 240° clockwise. This
rotation does not produce a different arrangement of the
Note that the vertex originally at vertex 1 of the reference Note that the vertex originally at vertex 1 of the reference vertices. Similarly, a counterclockwise rotation of 240° is
triangle is now at vertex 2, 2 is now at 3, and 3 is now at 1. triangle is now at vertex 3, 2 is now at 1, and 3 is now at 2. the same as a clockwise rotation of 120°.
We call the rotation of the triangle 120° clockwise R120. We call the rotation of the triangle 240° clockwise R240.
13 14 15

Symmetry Groups Symmetry Groups Symmetry Groups


In addition to rotating the triangle clockwise 120° and 240° For rotation Rl, the bottom left vertex does not change, but The six positions of the vertices we have seen thus far are
as we did above, we could rotate the triangle about a line of vertices 2 and 3 are interchanged. the only possibilities: I (the triangle without any rotation),
symmetry that goes through a vertex before setting the R120, R240, Rl, Rt, and Rr. These positions are shown below
triangle back down. Because there are three vertices, there If we rotate the triangle about the line of symmetry through (without the reference triangle).
are three possible results. These are shown below. the top vertex, rotation Rt, vertex 2 does not change, but
vertices 1 and 3 are interchanged.

For rotation Rr, the bottom right vertex does not change,
but vertices 1 and 2 are interchanged. As we will see, these rotations are elements that form a
group.

16 17 18
4/12/2022

Symmetry Groups Symmetry Groups Symmetry Groups


A group must have an operation, a method by which two To determine the outcome of the “followed by” operation on Note that any rotation of the triangle changes the position
elements of the group can be combined to form a third two elements of the group, we drew triangles and then of the vertices. For R120, the vertex originally at position 1
element that must also be a member of the group. (We rotated them as directed by the type of rotation. moved to position 2, the vertex at 2 moved to 3, and the
know that a group operation must be closed.) The vertex at 3 moved to 1. We can represent this as
operation we will use is called “followed by” and is From a mathematical point of view, it would be nice to have
symbolized by . a symbolic (rather than geometric) way of determining the
outcome.
We have stated that the elements R120, R240, Rl, Rt, Rr, and Similarly, for Rt, the vertex originally at position 1 moved to
I, with the operation “followed by,” form a group. We can do this by creating a mathematical object that position 3, the vertex at 2 remained at 2, and the vertex at
describes the geometric object. 3 moved to 1. This can be represented as

19 20 21

Symmetry Groups Example 3 – Symbolic Notation


The remaining four elements can be represented as Use symbolic notation to find R120Rt.

Solution:
To find the result of R120Rt, we follow the movement of
each vertex. The path that vertex 2 follows is highlighted.
Permutation Groups

22 23 24
4/12/2022

Permutation Groups Permutation Groups Permutation Groups


The triangular symmetry group discussed previously is an If we start with the numbers 1 2 3, we can represent There are only six distinct permutations of the numbers
example of a special kind of group called a permutation permutations of the numbers using the same symbolic 1 2 3. We list and label them below. The identity element is
group. method that we used for the triangular symmetry group. For named I.
example, the permutation that rearranges 1 2 3 to 2 3 1 can
A permutation is a rearrangement of objects. For instance, be written
if we start with the arrangement of objects [♦ ♥ ♣], then one
permutation of these objects is the rearrangement [♥ ♣ ♦]. If
we consider each permutation of these objects as an
element of a set, then the set of all possible permutations
forms a group. which means that 1 is replaced by 2, 2 is replaced by 3,
and 3 is replaced by 1. The operation for the group is “followed by,” which we will
The elements of the group are not numbers or the objects again denote by the symbol . One can verify that the six
themselves, but rather the different permutations of the elements along with this operation do indeed form a group.
objects that are possible.
25 26 27

Example 4 – Perform an Operation in a Permutation Group Example 4 – Solution Example 4 – Solution cont’d

Find BC, where B and C are elements of the permutation When these actions are combined, 3 remains as 3. The
group defined as
result of the operation is

In the first permutation, 1 is replaced by 3. In the second


permutation, 3 is replaced by 2.
Thus we see that BC = E.
When we combine these two actions, 1 is ultimately
replaced by 2.

Similarly, in the first permutation 2 is replaced by 1, which


remains as 1 in the second permutation.

3 is replaced by 2, which is in turn replaced by 3.


28 29 30

You might also like