Arithmetic and Algebra
|
|
- Bertha Simon
- 6 years ago
- Views:
Transcription
1 Arithmetic and Algebra Daniel Butnaru 15. Dezember 2006 Daniel Butnaru Arithmetic and Algebra 1/39
2 Outline 1 Introduction 2 Big Number Arithmetic 3 Modular Arithmetic 4 Linear Diophantine Equations 5 Gaussian Elimination Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 2/39
3 Outline 1 Introduction 2 Big Number Arithmetic 3 Modular Arithmetic 4 Linear Diophantine Equations 5 Gaussian Elimination Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 3/39
4 Definitions Arithmetic The mathematics of integers, rational numbers, real numbers, or complex numbers under addition, subtraction, multiplication, and division. Algebra A branch of mathematics in which symbols, usually letters of the alphabet, represent numbers or members of a specified set and are used to represent quantities and to express general relationships that hold for all members of the set. Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 4/39
5 Outline 1 Introduction 2 Big Number Arithmetic 3 Modular Arithmetic 4 Linear Diophantine Equations 5 Gaussian Elimination Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 5/39
6 Working with big numbers in computers Can be done by stringing digits together: Arrays of Digits the initial element of the array represents the least significant digit a counter with the length of the number in digits can aid efficiency Linked Lists of Digits necessary if we are really going to do arbitrary precision arithmetic Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 6/39
7 Example #define MAXDIGITS 100 #define PLUS 1 #define MINUS -1 typedef struct { char digits[maxdigits]; int signbit; int lastdigit; } bignum; Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 7/39
8 Example add_bignum(bignum *a, bignum *b, bignum *c) { int cr; int i; initialize_bignum(c); c->lastdigit = max(a->lastdigit,b->lastdigit)+1; cr = 0; for (i=0; i<=(c->lastdigit); i++) { c->digits[i] = (char) (cr + a->digits[i] + b->digits[i]) % 10; cr = (cr + a->digits[i] + b->digits[i]) / 10; } Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 8/39
9 Outline 1 Introduction 2 Big Number Arithmetic 3 Modular Arithmetic 4 Linear Diophantine Equations 5 Gaussian Elimination Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 9/39
10 Basics(1) a divides b when the equation b = k a with k Z is satisfied A number k which is divided only by 1 and itself is a prime number. Examples : 2, 3,5,7, For a number a and some other number b there is exactly one q and one r with 0 r < n so that a = q b + r Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 10/39
11 Basics(2) A number k is called a common divisor for a and b if k a and k b. Among all the common divisors the biggest is called the greatest common divisor (GCD). Two numbers are relative prime if their greatest common divisor is 1. Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 11/39
12 Finding the GCD Euclid s Algorithm calculate gcd(a, b) after the division theorem we know a = q b + r 0 based on observing that gcd(a, b) = gcd(b, r 0 ) continue to apply the algorithm on (r k, r k+1 ) stop when the last remainder is 0 the gcd is the last non-zero remainder 1 a = q b + r 0 with 0 r 0 < b 2 b = q r 0 + r 1 with 0 r 1 < r 0 3 r 0 = q r 1 + r 2 with 0 r 2 < r 1 Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 12/39
13 GCD(12, 5) Example 1 12 = with 0 2 < = with 0 1 < = with 0 0 < 1 Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 13/39
14 Euclid s Algorithm Recursive gcd(a, b) if b = 0 return a else return gcd(b, a mod b) Iterative gcd(a, b) while b!= 0 c := b b := a mod b a := c return a Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 14/39
15 Side Effects Bezout s Lemma Find k and l so that gcd(a, b) = a k + b l r 0 = a q 0 b r 1 = b q 1 r 0 r 2 = r 0 q 2 r 1 r 1 = b q 1 (a q 0 b) = k 1 a + l 1 b r 2 = (a q 0 b) q 2 (k 1 a + l 1 b) = k 2 a + l 2 b r 3 = (k 1 a + l 1 b) q 2 (k 2 a + l 2 b) = k 3 a + l 3 b Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 15/39
16 Bezut s Lemma Example 1 9 = = = = therefore, gcd(9, 6) = Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 16/39
17 Chinese Remainder Theorem We have a number n. Repeatedly divided by 3, the remainder is 2; by 5 the remainder is 3; and by 7 the remainder is 2. What number is n? Sun Tsu Suan-Ching (4th century AD) Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 17/39
18 Chinese Remainder Theorem Formal Given a set of congruences: x a i m i for i = 1,....r and for which the m i are pairwise relatively prime, the solution of the set of congruences is: x = a 1 b 1 M m a r b r M m r Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 18/39
19 Chinese Remainder Theorem Formal Where, M = m 1 m 2 m r and the b i s can be obtained from solving the linear congruence equations: b i M m i 1 m i Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 19/39
20 Problem An old woman goes to market and a horse steps on her basket and crashes the eggs. The rider offers to pay for the damages and asks her how many eggs she had brought to sell. She does not remember the exact number, but when she had taken them out two at a time or 3 at a time, there was one egg left but when she took seven at a time they came out even. What is the smallest number of eggs she could have had? 1 x = 1 mod 2 2 x = 1 mod 3 3 x = 0 mod 7 Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 20/39
21 Solution M = = 42. Using the extended Euclid algorithm we can find solutions for the linear congruence equations: b 1 21 = 1 2 b 2 14 = 1 3 b 3 6 = 1 7 The/Some b i s that satisfy the above conditions are 1, 2 and -1. x = = 49(eggs) Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 21/39
22 Outline 1 Introduction 2 Big Number Arithmetic 3 Modular Arithmetic 4 Linear Diophantine Equations 5 Gaussian Elimination Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 22/39
23 Linear Diophantine Equations Diophantus of Alexandria Hellenistic mathematician of the 3rd century AD, was one of the first mathematicians to introduce symbolism into algebra A Diophantine equation is an indeterminate polynomial equation that only allows the variables to be integers. with a i Z, b Z. a 1 x 1 + a 2 x a n x n = b Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 23/39
24 Solving the Equations Condition A diophantine equation has a solution only when the greatest common divisor of all the a i s a divisor of b is and not all the a i are 0. Solution gcd(a 1, a 2,..., a n ) b with a i Z, b Z and (a 1, a 2,..., a n ) (0, 0,..., 0). Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 24/39
25 n = 2 Example Solve 114 x y = 6 with gcd(a 1, a 2 ) = 3 6 (solvable). 1 Divide the equation by 3. We get: 38 x y = 2 2 Use the extended Euclid algorithm to get the linear representation of 1 as a combination of 38 and 105: = 1 3 The special solution is (47 2, 17 2) = (94, -34) 4 Set of all the solutions: {(94 + t 105, 34 t 38) t Z} Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 25/39
26 Solution for n = 2 Start from a 1 x 1 + a 2 x 2 = b with gcd(a 1, a 2 ) b and (a 1, a 2 ) (0, 0) 1 Divide the equation by gcd(a 1, a 2 ). We get a 1 x 1 + a 2 x 2 = b with gcd(a 1, a 2) = 1 2 Use the extended Euclid algorithm to get the linear representation of 1 as a combination of a 1 and a 2 : c 1 a 1 + c 2 a 2 = 1 3 a special solution for the diophantine equation is now (c 1 b, c 2 b) 4 The set of all the solutions can be obtained starting from our special solution: {(c 1 + t a 2, c 2 t a 1) t Z} Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 26/39
27 Solution for n > 2 Start from a 1 x 1 + a 2 x a n x n = b with a i Z, b Z, (a 1, a 2,..., a n ) (0, 0,..., 0), gcd(a 1, a 2,..., a n ) = 1. 1 Rewrite the equation as follows: a 1 x 1 + a 2 x a n 1 x n 1 = b a n x n 2 Consider x n constant. We have a diophantine equation with n 1 variables now. This has a solution only if: gcd(a 1, a 2,..., a n 1 ) (b a n x n ) 3 This is true only when there are c and c n so that: gcd(a 1, a 2,..., a n 1 ) c + a n c n = b 4 We solve this diophantine equation with two variables and we are down to n 1 variables in the initial equation. Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 27/39
28 n > 2 Example Solve 2 x + 4 y + 3 z = 3 with gcd(2, 3, 4) = 1 3 (solvable) 1 Rewrite the equation as follows: 2 x + 4 y = 3 3 z 2 This new diophantine equation with two variables is solvable only if gcd(2, 4) (3 3 z). By solving it we get the solution set: {( 3 + t 3, 3 t 2) t Z} 3 This gives us z = 3 t 2. After inserting this in the initial equation we are down to solving: 2 x + 4 y = 3 3 (3 2 t) x + 2 y = t Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 28/39
29 n > 2 Example Solve x + 2 y = t with gcd(1, 2) = 1 ( t) (solvable) 1 The extended Euclid algorithm gives us ( 1) = 1 and so: (3 3 t) 1 + ( 3 + 3t) 2 = t 2 The solution set to this equation is: {((3 3 t) + s 2, ( 3 + 3t) s 1) s Z} 3 The final solution set: {((3 3 t) + s 2, ( 3 + 3t) s 1, 3 t 2) s, t Z} Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 29/39
30 Outline 1 Introduction 2 Big Number Arithmetic 3 Modular Arithmetic 4 Linear Diophantine Equations 5 Gaussian Elimination Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 30/39
31 Process Description Calculates solutions for linear equation systems Uses a matrix representation of the system Four elementary operations on the matrix a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 12 x a 2n x n = b 2... a n1 x 1 + a n2 x a nn x n = b n Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 31/39
32 Process Matrix Representation a 11 a a 1n x 1 b 1 a 11 a a 1n x = b 2... a 11 a a 1n x n b n Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 32/39
33 Process Description Four elementary operations are applied on such equation systems without changing the solution: 1 switch equations rows in the matrix representation (also the solution vector) 2 rename variables equivalent to switching columns in the matrix 3 multiply a row with a constant ( 0) multiply a row in the matrix and solution vector with the same constant 4 add an equation to another equation add a row to another row in the matrix and solution vector. Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 33/39
34 Forward and Backward Elimination Aim Use the four operations on the matrix to bring it into the upper triangular form. r 11 r 12 r r 1n x 1 c 1 0 r 21 r r 2n x 2 c r r 3n r nn x 3... x n = As we use only equivalent transformations Rx = c will have the same solution as Ax = b : x i = 1 r ii (c i n k=i+1 r ik x k )(i = n 1, n 2,..., 1; x n = cn r nn ) c 3... c n Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 34/39
35 Process From A to R The first transformation, from A to A 1 : a 11 a a 1n a11 1 a a1n 1 a 21 a a 2n A = a 31 a a 3n... A 0 a a 1 2n 1 = 0 a a 1 3n... a n1 a n2... a nn 0 an ann 1 1 find a pivot a r1 0 2 switch the 1 st and the r th rows 3 subtract from the rows i = 2,..., n the first row multiplied with a value l ij. a (1) ik = a ik l i1 a 1k, where l i1 = a i1 a 11, b (1) i = b i l i1 Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 35/39
36 Gaussian Elimination Example x 1 = 1/5 2 x 2 = 4 3 x 3 = 4/5 Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 36/39
37 Summary Working with really big numbers use array/list representation and operations on these structures Chinese Remainder Theorem gives us solutions to equations of type: x x i mod n i Diophantine Equations integer solutions to equations of type: a 1 x 1 + a 2 x a n x n = b Gaussian Elimination solves linear equations systems Daniel Butnaru daniel.butnaru@uni-konstanz.de Arithmetic and Algebra 37/39
38 Resources Steven S. Skiena and Miguel A. Revilla Programming challenges: the programming contest training manual Uwe Schöning Algorithmik Math World Daniel Butnaru Arithmetic and Algebra 38/39
39 Questions? Daniel Butnaru Arithmetic and Algebra 39/39
Mathematics of Cryptography
Modulo arithmetic Fermat's Little Theorem If p is prime and 0 < a < p, then a p 1 = 1 mod p Ex: 3 (5 1) = 81 = 1 mod 5 36 (29 1) = 37711171281396032013366321198900157303750656 = 1 mod 29 (see http://gauss.ececs.uc.edu/courses/c472/java/fermat/fermat.html)
More informationIntermediate Math Circles February 29, 2012 Linear Diophantine Equations I
Intermediate Math Circles February 29, 2012 Linear Diophantine Equations I Diophantine equations are equations intended to be solved in the integers. We re going to focus on Linear Diophantine Equations.
More informationIntermediate Math Circles February 26, 2014 Diophantine Equations I
Intermediate Math Circles February 26, 2014 Diophantine Equations I 1. An introduction to Diophantine equations A Diophantine equation is a polynomial equation that is intended to be solved over the integers.
More informationDiscrete Structures Lecture Solving Congruences. mathematician of the eighteenth century). Also, the equation gggggg(aa, bb) =
First Introduction Our goal is to solve equations having the form aaaa bb (mmmmmm mm). However, first we must discuss the last part of the previous section titled gcds as Linear Combinations THEOREM 6
More informationCOMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635
COMP239: Mathematics for Computer Science II Prof. Chadi Assi assi@ciise.concordia.ca EV7.635 The Euclidean Algorithm The Euclidean Algorithm Finding the GCD of two numbers using prime factorization is
More informationC-N Math 207 Discrete Math
C-N Math 207 - Massey, 1 / 70 C-N Math 207 Discrete Math Kenneth Massey September 16, 2011 Question C-N Math 207 - Massey, 2 / 70 Introduction What is the smallest positive number? Sets C-N Math 207 -
More informationC-N Math 207 Discrete Math
C-N Math 207 Discrete Math Kenneth Massey September 16, 2011 C-N Math 207 - Massey, 1 / 70 Question Introduction What is the smallest positive number? C-N Math 207 - Massey, 2 / 70 Sets Introduction a
More informationMath Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions
Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Solutions Warm-up Problems 1. What is a prime number? Give an example of an even prime number and an odd prime number. A prime number
More informationMath From Scratch Lesson 20: The Chinese Remainder Theorem
Math From Scratch Lesson 20: The Chinese Remainder Theorem W. Blaine Dowler January 2, 2012 Contents 1 Relatively Prime Numbers 1 2 Congruence Classes 1 3 Algebraic Units 2 4 Chinese Remainder Theorem
More informationThe Chinese Remainder Theorem
Sacred Heart University DigitalCommons@SHU Academic Festival Apr 20th, 9:30 AM - 10:45 AM The Chinese Remainder Theorem Nancirose Piazza Follow this and additional works at: http://digitalcommons.sacredheart.edu/acadfest
More informationLecture Notes. Advanced Discrete Structures COT S
Lecture Notes Advanced Discrete Structures COT 4115.001 S15 2015-01-13 Recap Divisibility Prime Number Theorem Euclid s Lemma Fundamental Theorem of Arithmetic Euclidean Algorithm Basic Notions - Section
More informationThe Euclidean Algorithm and Multiplicative Inverses
1 The Euclidean Algorithm and Multiplicative Inverses Lecture notes for Access 2009 The Euclidean Algorithm is a set of instructions for finding the greatest common divisor of any two positive integers.
More informationCPSC 467b: Cryptography and Computer Security
CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 8 February 1, 2012 CPSC 467b, Lecture 8 1/42 Number Theory Needed for RSA Z n : The integers mod n Modular arithmetic GCD Relatively
More informationMath Circle Beginners Group February 28, 2016 Euclid and Prime Numbers
Math Circle Beginners Group February 28, 2016 Euclid and Prime Numbers Warm-up Problems 1. What is a prime number? Give an example of an even prime number and an odd prime number. (a) Circle the prime
More informationMath 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6
Math 131 notes Jason Riedy 6 October, 2008 Contents 1 Modular arithmetic 2 2 Divisibility rules 3 3 Greatest common divisor 4 4 Least common multiple 4 5 Euclidean GCD algorithm 5 6 Linear Diophantine
More informationNumber Theory Proof Portfolio
Number Theory Proof Portfolio Jordan Rock May 12, 2015 This portfolio is a collection of Number Theory proofs and problems done by Jordan Rock in the Spring of 2014. The problems are organized first by
More informationMTH 346: The Chinese Remainder Theorem
MTH 346: The Chinese Remainder Theorem March 3, 2014 1 Introduction In this lab we are studying the Chinese Remainder Theorem. We are going to study how to solve two congruences, find what conditions are
More informationBasic elements of number theory
Cryptography Basic elements of number theory Marius Zimand 1 Divisibility, prime numbers By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a
More informationBasic elements of number theory
Cryptography Basic elements of number theory Marius Zimand By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a k for some integer k. Notation
More information8 Primes and Modular Arithmetic
8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.
More informationElementary Algebra Chinese Remainder Theorem Euclidean Algorithm
Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm April 11, 2010 1 Algebra We start by discussing algebraic structures and their properties. This is presented in more depth than what we
More informationAlgebra. Modular arithmetic can be handled mathematically by introducing a congruence relation on the integers described in the above example.
Coding Theory Massoud Malek Algebra Congruence Relation The definition of a congruence depends on the type of algebraic structure under consideration Particular definitions of congruence can be made for
More informationCHAPTER 3. Congruences. Congruence: definitions and properties
CHAPTER 3 Congruences Part V of PJE Congruence: definitions and properties Definition. (PJE definition 19.1.1) Let m > 0 be an integer. Integers a and b are congruent modulo m if m divides a b. We write
More information2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?
Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative
More informationDiscrete Mathematics and Probability Theory Fall 2014 Anant Sahai Homework 5. This homework is due October 6, 2014, at 12:00 noon.
EECS 70 Discrete Mathematics and Probability Theory Fall 2014 Anant Sahai Homework 5 This homework is due October 6, 2014, at 12:00 noon. 1. Modular Arithmetic Lab (continue) Oystein Ore described a puzzle
More informationMath Circles - Lesson 2 Linear Diophantine Equations cont.
Math Circles - Lesson 2 Linear Diophantine Equations cont. Zack Cramer - zcramer@uwaterloo.ca March 7, 2018 Last week we discussed linear Diophantine equations (LDEs), which are equations of the form ax
More informationChapter 4 Finite Fields
Chapter 4 Finite Fields Introduction will now introduce finite fields of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public Key concern operations on numbers what constitutes a number
More information11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic
11 Division Mod n, Linear Integer Equations, Random Numbers, The Fundamental Theorem of Arithmetic Bezout s Lemma Let's look at the values of 4x + 6y when x and y are integers. If x is -6 and y is 4 we
More informationArithmetic Algorithms, Part 1
Arithmetic Algorithms, Part 1 DPV Chapter 1 Jim Royer EECS January 18, 2019 Royer Arithmetic Algorithms, Part 1 1/ 15 Multiplication à la Français function multiply(a, b) // input: two n-bit integers a
More informationDirect Proof MAT231. Fall Transition to Higher Mathematics. MAT231 (Transition to Higher Math) Direct Proof Fall / 24
Direct Proof MAT231 Transition to Higher Mathematics Fall 2014 MAT231 (Transition to Higher Math) Direct Proof Fall 2014 1 / 24 Outline 1 Overview of Proof 2 Theorems 3 Definitions 4 Direct Proof 5 Using
More informationMATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions
MATH 11/CSCI 11, Discrete Structures I Winter 007 Toby Kenney Homework Sheet 5 Hints & Model Solutions Sheet 4 5 Define the repeat of a positive integer as the number obtained by writing it twice in a
More information2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?
Chapter 3: Theory of Modular Arithmetic 25 SECTION C Solving Linear Congruences By the end of this section you will be able to solve congruence equations determine the number of solutions find the multiplicative
More information4 Powers of an Element; Cyclic Groups
4 Powers of an Element; Cyclic Groups Notation When considering an abstract group (G, ), we will often simplify notation as follows x y will be expressed as xy (x y) z will be expressed as xyz x (y z)
More information4 Number Theory and Cryptography
4 Number Theory and Cryptography 4.1 Divisibility and Modular Arithmetic This section introduces the basics of number theory number theory is the part of mathematics involving integers and their properties.
More informationLecture 7: Number Theory Steven Skiena. skiena
Lecture 7: Number Theory Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Number Theory and Divisibility G-d created
More information3 The fundamentals: Algorithms, the integers, and matrices
3 The fundamentals: Algorithms, the integers, and matrices 3.4 The integers and division This section introduces the basics of number theory number theory is the part of mathematics involving integers
More informationChapter 2. Divisibility. 2.1 Common Divisors
Chapter 2 Divisibility 2.1 Common Divisors Definition 2.1.1. Let a and b be integers. A common divisor of a and b is any integer that divides both a and b. Suppose that a and b are not both zero. By Proposition
More informationNumber Theory Notes Spring 2011
PRELIMINARIES The counting numbers or natural numbers are 1, 2, 3, 4, 5, 6.... The whole numbers are the counting numbers with zero 0, 1, 2, 3, 4, 5, 6.... The integers are the counting numbers and zero
More informationa the relation arb is defined if and only if = 2 k, k
DISCRETE MATHEMATICS Past Paper Questions in Number Theory 1. Prove that 3k + 2 and 5k + 3, k are relatively prime. (Total 6 marks) 2. (a) Given that the integers m and n are such that 3 (m 2 + n 2 ),
More informationApplied Cryptography and Computer Security CSE 664 Spring 2017
Applied Cryptography and Computer Security Lecture 11: Introduction to Number Theory Department of Computer Science and Engineering University at Buffalo 1 Lecture Outline What we ve covered so far: symmetric
More informationLecture 2. The Euclidean Algorithm and Numbers in Other Bases
Lecture 2. The Euclidean Algorithm and Numbers in Other Bases At the end of Lecture 1, we gave formulas for the greatest common divisor GCD (a, b), and the least common multiple LCM (a, b) of two integers
More informationPrimes and Modular Arithmetic! CSCI 2824, Fall 2014!!
Primes and Modular Arithmetic! CSCI 2824, Fall 2014!!! Scheme version of the algorithm! for finding the GCD (define (gcd a b)! (if!(= b 0)!!!!a!!!!(gcd b (remainder a b))))!! gcd (812, 17) = gcd(17, 13)
More informationMATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.
MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences. Congruences Let n be a postive integer. The integers a and b are called congruent modulo n if they have the same
More informationDiscrete Mathematics GCD, LCM, RSA Algorithm
Discrete Mathematics GCD, LCM, RSA Algorithm Abdul Hameed http://informationtechnology.pk/pucit abdul.hameed@pucit.edu.pk Lecture 16 Greatest Common Divisor 2 Greatest common divisor The greatest common
More informationRemainders. We learned how to multiply and divide in elementary
Remainders We learned how to multiply and divide in elementary school. As adults we perform division mostly by pressing the key on a calculator. This key supplies the quotient. In numerical analysis and
More informationDeepening Mathematics Instruction for Secondary Teachers: Algebraic Structures
Deepening Mathematics Instruction for Secondary Teachers: Algebraic Structures Lance Burger Fresno State Preliminary Edition Contents Preface ix 1 Z The Integers 1 1.1 What are the Integers?......................
More informationElementary Number Theory Review. Franz Luef
Elementary Number Theory Review Principle of Induction Principle of Induction Suppose we have a sequence of mathematical statements P(1), P(2),... such that (a) P(1) is true. (b) If P(k) is true, then
More informationModular Arithmetic Instructor: Marizza Bailey Name:
Modular Arithmetic Instructor: Marizza Bailey Name: 1. Introduction to Modular Arithmetic If someone asks you what day it is 145 days from now, what would you answer? Would you count 145 days, or find
More informationNumber Theory and Group Theoryfor Public-Key Cryptography
Number Theory and Group Theory for Public-Key Cryptography TDA352, DIT250 Wissam Aoudi Chalmers University of Technology November 21, 2017 Wissam Aoudi Number Theory and Group Theoryfor Public-Key Cryptography
More informationIntegers and Division
Integers and Division Notations Z: set of integers N : set of natural numbers R: set of real numbers Z + : set of positive integers Some elements of number theory are needed in: Data structures, Random
More informationcse 311: foundations of computing Spring 2015 Lecture 12: Primes, GCD, applications
cse 311: foundations of computing Spring 2015 Lecture 12: Primes, GCD, applications casting out 3s Theorem: A positive integer n is divisible by 3 if and only if the sum of its decimal digits is divisible
More informationClock Arithmetic and Euclid s Algorithm
Clock Arithmetic and Euclid s Algorithm Lecture notes for Access 2008 by Erin Chamberlain. Earlier we discussed Caesar Shifts and other substitution ciphers, and we saw how easy it was to break these ciphers
More informationPreliminaries and Complexity Theory
Preliminaries and Complexity Theory Oleksandr Romanko CAS 746 - Advanced Topics in Combinatorial Optimization McMaster University, January 16, 2006 Introduction Book structure: 2 Part I Linear Algebra
More informationAlgorithms (II) Yu Yu. Shanghai Jiaotong University
Algorithms (II) Yu Yu Shanghai Jiaotong University Chapter 1. Algorithms with Numbers Two seemingly similar problems Factoring: Given a number N, express it as a product of its prime factors. Primality:
More informationNotes on Systems of Linear Congruences
MATH 324 Summer 2012 Elementary Number Theory Notes on Systems of Linear Congruences In this note we will discuss systems of linear congruences where the moduli are all different. Definition. Given the
More informationThis is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.
8 Modular Arithmetic We introduce an operator mod. Let d be a positive integer. For c a nonnegative integer, the value c mod d is the remainder when c is divided by d. For example, c mod d = 0 if and only
More information2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.
CHAPTER 2 INTRODUCTION TO NUMBER THEORY ANSWERS TO QUESTIONS 2.1 A nonzero b is a divisor of a if a = mb for some m, where a, b, and m are integers. That is, b is a divisor of a if there is no remainder
More informationINTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.
INTEGERS PETER MAYR (MATH 2001, CU BOULDER) In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes. 1. Divisibility Definition. Let a, b
More informationEUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972)
Intro to Math Reasoning Grinshpan EUCLID S ALGORITHM AND THE FUNDAMENTAL THEOREM OF ARITHMETIC after N. Vasiliev and V. Gutenmacher (Kvant, 1972) We all know that every composite natural number is a product
More informationCS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II
CS 5319 Advanced Discrete Structure Lecture 9: Introduction to Number Theory II Divisibility Outline Greatest Common Divisor Fundamental Theorem of Arithmetic Modular Arithmetic Euler Phi Function RSA
More information2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.
2 Arithmetic This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. (See [Houston, Chapters 27 & 28]) 2.1 Greatest common divisors Definition 2.16. If a, b are integers, we say
More informationRings and modular arithmetic
Chapter 8 Rings and modular arithmetic So far, we have been working with just one operation at a time. But standard number systems, such as Z, have two operations + and which interact. It is useful to
More information5: The Integers (An introduction to Number Theory)
c Oksana Shatalov, Spring 2017 1 5: The Integers (An introduction to Number Theory) The Well Ordering Principle: Every nonempty subset on Z + has a smallest element; that is, if S is a nonempty subset
More informationFinite Fields. Mike Reiter
1 Finite Fields Mike Reiter reiter@cs.unc.edu Based on Chapter 4 of: W. Stallings. Cryptography and Network Security, Principles and Practices. 3 rd Edition, 2003. Groups 2 A group G, is a set G of elements
More informationAlgorithms CMSC Basic algorithms in Number Theory: Euclid s algorithm and multiplicative inverse
Algorithms CMSC-27200 Basic algorithms in Number Theory: Euclid s algorithm and multiplicative inverse Instructor: László Babai Last updated 02-14-2015. Z denotes the set of integers. All variables in
More informationMath 312/ AMS 351 (Fall 17) Sample Questions for Final
Math 312/ AMS 351 (Fall 17) Sample Questions for Final 1. Solve the system of equations 2x 1 mod 3 x 2 mod 7 x 7 mod 8 First note that the inverse of 2 is 2 mod 3. Thus, the first equation becomes (multiply
More informationMATH 145 Algebra, Solutions to Assignment 4
MATH 145 Algebra, Solutions to Assignment 4 1: a) Find the inverse of 178 in Z 365. Solution: We find s and t so that 178s + 365t = 1, and then 178 1 = s. The Euclidean Algorithm gives 365 = 178 + 9 178
More informationQ 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today?
2 Mod math Modular arithmetic is the math you do when you talk about time on a clock. For example, if it s 9 o clock right now, then it ll be 1 o clock in 4 hours. Clearly, 9 + 4 1 in general. But on a
More informationPractical assessment week 5 and 6
Practical assessment week 5 and 6 Finding prime numbers 1.1 Modular Arithmetic Basically, a b (mod n) if a = b + kn for some integer k. If a is non-negative and b is between 0 and n, you can think of b
More informationCSE 311: Foundations of Computing. Lecture 12: Two s Complement, Primes, GCD
CSE 311: Foundations of Computing Lecture 12: Two s Complement, Primes, GCD n-bit Unsigned Integer Representation Represent integer as sum of powers of 2: If 2 where each {0,1} then representation is b
More information1 Overview and revision
MTH6128 Number Theory Notes 1 Spring 2018 1 Overview and revision In this section we will meet some of the concerns of Number Theory, and have a brief revision of some of the relevant material from Introduction
More informationCMPUT 403: Number Theory
CMPUT 403: Number Theory Zachary Friggstad February 26, 2016 Outline Factoring Sieve Multiplicative Functions Greatest Common Divisors Applications Chinese Remainder Theorem Factoring Theorem (Fundamental
More informationcse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications
cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications n-bit unsigned integer representation Represent integer x as sum of powers of 2: If x = n 1 i=0 b i 2 i where each b i
More informationNumber Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some. Notation: b Fact: for all, b, c Z:
Number Theory Basics Z = {..., 2, 1, 0, 1, 2,...} For, b Z, we say that divides b if z = b for some z Z Notation: b Fact: for all, b, c Z:, 1, and 0 0 = 0 b and b c = c b and c = (b + c) b and b = ±b 1
More information8. Given a rational number r, prove that there exist coprime integers p and q, with q 0, so that r = p q. . For all n N, f n = an b n 2
MATH 135: Randomized Exam Practice Problems These are the warm-up exercises and recommended problems taken from all the extra practice sets presented in random order. The challenge problems have not been
More informationA STUDY ON THE CONCEPT OF DIOPHANTINE EQUATIONS
Airo International Research Journal March, 2014 Volume III, ISSN: 2320-3714 A STUDY ON THE CONCEPT OF DIOPHANTINE EQUATIONS Alham Research Scholar, Himalayan University, Itanagar, Arunachal Pradesh ABSTRACT
More informationSlides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006
Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Spring 2006 1 / 1 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 2.4 2.6 of Rosen Introduction I When talking
More informationExercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.
Exercises Exercises 1. Determine whether each of these integers is prime. a) 21 b) 29 c) 71 d) 97 e) 111 f) 143 2. Determine whether each of these integers is prime. a) 19 b) 27 c) 93 d) 101 e) 107 f)
More informationKnow the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.
The first exam will be on Monday, June 8, 202. The syllabus will be sections. and.2 in Lax, and the number theory handout found on the class web site, plus the handout on the method of successive squaring
More informationAiro International Research Journal September, 2016 Volume VII, ISSN:
1 DIOPHANTINE EQUATIONS AND THEIR SIGNIFICANCE Neelam Rani Asstt. Professor in Department of Mathematics Shri Krishna Institute of Engg, & Technology, Kurukshetra (Haryana) ABSTRACT A Diophantine equation
More information4.4 Solving Congruences using Inverses
4.4 Solving Congruences using Inverses Solving linear congruences is analogous to solving linear equations in calculus. Our first goal is to solve the linear congruence ax b pmod mq for x. Unfortunately
More information1. Given the public RSA encryption key (e, n) = (5, 35), find the corresponding decryption key (d, n).
MATH 135: Randomized Exam Practice Problems These are the warm-up exercises and recommended problems taken from all the extra practice sets presented in random order. The challenge problems have not been
More informationProofs. Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm. Reading (Epp s textbook)
Proofs Methods of Proof Divisibility Floor and Ceiling Contradiction & Contrapositive Euclidean Algorithm Reading (Epp s textbook) 4.3 4.8 1 Divisibility The notation d n is read d divides n. Symbolically,
More informationLecture 7 Number Theory Euiseong Seo
Lecture 7 Number Theory Euiseong Seo (euiseong@skku.edu) 1 Number Theory God created the integers. All else is the work of man Leopold Kronecker Study of the property of the integers Specifically, integer
More informationLecture 4: Number theory
Lecture 4: Number theory Rajat Mittal IIT Kanpur In the next few classes we will talk about the basics of number theory. Number theory studies the properties of natural numbers and is considered one of
More informationCPSC 467: Cryptography and Computer Security
CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 9 September 30, 2015 CPSC 467, Lecture 9 1/47 Fast Exponentiation Algorithms Number Theory Needed for RSA Elementary Number Theory
More informationChapter 1. Greatest common divisor. 1.1 The division theorem. In the beginning, there are the natural numbers 0, 1, 2, 3, 4,...,
Chapter 1 Greatest common divisor 1.1 The division theorem In the beginning, there are the natural numbers 0, 1, 2, 3, 4,..., which constitute the set N. Addition and multiplication are binary operations
More informationElementary Number Theory II
Elementary Number Theory II CIS002-2 Computational Alegrba and Number Theory David Goodwin david.goodwin@perisic.com 09:00, Tuesday 1 st November 2011 Contents 1 Divisibility Euclid s Algorithm & Bezout
More informationNumbers. Çetin Kaya Koç Winter / 18
Çetin Kaya Koç http://koclab.cs.ucsb.edu Winter 2016 1 / 18 Number Systems and Sets We represent the set of integers as Z = {..., 3, 2, 1,0,1,2,3,...} We denote the set of positive integers modulo n as
More informationSimultaneous Linear, and Non-linear Congruences
Simultaneous Linear, and Non-linear Congruences CIS002-2 Computational Alegrba and Number Theory David Goodwin david.goodwin@perisic.com 09:00, Friday 18 th November 2011 Outline 1 Polynomials 2 Linear
More informationALGEBRA+NUMBER THEORY +COMBINATORICS
ALGEBRA+NUMBER THEORY +COMBINATORICS COMP 321 McGill University These slides are mainly compiled from the following resources. - Professor Jaehyun Park slides CS 97SI - Top-coder tutorials. - Programming
More informationECEN 5022 Cryptography
Elementary Algebra and Number Theory University of Colorado Spring 2008 Divisibility, Primes Definition. N denotes the set {1, 2, 3,...} of natural numbers and Z denotes the set of integers {..., 2, 1,
More informationMy Favorite Problems HAROLD B. REITER. Mu Alpha Theta Annual Convention Denver, Colorado. Visit my website:
My HAROLD B REITER UNIVERSITY OF NORTH CAROLINA CHARLOTTE Mu Alpha Theta Annual Convention Denver, Colorado July 29, 200 Visit my website: http://wwwmathunccedu/~hbreiter Dinner Bill Splitting Problem
More informationDivisibility. Chapter Divisors and Residues
Chapter 1 Divisibility Number theory is concerned with the properties of the integers. By the word integers we mean the counting numbers 1, 2, 3,..., together with their negatives and zero. Accordingly
More informationMATH 361: NUMBER THEORY FOURTH LECTURE
MATH 361: NUMBER THEORY FOURTH LECTURE 1. Introduction Everybody knows that three hours after 10:00, the time is 1:00. That is, everybody is familiar with modular arithmetic, the usual arithmetic of the
More informationMATH 3240Q Introduction to Number Theory Homework 4
If the Sun refused to shine I don t mind I don t mind If the mountains fell in the sea Let it be it ain t me Now if six turned out to be nine Oh I don t mind I don t mind Jimi Hendrix If Six Was Nine from
More informationHomework #2 solutions Due: June 15, 2012
All of the following exercises are based on the material in the handout on integers found on the class website. 1. Find d = gcd(475, 385) and express it as a linear combination of 475 and 385. That is
More informationThe next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem.
CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 10 The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem.
More informationElementary Number Theory MARUCO. Summer, 2018
Elementary Number Theory MARUCO Summer, 2018 Problem Set #0 axiom, theorem, proof, Z, N. Axioms Make a list of axioms for the integers. Does your list adequately describe them? Can you make this list as
More informationMath 110 FOUNDATIONS OF THE REAL NUMBER SYSTEM FOR ELEMENTARY AND MIDDLE SCHOOL TEACHERS
4-1Divisibility Divisibility Divisibility Rules Divisibility An integer is if it has a remainder of 0 when divided by 2; it is otherwise. We say that 3 divides 18, written, because the remainder is 0 when
More information