Copyright © 2014 - Curt Hill Divisibility and Modular Arithmetic A Topic in Number Theory.

Slides:



Advertisements
Similar presentations
1 Lect. 12: Number Theory. Contents Prime and Relative Prime Numbers Modular Arithmetic Fermat’s and Euler’s Theorem Extended Euclid’s Algorithm.
Advertisements

1 In this lecture  Number Theory ● Rational numbers ● Divisibility  Proofs ● Direct proofs (cont.) ● Common mistakes in proofs ● Disproof by counterexample.
Cryptography and Network Security
Chapter 3 Elementary Number Theory and Methods of Proof.
Chapter 4 – Finite Fields. Introduction will now introduce finite fields of increasing importance in cryptography –AES, Elliptic Curve, IDEA, Public Key.
The Integers and Division. Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest.
1 Section 2.4 The Integers and Division. 2 Number Theory Branch of mathematics that includes (among other things): –divisibility –greatest common divisor.
CSE115/ENGR160 Discrete Mathematics 03/13/12 Ming-Hsuan Yang UC Merced 1.
Number Theory and Cryptography
Multiplying and Dividing Real Numbers; Properties of Real Numbers
Congruence class arithmetic. Definitions: a ≡ b mod m iff a mod m = b mod m. a  [b] iff a ≡ b mod m.
CSE115/ENGR160 Discrete Mathematics 03/15/11
CMSC 250 Discrete Structures Number Theory. 20 June 2007Number Theory2 Exactly one car in the plant has color H( a ) := “ a has color”  x  Cars –H(
Proof Must Have Statement of what is to be proven.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
BY MISS FARAH ADIBAH ADNAN IMK
7.1 - Introduction To Signed Numbers
The Integers and Division
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 2): The Fundamentals: Algorithms, the.
9/2/2015Discrete Structures1 Let us get into… Number Theory.
Chapter 2 Working with Real Numbers. 2-1 Basic Assumptions.
Mathematics of Cryptography Part I: Modular Arithmetic
February 24, 2015Applied Discrete Mathematics Week 4: Number Theory 1 Modular Arithmetic Let a be an integer and m be a positive integer. We denote by.
CPSC 3730 Cryptography and Network Security
Prep Math Competition, Lec. 1Peter Burkhardt1 Number Theory Lecture 1 Divisibility and Modular Arithmetic (Congruences)
CompSci 102 Discrete Math for Computer Science February 16, 2012 Prof. Rodger.
Chapter The Integers and Division Division
Chapter 4 – Finite Fields
Computational Number Theory - traditional number theory Prime Numbers Factors Counting Factors D- functions.
Chapter 4 More on Directed Proof and Proof by Contrapositive 4.1 Proofs Involving Divisibility of Integers 4.2 Proofs Involving Congruence of Integers.
1 Methods of Proof Proof techniques in this handout –Direct proof –Division into cases –Proof by contradiction In this handout, the proof techniques will.
Number Theory 이재원 School of Information Technology Sungshin W. University.
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
Elements of Coding and Encryption 1. Encryption In the modern word, it is crucial that the information is transmitted safely. For example, Internet purchases,
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
(2 + 1) + 4 = 2 + (1 + 4) Associative Property of Addition.
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
1 CMSC 250 Chapter 3, Number Theory. 2 CMSC 250 Introductory number theory l A good proof should have: –a statement of what is to be proven –"Proof:"
Discrete Mathematics
Math 51/COEN 19. Number theory vocab Let a, b Z, a ≠ 0. We say that a divides b and write a|b if m Z such that b = ma (ie b is a multiple of a)
Divisibility and Modular Arithmetic
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
Ch04-Number Theory and Cryptography 1. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic.
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
Number Theory. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic principles of divisibility,
Number-Theoretic Algorithms
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
CSE15 Discrete Mathematics 03/15/17
Properties of Operations
Introduction to Cryptography
Integers and Division Section 3.4.
CMSC Discrete Structures
Number Theory and Cryptography
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Applied Discrete Mathematics Week 4: Number Theory
Copyright © Cengage Learning. All rights reserved.
CMSC 203, Section 0401 Discrete Structures Fall 2004 Matt Gaston
Copyright © Zeph Grunschlag,
Divisibility and Modular Arithmetic
Applied Discrete Mathematics Week 10: Introduction to Counting
Number Theory.
Discrete Mathematics Chapter 4 Number Theory. Discrete Mathematics Chapter 4 Number Theory.
Presentation transcript:

Copyright © Curt Hill Divisibility and Modular Arithmetic A Topic in Number Theory

Copyright © Curt Hill Number Theory Study of integers and their properties –Originally known as arithmetic Operations and algorithms Prime numbers and factorization Among other things

Divisibility When we divide an integer by a non- zero integer we get two integers: –Quotient –Remainder 15  3 produces quotient 5 and remainder 0 15  2 produces quotient 7 and remainder 1 –We could also consider the result 7.5 –However, this is not an integer Copyright © Curt Hill

Definitions Copyright © Curt Hill

Theorems A,B,C are integers and A is not zero If A|B and A|C then A|(B+C) If A|B then A|BC If A|B and B|C then A|C Copyright © Curt Hill

Proof 1 Prove that if A|B and A|C then A|(B+C) A|B means that B=AI for some integer I A|C means that C=AJ for some integer J B+C = AI + AJ B+C = A(I+J) Thus A|(B+C) Copyright © Curt Hill

Division ‘Algorithm’ If A is an integer and D a positive integer There are unique integers Q and R where 0  R<D, such that A =DQ+R D is divisor A is dividend Q is quotient R is remainder This is a restatement of A  D gives quotient Q and remainder R Copyright © Curt Hill

Div and Mod Rosen’s flavor of pseudo-code is definitely Pascal based Pascal used / for real division and div and mod for integer division Thus: –17 div 3 gives the quotient which is 5 –17 mod 3 gives remainder, 2 The two, div and mod, will be used like operators Copyright © Curt Hill

Examples -19 and 4 –-19 div 4 = -4 –-19 mod 4 = -3 –-19 = 4  and 4 –26 div 5 = 5 –26 mod 5 = 1 –26 = 5  Copyright © Curt Hill

Clock Arithmetic When we add 8 hours to 6 o’clock we do not get 14:00 –Rather we get 2:00 Clock arithmetic is a bit odd –12 and 0 are the same –No negatives You do arithmetic and then mod it by 12 –If the result is 0, make it 12 We now move towards modular arithmetic Copyright © Curt Hill

Military Time Military time uses a 24 hour clock and it works without the exceptions of clock arithmetic 0 is midnight 12 is noon 16 is 4PM 23:59 is the highest time All arithmetic operations are modded by 24 Copyright © Curt Hill

Modular Arithmetic If we take a time and add 24 hours we have not changed it all Moreover if we take a time and add 4 fours or 28 hours or 52 hours it all ends with the same time of day This is the notion of congruence in modular arithmetic Two numbers are congruent if they are equal after being modded by a particular integer Copyright © Curt Hill

Congruence More Formally Suppose that a and be are integers and m is some positive integer We say that a is congruent to b modulo m if a mod m = b mod m –The notation is a  b (mod m) If a  b (mod m) then m|(a-b) –The negation of congruence uses the symbol  In congruence we refer to m as the modulus (plural is moduli) Copyright © Curt Hill

Two Mods a  b (mod m) expresses a relation a mod m is a function What is the difference? Copyright © Curt Hill

Another Theorem a  b (mod m) iff there is an integer k such that a=b+km Proof: –From a=b+km we get a-b = km –Then (a-b)/m = k which we know to be an integer –We know that if a  b (mod m) then m|(a- b) which simply means that m divides a- b evenly Copyright © Curt Hill

Congruence Class An set of integers congruent with an integer mod m This is the set of integers b where a  b (mod m) The evens are a congruence class mod 2 as are the odds –16  20 (mod 2) and any even could be substituted for either 16 or 20 –17  31 (mod 2) and any odd could be substituted for either 17 or 31 What are four elements of the congruence class of 26 mod 5? Copyright © Curt Hill

Arithmetic and Congruence Classes If a  b (mod m) and c  d (mod m) Then a+c  b+d (mod m) Also ac  bd (mod m) How would such a proof be done? The corollary is (a+b) mod m = ((a mod m)+(b mod m))mod m And ab mod m = ((a mod m)(b mod m))mod m Copyright © Curt Hill

a+c  b+d (mod m) a  b (mod m) then a mod m = b mod m Thus a mod m = b mod m = i for some i Also c mod m = d mod m = j for some j Thus i+j = i+j Can you do the other one? Copyright © Curt Hill

Modulo m Arithmetic Suppose we take the first m integers: {0, 1, 2, … m-1} We may now define arithmetic on this set + m and  m Addition a + m b = (a+b) mod m Multiplication a  m b = (a  b) mod m Copyright © Curt Hill

Example 15 Our set of numbers is {0, 1, …13, 14} = 20 mod 15 = = 12 mod 15 = = 25 mod 15 = 10 6  = 72 mod 15 = 12 6  = 66 mod 15 = 6 6  = 60 mod 15 = 0 Copyright © Curt Hill

Modulo m Arithmetic Has several properties Closure –a + m b and a  m b will be in the set {0..m-1} provided a and b in the set Associativity –(a  m b)  m c = a  m (b  m c) –(a + m b) + m c = a + m (b + m c) Commutativity –a  m b = b  m a –a + m b = b + m a Copyright © Curt Hill

More Properties Identity elements –0 is identity for addition and 1 for multiplication –Sometimes called the unit –a  m 1 = a –a + m 0 = a Additive inverse –If a  0 is a member of the set then m-a is the additive inverse –a + m (m-a) = 0 Distributivity –a  m (b + m c) = a  m b + m a  m c Copyright © Curt Hill

Exercises 4.1 –3, 7, 13, 23, 29, 33 Copyright © Curt Hill