ITT-LSSA “Copernico Erasmus+ KA1- School staff mobility ... · “Erasmus 2 & 4 Europe”...

Post on 22-May-2020

4 views 0 download

Transcript of ITT-LSSA “Copernico Erasmus+ KA1- School staff mobility ... · “Erasmus 2 & 4 Europe”...

ITT-LSSA “Copernico”

Erasmus+ KA1- School staff mobility

Project number 2017-1-IT02-KA101-036207

“Erasmus 2 & 4 Europe”

Structured course

CLIL in Dublin: Content and Language Integrated Learning

Dublin, Ireland, from 25/02/2018 to 03/03/2018

Prof. Francesco Urbano

A.S. 2017/2018

Project result

CLIL Module

“Modular Arithmetic: Cryptographer's Mathematics“

Subject: Computer networks (Sistemi e reti)

Informazioni sul modulo

Disciplina Non Linguistica (DNL) Sistemi e reti

Lingua straniera (L2) Inglese

Classe Terza

Scuola Istituto Tecnico Tecnologico – Indirizzo

Informatica

Livello medio L2 B1-B2

Tempo 8 h

Lingua L2 80-90% + L1 10-20%

Materiale Slides, video, interactive whiteboard

(IWB), computers

Modular Arithmetic: Cryptographer's Mathematics

Culture

• Some historical background: Karl Friedrich Gauss (1777-

1855) and his modern approach to modular arithmetic

• The use of modular arithmetic in ancient Chinese, Indian,

and Islamic cultures

• How people from different countries read and tell time

• The importance of modular arithmetic in ancient and

modern cryptography

Modular Arithmetic

Cryptographer's

Mathematics

Content

• Definition of module and modulus

• Arithmetic operations using mod-arithmetic rules

• Mod-Addition, Mod-Subtraction, Mod-Multiplication

• Congruence mod n

Communication

• Key vocabulary / phrases (integer, module, division, dividend,

divisor, quotient, remainder, etc.)

• Language for describing arithmetic rules and operations (Let ...

be ..., ... is congruent to ..., If ... then ..., etc)

• Questioning (what is … ?, How can you perform …?, etc.)

• Reading comprehension: ensure that you draw the most

important information about modular arithmetic from the lesson

Cognition

• Interpreting information: verify that you can read information regarding various moduli and interpret it correctly

• Compare and contrast different ways of performing the same calculations, evaluate advantages and / or

disadvantages

• Critical thinking: apply relevant concepts to examine information about telling time in a different light

• Problem solving: use acquired knowledge to solve modular arithmetic practice problems

The 4 Cs

Assessment

Assessment will be based on:

• Knowledge of the mod-arithmetic definitions and rules

• Ability in applying rules to perform modular arithmetic

operations

• Ability in logical elaboration (analysis, synthesis,

interpretation, problem solving)

• Communication: ability to read, write, explain mod-arithmetic

operations and related topics

• Use of modular arithmetic specific lexicon (CALP- Cognitive

Academic Language Proficiency)

CONTENUTI

Conoscenze Applicazione delle conoscenze Range punteggio Punti

Mostra una conoscenza completa ed approfondita E' in grado di utilizzare le nuove conoscenze in modo

creativo anche in altri contesti 17 - 20

Mostra una conoscenza completa ma non

approfondita

E' in grado di utilizzare le nuove conoscenze anche in

altri contesti 13 – 16

Mostra una conoscenza di base Stenta ad utilizzare le conoscenze in altri contesti 9 – 12

Mostra una conoscenza frammentaria e

superficiale

Non è in grado di utilizzare le conoscenze in altri

contesti 5 – 8

Non ha acquisito i concetti di base relativi

all'argomento

Non è in grado di esprimere i concetti e utilizzarli in

altri contesti 0 – 4

LINGUAGGIO Range punteggio Punti

Si esprime con scioltezza, ha un ampio vocabolario, anche tecnico, scrive in modo chiaro e corretto 9 – 10

Usa con discreta padronanza una discreta gamma di strutture linguistiche e vocaboli 6 -8

Possiede un lessico limitato, commette errori grammaticali, ha difficoltà nell'esprimere i concetti 3 – 5

Usa un linguaggio molto limitato, ha difficoltà a esprimersi e commette numerosi errori grammaticali. 0 – 2

P = PUNTEGGIO TOTALE

(Contenuti + Linguaggio)

VOTO in decimi =

1 + (P/ 30) * 9

Assessment grid

Warm-up activities

• Begin the lesson with a discussion on integers. Ask:

o Does anyone remember what an integer is?

o What pattern can you see in our integers and counting numbers?

(the pattern is the repeating ten digits in each position)

o What pattern can you see in our way of reading time on a clock?

(the pattern is the repeating time every 12 hours )

• Tell students that regular integers can be said to be mod 10 because of

the repeating pattern of ten numbers and today you will be discussing

different patterns of numbers

• Ask everyone to get out paper for note taking

• Write the word NOTES on the board. Instruct students to do the same

on their own paper. Explain that you will be helping them take notes

through the lesson as a study guide.

What is meant by

Mod, Modulus and Modular Arithmetic?

• Modulus (abbreviated as mod) is the Latin word for “remainder” It is what

is left after parts of the whole are taken.

• Thus, modular arithmetic (or mod arithmetic) is really remainder

arithmetic.

• We are looking for the integer that occurs as a remainder (or the left-

over) when one integer is divided by another integer.

• Computations involving the modulus to determine remainders are called

Modular Arithmetic. It was first studied by the German Mathematician

Karl Friedrich Gauss (1777-1855) in 1801.

Let's start with some definitions

When we divide two integers we will have an equation that looks

like the following: 𝑨

𝑩= 𝑸 𝒓𝒆𝒎𝒂𝒊𝒏𝒅𝒆𝒓 𝑹

• A is the dividend

• B is the divisor

• Q is the quotient

• R is the remainder

Sometimes, we are only interested in what the remainder is when

we divide A by B.

For these cases there is an operator called the modulo operator

(abbreviated as mod).

Using the same A, B, Q, and R as above, we would have:

A mod B = R

IMPORTANT

The remainder R is always an integer number between 0 and B-1

Let’s revise the terms

𝑨

𝑩= 𝑸 ______________ 𝑹

• A is the __________

• B is the __________

• Q is the __________

• R is the __________

• R is an integer number ALWAYS between ______ and _______

For a hint on possible terms, click here

quotient, divisor, remainder, dividend

Example 1

When 7 is divided by 3 it leaves a remainder of 1.

𝟕

𝟑= 𝟐 𝑟𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟 𝟏

remainder

Think of 1€ as a left over after 7€ are equally split among 3 people.

There is a mathematical notation for mod arithmetic. Instead of writing 7 = 3*2 + 1 where 1 is the

integer remainder we will write:

7 mod 3 = 1, which reads as: "7 modulo 3 is 1"

and 3 is called the modulus.

This notation does not reveal the €2 that every person gets as his share.

However, we are solely interested in the left over part, the remainder of €1 in our example.

Click here

Example 2

When 8 is divided by 3 it leaves a remainder of 2.

𝟖

𝟑= 𝟐 𝑟𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟 𝟐

remainder

8 mod 3 = 2

Click here

Example 3

When 9 is divided by 3 it leaves a remainder of 0.

𝟗

𝟑= 𝟑 𝑟𝑒𝑚𝑎𝑖𝑛𝑑𝑒𝑟 𝟎

No remainder

9 mod 3 = 0

Click here

Activities (to do in pairs)

Read (in english, please!) and calculate the following expressions

a) 17 mod 3 = ?

b) 27 mod 12 = ?

c) 20 mod 5 = ?

d) 8 mod 8 = ?

e) 127 mod 215 = ?

f) 0 mod 7 = ?

Solutions? Click here → a) 2; b) 3; c) 0; d) 0; e) 127; f) 0

• Modular arithmetic (or Mod-Arithmetic) shows up quite often

in the world around us even though we may not realize it.

• Modular arithmetic is best known for its use in telling time.

• Furthermore, Modular arithmetic is the central mathematical

concept in Cryptography: almost any cipher from the ancient

Caesar Cipher to the modern RSA Cipher use it.

• We will learn how to perform some arithmetic operations:

Mod Addition

Mod Subtraction

Mod Multiplication

Why is Modular arithmetic so important?

• It is something we use on a daily basis. In a regular clock we tell time

according to two equally spaced intervals composed of 12 hours, or

integers.

• In modular arithmetic, whole numbers, or integers, repeat around a

designated number known as the modulus.

• To obtain a perfect modular clock based on modulus 12 we should only

replace the 12 at the top of the circle with a 0

Modular arithmetic is also called Clock Arithmetic

0

Replace 12

with 0

Click here

To find the result of A mod B we can follow these steps:

1. Construct the modular clock for size B

2. Start at 0 and move around the clock A steps

3. Wherever we land is our solution

0

2

1 4

3

Example: calculate 7 mod 5

Count steps

0

1

2

3

4

5

6

7

1. Construct the clock modulus 5

7 mod 5 = 2

Start

2. Start at 0 and move around the clock 7 steps

Click on start to proceed

Activities (to do in pairs)

• Draw a modular clock for each expression and find the result.

• Describe all the steps (in English, please!).

8 mod 4 = ? With a modulus of 4 we make a clock with numbers 0, 1, 2, 3.

We start at 0 and go through 8 numbers in a clockwise sequence: 1, 2, 3, 0, 1, 2, 3, 0.

7 mod 2 = ? With a modulus of 2 we make a clock with numbers 0, 1.

We start at 0 and go through 8 numbers in a clockwise sequence :1, 0, 1, 0, 1, 0, 1.

-5 mod 3 = ?

With a modulus of 3 we make a clock with numbers 0, 1, 2.

We start at 0 and go through 5 numbers in a counter-clockwise sequence (5 is

negative): 2, 1, 0, 2, 1

Activity: discussion

(to do in small groups) 10 minutes

1. What is 'clock arithmetic'?

2. Can you think of any other common

examples of modular counting?

Consider the number 5 in modulus 12. If you add 12

you always obtain 5.

• 5 + 12 = 17

• 17 + 12 = 29

• 29 + 12 = 41

Congruent numbers

We can express these equivalencies by saying the numbers are congruent in

modulus 12, and write them using a 3-bar equal sign as shown here:

5 mod 12 ≡ 17 mod 12 ≡ 29 mod 12 ≡ 41 mod 12 ≡ etc.

When dealing with modular arithmetic, there are many numbers that are equivalent

for a given modulus.

Here, 5 is equivalent to 17, 29, 41, and so on.

Addition in Modular Arithmetic

Let a, b, c, d, e be integers, and let n be a positive integer.

1. If a + b = c then (a + b) mod n ≡ c mod n

2. If a mod n ≡ d mod n and b mod n ≡ e mod n

then (a + b) mod n ≡ d mod n + e mod n

You can perform many of the same operations with modular math that you can with regular math.

Here are some rules for addition in modular arithmetic.

Based on these rules, we can either :

a. add the numbers together, and then find the sum in modulus n

b. find each of the numbers in modulus n, and then add them together.

Example: what is (4 + 7 + 6 + 8) mod 8?

Add the numbers in the parentheses: 4 + 7 + 6 + 8 = 25. To find 25 mod 8,

perform the division: 25 / 8 = 3 with a remainder of 1.

Therefore, (4 + 7 + 6 + 8) mod 8 is congruent to 25 mod 8, which is

congruent to 1 mod 8

Activities (to do in pairs)

Perform the following calculation in 2 different ways.

(13 + 25 + 17 + 9) mod 5 = ?

13 + 25 + 17 + 9 = 64

64 mod 5

64 / 5 = 12 with a remainder of 4

4

13 mod 5 = 3, 25 mod 5 = 0, 17 mod 5 = 2, 9 mod 5 = 4

(3 + 0 + 2 + 4) mod 5

9 mod 5

9 / 5 = 1 with a remainder of 4

4 (13 + 25 + 17 + 9) mod 5 = 4

Click

here

Click

here

Activities (to do in pairs)

Perform the following calculations in 2 different ways.

a. (23 + 15 + 7+ 9) mod 12 = ?

b. (24 + 2 + 6 + 13 + 15) mod 7 = ?

c. (12 + 29 + 3 + 33 + 19 ) mod 11 = ?

Subtraction in Modular Arithmetic

Let a, b, c, d, e be integers, and let n be a positive integer.

1. If a - b = c then (a - b) mod n ≡ c mod n

2. If a mod n ≡ d mod n and b mod n ≡ e mod n

then (a - b) mod n ≡ d mod n - e mod n

Again, we have two choices:

a. Subtract the numbers in the parenthesis first.

b. Find each of the numbers in modulus n, and then perform the subtraction.

104 – 53 = 51

51 mod 5 = 1

Example: what is (104 - 53) mod 5 ?

104 mod 5 = 4 , 52 mod 5 = 3

4 – 3 = 1

1 mod 5 = 1

• When dealing with subtraction, you may end up with a negative number.

• For instance, suppose it's 4:00 AM or PM, and we want to know what time it

was 11 hours ago, or (4 - 11) mod12 ≡ -7 mod12.

• To find how the result is congruent to mod 12, we add multiples of 12 until we

get to a number that falls between 0 and 11. In our case: -7 + 12 = 5

• Here, -7 mod 12 is congruent to 5 mod 12, which means that 11 hours ago it

was 5:00AM or PM.

-7 mod 12 ≡ (-7 +12) mod 12 ≡ 5 mod 12

Negative numbers in Modular Arithmetic

• In general, when you get a negative number and you're working in

modulus n, add multiples of n to the negative number until you get a

number between 0 and n - 1.

Activities (to do in pairs)

Perform the following calculations in 2 different ways.

a. (23 – 15 ) mod 12 = ?

b. (9 – 20) mod 7 = ?

c. (12 – 29 + 3 – 33 ) mod 11 = ?

Multiplication in Modular Arithmetic

Let a, b, c, d, e be integers, and let n be a positive integer.

1. If a x b = c then (a x b) mod n ≡ c mod n

2. If a mod n ≡ d mod n and b mod n ≡ e mod n

then (a x b) mod n ≡ (d mod n) x (e mod n)

Again, we have two choices:

a. We can perform the multiplication and the find the number in modulus n.

b. Or, we can find each number in modulus n, and then multiply them.

a)

14 x 20 = 280

280 / 18 = 15 remainder 10

280 mod 18 = 10

Example: what is (14 x 20) mod 18 ?

b)

14 mod 18 = 14 , 20 mod 18 = 2

14 x 2 = 28

28 mod 18 = 10

Activities (to do in pairs)

Perform the following calculation in 2 different ways.

(17 x 32) mod 13 = ?

17 x 32 = 544

544 mod 13

544 / 13 = 41 with a remainder of 11

11

17 mod 13 = 4, 32 mod 13 = 6

(4 x 6) mod 13

24 mod 13

24 / 13 = 1 with a remainder of 11

11 (17 x 32) mod 13 = 11

Click

here

Click

here

Activities (to do in pairs)

Perform the following calculations in 2 different ways.

a. (23 x 15 ) mod 12 = ?

b. (9 x 20) mod 7 = ?

c. (12 x 29 ) mod 11 = ?

d. (19 x 33 ) mod 17 = ?

Activity: problem solving

• Suppose you're helping to plan a friend's wedding.

• You have 14 boxes of wedding favor chocolates with 23

chocolates in each box.

• Your friend wants to pass out little boxes of 4 chocolates each to

their guests, and they said you can have the leftover chocolates

as a thank you for helping.

• Once you have made as many little boxes of 4 chocolates as

possible from the chocolates you have, how many chocolates

are left over for you to have for yourself?

This is actually a modular arithmetic problem.

Notice that the problem is asking for the remainder when 14 x 23 is divided by 4.

That is, we're looking for (14 x 23) mod 4.

Hint (click here)

to do in pairs or small groups (10 minutes)

Revision, summary, final task (30 minutes)

• Modular arithmetic is also called clock arithmetic because the rules are

similar to the traditional way we tell time. In modular arithmetic, we

have a modulus, which is the integer, or whole number, at which we

start over.

• When adding, subtracting, or multiplying in modulus n, we can do one

of two things:

o We can perform the operation first, and then find that number in

modulus n by dividing it by n and identifying the remainder.

o We can also find each number in modulus n individually, and then

perform the operation on those numbers.

• Either way, we'll get the same answer.

• Don't forget this other important rule: when the result is a negative

number, add multiples of the modulus until you end up with a number

between 0 and the modulus minus 1. That will be your answer.

That’s the end. Thanks for your attention!