International Baccalaureate LECTURE NOTES MATHEMATICS HL FURTHER MATHEMATICS HL Christos Nikolaidis TOPIC NUMBER THEORY

Similar documents
In number theory we will generally be working with integers, though occasionally fractions and irrationals will come into play.

SOLVED EXAMPLES

CSE 1400 Applied Discrete Mathematics Number Theory and Proofs

The Structure of Z p when p is Prime

MATH 304: MIDTERM EXAM SOLUTIONS

[ 47 ] then T ( m ) is true for all n a. 2. The greatest integer function : [ ] is defined by selling [ x]

Summary: Congruences. j=1. 1 Here we use the Mathematica syntax for the function. In Maple worksheets, the function

11. FINITE FIELDS. Example 1: The following tables define addition and multiplication for a field of order 4.

Trial division, Pollard s p 1, Pollard s ρ, and Fermat s method. Christopher Koch 1. April 8, 2014

Solutions to Math 347 Practice Problems for the final

Basic Sets. Functions. MTH299 - Examples. Example 1. Let S = {1, {2, 3}, 4}. Indicate whether each statement is true or false. (a) S = 4. (e) 2 S.

Proof of Fermat s Last Theorem by Algebra Identities and Linear Algebra

Recurrence Relations

6 Integers Modulo n. integer k can be written as k = qn + r, with q,r, 0 r b. So any integer.

[ 11 ] z of degree 2 as both degree 2 each. The degree of a polynomial in n variables is the maximum of the degrees of its terms.

1. By using truth tables prove that, for all statements P and Q, the statement

Different kinds of Mathematical Induction

Sequences, Mathematical Induction, and Recursion. CSE 2353 Discrete Computational Structures Spring 2018

Chapter 2. Periodic points of toral. automorphisms. 2.1 General introduction

Section 5.1 The Basics of Counting

62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 +

1 Summary: Binary and Logic

SEQUENCES AND SERIES

Zeros of Polynomials

Exam 2 CMSC 203 Fall 2009 Name SOLUTION KEY Show All Work! 1. (16 points) Circle T if the corresponding statement is True or F if it is False.

Complex Numbers Solutions

We are mainly going to be concerned with power series in x, such as. (x)} converges - that is, lims N n

Lecture 10: Mathematical Preliminaries

Primality Test. Rong-Jaye Chen

Bertrand s Postulate

SOME TRIBONACCI IDENTITIES

CHAPTER I: Vector Spaces

MAT1026 Calculus II Basic Convergence Tests for Series

Math 155 (Lecture 3)

Continued Fractions and Pell s Equation

Math 475, Problem Set #12: Answers

Seunghee Ye Ma 8: Week 5 Oct 28

DIVISIBILITY PROPERTIES OF GENERALIZED FIBONACCI POLYNOMIALS

Homework 3. = k 1. Let S be a set of n elements, and let a, b, c be distinct elements of S. The number of k-subsets of S is

Solutions to Problem Set 8

Fermat s Little Theorem. mod 13 = 0, = }{{} mod 13 = 0. = a a a }{{} mod 13 = a 12 mod 13 = 1, mod 13 = a 13 mod 13 = a.

3. Z Transform. Recall that the Fourier transform (FT) of a DT signal xn [ ] is ( ) [ ] = In order for the FT to exist in the finite magnitude sense,

Homework 1 Solutions. The exercises are from Foundations of Mathematical Analysis by Richard Johnsonbaugh and W.E. Pfaffenberger.

The multiplicative structure of finite field and a construction of LRC

CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo

AN ALMOST LINEAR RECURRENCE. Donald E. Knuth Calif. Institute of Technology, Pasadena, Calif.

Find a formula for the exponential function whose graph is given , 1 2,16 1, 6

Read carefully the instructions on the answer book and make sure that the particulars required are entered on each answer book.

Exercises 1 Sets and functions

Polynomials with Rational Roots that Differ by a Non-zero Constant. Generalities

Basic Sets. MTH299 - Examples. Example 1. Let S = {1, {2, 3}, 4}. Indicate whether each statement is true or false. (a) S = 4

Square-Congruence Modulo n

CHAPTER 5. Theory and Solution Using Matrix Techniques

Homework 9. (n + 1)! = 1 1

Inverse Matrix. A meaning that matrix B is an inverse of matrix A.

Topic 1 2: Sequences and Series. A sequence is an ordered list of numbers, e.g. 1, 2, 4, 8, 16, or

Chapter 4. Fourier Series

6.3 Testing Series With Positive Terms

Convergence of random variables. (telegram style notes) P.J.C. Spreij

The picture in figure 1.1 helps us to see that the area represents the distance traveled. Figure 1: Area represents distance travelled

3.2.4 Integer and Number Theoretical Functions

In algebra one spends much time finding common denominators and thus simplifying rational expressions. For example:

Definition 4.2. (a) A sequence {x n } in a Banach space X is a basis for X if. unique scalars a n (x) such that x = n. a n (x) x n. (4.

LECTURE NOTES, 11/10/04

Infinite Sequences and Series

1. ARITHMETIC OPERATIONS IN OBSERVER'S MATHEMATICS

(A sequence also can be thought of as the list of function values attained for a function f :ℵ X, where f (n) = x n for n 1.) x 1 x N +k x N +4 x 3

Math 609/597: Cryptography 1

and each factor on the right is clearly greater than 1. which is a contradiction, so n must be prime.

Chapter 6 Infinite Series

Once we have a sequence of numbers, the next thing to do is to sum them up. Given a sequence (a n ) n=1

MA131 - Analysis 1. Workbook 3 Sequences II

Modern Algebra. Previous year Questions from 2017 to Ramanasri

Lesson 10: Limits and Continuity

Lecture 23 Rearrangement Inequality

3 Gauss map and continued fractions

3.2 Properties of Division 3.3 Zeros of Polynomials 3.4 Complex and Rational Zeros of Polynomials

Machine Learning Theory Tübingen University, WS 2016/2017 Lecture 12

Wrap of Number Theory & Midterm Review. Recall: Fundamental Theorem of Arithmetic

Lecture Notes for CS 313H, Fall 2011

SEQUENCE AND SERIES NCERT

1 Generating functions for balls in boxes

M A T H F A L L CORRECTION. Algebra I 1 4 / 1 0 / U N I V E R S I T Y O F T O R O N T O

Math 4107: Abstract Algebra I Fall Webwork Assignment1-Groups (5 parts/problems) Solutions are on Webwork.

7 Sequences of real numbers

Properties and Tests of Zeros of Polynomial Functions

MT5821 Advanced Combinatorics

TEACHER CERTIFICATION STUDY GUIDE

Injections, Surjections, and the Pigeonhole Principle

Product measures, Tonelli s and Fubini s theorems For use in MAT3400/4400, autumn 2014 Nadia S. Larsen. Version of 13 October 2014.

Objective Mathematics

MATH1035: Workbook Four M. Daws, 2009

ANSWERS SOLUTIONS iiii i. and 1. Thus, we have. i i i. i, A.

Math 140A Elementary Analysis Homework Questions 1

First selection test, May 1 st, 2008

PROBLEM SET 5 SOLUTIONS 126 = , 37 = , 15 = , 7 = 7 1.

CSI 2101 Discrete Structures Winter Homework Assignment #4 (100 points, weight 5%) Due: Thursday, April 5, at 1:00pm (in lecture)

2.1. The Algebraic and Order Properties of R Definition. A binary operation on a set F is a function B : F F! F.

Topics. Homework Problems. MATH 301 Introduction to Analysis Chapter Four Sequences. 1. Definition of convergence of sequences.

Induction: Solutions

Transcription:

Iteratioal Baccalaureate LECTURE NOTES MATHEMATICS HL FURTHER MATHEMATICS HL TOPIC NUMBER THEORY METHODS OF PROOF. Couterexample - Cotradictio - Pigeohole Priciple Strog mathematical iductio 2 DIVISIBILITY.... 5 Basic properties - Divisio of itegers gcd ad lcm - Euclidia Algorithm 3 PRIME NUMBERS... 2 The Fudametal Theorem of Arithmetic 4 LINEAR DIOPHANTINE EQUATIONS..... 7 5 CONGRUENCES... 2 Properties - Fermat s Little Theorem Solvig liear cogrueces - Chiese Remaider Theorem 6 REPRESENTATION OF NUMBERS... 3 The decimal system vs the base-b system Divisibility tests 7 RECURRENCE RELATIONS... 37 Recurrece relatios of first degree Recurrece relatios of secod degree (homogeeous case) March 28

. METHODS OF PROOF Cosider the statemet If someoe lives i Greece the he lives i Europe The coverse of this statemet is If someoe lives i Europe the he lives i Greece. The cotrapositive of this statemet is If someoe does ot live i Europe the he does ot live i Greece We will use this example to demostrate two kids of proof. Proof by a couterexample A couterexample is eough to establish that a statemet is ot true i geeral. For example, let us prove that the coverse of the statemet above is ot true: If someoe lives i Europe, he does ot ecessarily live i Greece. Proof: Select a residet of Frace. He lives i Europe but he does ot live i Greece! Proof by cotradictio The cotrapositive of the origial statemet is true: If someoe does ot live i Europe the he does ot live i Greece Proof. Suppose that a perso A does ot live i Europe. If A lives i Greece the by the origial statemet A lives i Europe. Cotradictio. The priciple of cotradictio is based o the followig fact: If A the B is equivalet to the cotrapositive statemet If ot B the ot A Ideed: if ot B the ot A because if A the B, cotradictio!

Let us see two more mathematical examples EXAMPLE Let a be a iteger. Prove the followig statemets: (a) If a 2 is eve the a is eve. Proof by cotradictio: Let a 2 be eve. If a is odd, the a=2+ for some iteger. But a 2 =(2+) 2 =4 2 +4+=2(2 2 +2)+ which is odd. Cotradictio. (b) If a 2 is a multiple of, the a is ot ecessarily a multiple of. Proof by a couterexample: For a=6 ad =4, 6 2 is a multiple of 4 but 6 is ot a multiple of 4 NOTICE. We very ofte do ot refer at all to the term cotradictio ; we simply prove the cotrapositive statemet. A classical mathematical example is the defiitio of a - fuctio: differet elemets map to differet images, that is x x 2 f(x ) f(x 2 ) It is much more practical to use the equivalet statemet f(x ) = f(x 2 ) x = x 2 This is i fact the cotrapositive statemet of the defiitio A classical example of cotradictio is the pigeohole priciple preseted below. 2

The pigeohole priciple Suppose that + pigeos are placed i pigeoholes The, there exists a pigeohole with at least 2 pigeos Ideed, is all pigeoholes had at most pigeo we would have at most pigeos, cotradictio. EXAMPLE There are 4 people i a club. At least two of them have their birthday o the same day. Ideed, if all of them had their birthday o differet days we would have at most 366 people, cotradictio. A more geeral form says Suppose that k+ pigeos are placed i pigeoholes The, there exists a pigeohole with at least k+ pigeos Ideed, is all pigeoholes had at most k pigeos we would have at most k pigeos, cotradictio. EXAMPLE For example, suppose that 64 pigeos are placed i 7 pigeoholes. Show that some pigeohole cotais at least pigeos. If, otherwise, all pigeoholes had at most 9 pigeos, we would have at most 7x9=63 pigeos, cotradictio. Fially, let us remember the priciple of mathematical iductio. 3

Strog mathematical iductio Remember the priciple of mathematical iductio for a statemet P() which depeds o the positive iteger. The steps are as follows o For = the statemet is true; o Assume that the statemet is true for =k; o Prove that the statemet is true for =k+; The the statemet is true for ay positive iteger. But sometimes the iductive step is ot based o the precedig iteger but o all the precedig itegers! o For = the statemet is true; o Assume that the statemet is true for ay <k; o Prove that the statemet is true for =k; The the statemet is true for ay positive iteger. Although prime umbers will be formally itroduced later o we will use a classical example which refers to prime umbers Ay iteger 2 is either a prime or it has a prime divisor. Proof by strog iductio. For =2 the statemet is true sice 2 is a prime. Assume that the statemet is true for ay <k We will prove that it is true for =k. Ideed, if k is a prime we are doe. If ot the k=ab But a<k hece it has a prime divisor p by assumptio. Thus p divides k as well, i.e. p is a prime divisor of k By strog iductio the propositio is true for ay 2. 4

2. DIVISIBILITY For two itegers a ad b, we say that a divides b, if b= ka for some k Z We use the otatio a b. Thus a b if ad oly if b= ka for some k Z For example, 3 divides 5: 3 5 sice 5=3 5 3 3 We also say that a is a divisor of b e.g. 3 is a divisor of 5 a is a factor of b e.g. 3 is a factor of 5 b is a multiple of a e.g. 5 is a multiple of 3 Remark: Particularly for ad a o-zero iteger a (sice is a multiple of ) a ( is a multiple of ay iteger, sice =a) a (i other words, divides oly ) Basic Properties. a a for ay a Z (reflexive) 2. a b ad b c a c (trasitive) 3. ± a for ay a Z 4. a ± a=± 5. a b ad b a a=± b 5

Notice. We very ofte cosider oly positive itegers. The, the last three properties become a for ay a Z + a a= a b ad b a a=b The proofs of these properties are all similar. Let s see a proof. Proof of property 2: a b ad b c a c a b ad b c b=ka ad c=k b for some k, k Z [by defiitio] c=k ka a c [by defiitio] Moreover, for ay itegers 6. a b a b 7. a b ad a b (cacellatio) 8. a b ad a 2 b 2 a a 2 b b 2 a b +b 2 9. a b ad a b 2 a b -b 2 a mb +b 2 (ay liear combiatio) Proof of property 7: a b ad a b a b ad b=ka for some k Z [by defiitio] b=ka a b [sice ] [by defiitio] 6

Divisio of itegers Whe we divide 4 by 5 (4 5), the quotiet is 8 ad the remaider. More formally 4 = 5 8+ We also kow that the remaider satisfies < 5. Thus Give two itegers a ad b>, there exist q, r ϵz such that a = bq+ r with r < b We say that q is the quotiet ad r is the remaider. Mid the case where a is egative: o Whe we divide 4 by 5 the remaider is (see above). o Whe we divide -4 by 5 the remaider is 4, sice - 4= 5 ( 9) + 4 Fially, if r = the b divides a sice gives 4 = 5 8 ad the remaider is. a= bq. For example, 4 5 NOTICE. I fact, we ca divide by egative iteger b as well. But the To summarize Ideed, r < b o Whe we divide 4 by 5 or -5 the remaider is o Whe we divide -4 by 5 or -5 the remaider is 4 4 5 4 = 5 8+ 4 (-5) 4 = ( 5) ( 8) + (-4) 5-4= 5 ( 9) + 4 (-4) (-5) - 4= 5 9+ 4 7

GCD ad LCM The greatest commo divisor (gcd) of two itegers is just the greatest commo divisor!. But bear i mid that it is always a o-egative umber. For example, The gcd of 6 ad 5 is 3. The gcd of 6 ad -5 is still 3. We write gcd(6,5)=3 ad gcd(6,-5)=3 But what is the formal defiitio of the gcd? Let a,b Z. The if gcd(a,b)=d (d ) (i) d a ad d b [I.e. d is a commo divisor] (ii) If d a ad d b, the d d [I.e. it is the greatest!] Ideed, gcd(6,5)=3 sice (i) 3 6 ad 3 5 (ii) if d 6 ad d 5, the d 3 [as d ca be either or 3] It also holds gcd(,a) = a ad gcd(,) = Propositio For ay a,b Z it holds (i) (ii) (iii) gcd(a,b)=gcd(a+b,b) gcd(a,b)=gcd(a-b,b) gcd(a,b)=gcd(a+kb,b) We oly prove property (iii) which is the most geeral result! 8

Proof of (iii) Let d =gcd(a,b) ad d 2 =gcd(a+kb,b) d a ad d b [property of d ] d a+kb ad d b [property of divisibility] d d 2 [sice d 2=gcd(a+kb,b)] O the other had d 2 a+kb ad d 2 a [property of d ] d 2 a+kb-kb ad d 2 b d 2 a ad d 2 b [property of divisibility] d 2 d [sice d =gcd(a,b)] Therefore, d =d 2 Similarly, the least commo multiple (lcm) of two itegers is just the least commo o-egative multiple!. For example, We write The lcm of 6 ad 9 is 8. lcm(6,9)=8 But what is the formal defiitio of the lcm? Let a,b Z. The if lcm(a,b)= l (l ) (i) a l ad b l [I.e. l is a commo multiple] (ii) if a l ad b l, the lil [I.e. it is the least] Ideed, lcm(6,9)=8 sice (i) 6 8 ad 9 8 (ii) if 6 l ad 9 l, the 8 l [as l ca be 8,36,54,72, ] 9

Euclidea Algorithm Our target here is to fid gcd(a,b). If a = bq+ r the accordig to a propositio above The we divide b by r gcd(a,b)=gcd(a-bq,b)=gcd(b,r) b = rq + r so that gcd(b,r)= gcd(r,r ) ad so o! Thus, we ca fid the gcd of two itegers by repeated divisios. Let s demostrate the result by usig a example: Fid gcd(,8). This implies that Ideed, = 8 5 + 8 = + 8 = 8 + 2 8 = 2 4 + gcd(,8) = 2 gcd(,8) = gcd(8,) = gcd(,8) = gcd(8,2) = gcd(2,) = 2 This algorithm allows us also to 2= gcd(,8) as a liear combiatio of ad 8: I geeral, 2 = - 8 = - (8- ) = - 8+2 = - 8+2 (-5 8) = 2-8 For ay a,b Z, if gcd(a,b)=d, the d = sa+rb for some r,s Z

We say that the itegers a ad b are coprime if gcd(a,b)=. For example 5 ad 7 are coprime, 4 ad 9 are coprime. Accordig to the last result, if a ad b are coprime the sa+rb = for some r,s Z But i this case the coverse is also true, that is if sa+rb = for some r,s Z, the gcd(a,b)= Ideed, suppose that sa+rb = ad gcd(a,b)=d. The d a ad d b d sa+rb d d=. Therefore, we obtai a very strog result gcd(a,b)= sa+rb = for some r,s Z Based o this result we ca prove the followig. If gcd(a,b)=d the d a ad d b are coprime itegers. 2. If a bc ad a,b are coprime the a c Proofs gcd(a,b)=d sa+rb =d for some r,s Z s d a +r d b = for some r,s Z (clearly d a,d b itegers) d a ad d b are coprime. Suppose that a bc, ad a,b are coprime. The sa+rb = for some r,s Z sac+rbc =c Sice a sac ad a rbc, it holds a c.

3. PRIME NUMBERS I this sectio we oly cosider positive itegers. Ay umber has at least two trivial divisors: ad itself. Some positive itegers have oly those two divisors. They are called prime. We cosider that the smallest prime umber is 2. This is i fact the oly eve prime umber (why?) A more formal defiitio says that a iteger p 2 is prime if p=ab a= or b= The first prime umbers are They form a sequece 2, 3, 5, 7,, 3, 7, 23, p = the -th prime For example, p =2, p 5 = etc. No-prime itegers 2 are also called composite. is either prime or composite. But how may prime umbers are there? There are ifiitely may prime umbers Proof. Suppose that there are oly prime umbers, p, p 2,, p. Cosider the iteger S= p p 2 p + S has a prime divisor. Suppose it is p i, where i. The p i S ad p i p p 2 p p i (S-p p 2 p ) p i Cotradictio. 2

A iterestig questio is Ca we fid cosecutive itegers which are o prime? The aswer is YES. The umbers!+2,!+3,!+4,,!+, are cosecutive itegers. The first oe is divisible by 2, the secod oe by 3,, the last oe by. So, oe of them is prime. I geeral, the cosecutive itegers (+)!+2, (+)!+3,!+4,, (+)!+(+) are composite umbers (why?) Fudametal Theorem of Arithmetic We have already see that Ay iteger 2 has a prime divisor. The proof has bee doe by usig strog mathematical iductio. For example 6 is divisible by 2, but also by 3 etc. I fact we ca express 6 as a product of primes: 6=2 2 3 5 We say that this is a prime decompositio of 6. A stroger versio of the last propositio says that ay iteger has a uique prime decompositio. This is the so-called fudametal theorem of Arithmetic. We split the propositio i two parts: Existece ad Uiqueess. Ay iteger 2 has a prime decompositio 3

Proof by strog iductio. For =2 it is true sice 2 is already a prime. Assume that the statemet is true for ay <k We will prove that it is true for =k. Ideed, if k is a prime we are doe. If ot the k=ab But a<k ad b<k, hece both a ad b have prime decompositios. Thus k=ab also has a prime decompositio. By strog iductio the propositio is true for ay 2. But is it possible to express a iteger ito two differet prime decompositios? The aswer is NO. Ay iteger has a uique prime decompositio Proof by strog iductio. For =2 it is true sice 2 is the oly prime decompositio for 2. Assume that the statemet is true for ay <k We will prove that it is true for =k. Ideed, if k is prime we are doe. If ot, suppose that k=p p 2 p s =q q 2 q t (where all p i ad q i are prime) Sice p divides the first product it also divides the secod product. So it divides oe of the primes q i so it is oe of them. Suppose (wlog) that p =q. The p 2 p s =q 2 q t But this umber is less that k so it has a uique decompositio. Therefore, s=t ad p 2 =q 2 p 3 =q 3 p s =q s Thus the decompositio of k is uique. By strog iductio the propositio is true for ay 2. 4

We agree that has also a prime decompositio. It is a product of zero primes! Thus ay positive iteger has a prime decompositio. NOTICE There are three versios for the expressio of the prime decompositio of a atural umber. = p, where p i primes with p p 2 p s p2p3lps p2 p3 Lps 2 3 s = p, where p i primes with p <p 2 < <p s 2 p3 = p p 2 3 L, where p is the sequece of all primes ad oly a fiite umber of expoets are o-zero For example, the correspodig expressios for the atural umber =4 are as follows 4=2 2 2 5 5 7 3 2 4 2 5 7 =, 4 = 2 3 3 5 2 7 3 L, The prime decompositio also helps us to fid the gcd ad the lcm of two itegers. For example, sice 4 2 5 7 3 2 =, 525 2 5 = 4 2, we obtai gcd(4,525) = 2 5 2 = 5 lcm(4,525) = Clearly, 2 3 4 2 5 7 = 4235 the decompositio cotais gcd oly the commo prime factors to the lowest power lcm all the prime factors to the greatest power. 5

This observatio provides a easy proof for the followig result gcd(,m) lcm(,m) = m Ideed, if = p m= p 2 3 p2 p3 m m2 m3 p2 p3 (where p is the sequece of all primes), the gcd(,m) lcm(,m) = mi(,m ) mi( 2,m ) L 2 2 2 2 =( p p L)( p p L) mi(,m ) + max(,m ) L mi(,m mi(,m ) + max(,m ) 2 ) mi( 2 2 2 2 2 = p p L + m m 2 = p 2 2 p L p2 + m p2 = ( p 2 L)( m p 2 L) = m,m ) Let s cofirm the result be usig the example above: 4 525 = 275 gcd lcm = 5 4235 = 275 6

4. LINEAR DIOPHANTINE EQUATIONS: ax+by=c Equatios where the solutios we are lookig for are oly itegers are called Diophatie. Here we study liear Diophatie equatios of the form ax+by=c where the ukows x,y Z. Sometimes it is easy to see that there is o solutio. For example 2x+6y=7 has o solutio sice the LHS is always eve while the RHS is odd. Cosider ow 2x+7y=9 Obviously (,) is a solutio. But it is ot the oly oe! (+7t,-2t) where t Z, are also solutios. Ideed 2(+7t)+7(-2t) = 2+4t+7-4t = 9 Thus (8,-), (5,-3), (-6,3) are some of the may solutios. I geeral, the followig result holds. Cosider the liear Diophatie equatio ax+by=c with d=gcd(a,b). The equatio has a solutio if ad oly if d c. Let (x,y) be a particular solutio. (a) If d= the geeral solutio is (x, y) = (x + bt,y at), t Z. (b) If d we divide the equatio by d ad reduce it b a to case (a) [thus (x, y) = (x + t,y t), t Z] d d 7

Proof. Cosider the equatio ax+by=c If d does ot divide c the it divides the LHS but ot the RHS, cotradictio. If d divides c the ra sb d=ra+sb for some r,s Z + = d d rac sbc + = c d d c c a(r ) + b(s ) = c d d c c c Sice Z the equatio has a solutio (x,y ) =(r, s ). d d d Let (x,y) be aother solutio. The Thus ax+by=c ax +by =c ax+by=ax +by a(x-x )=-b(y-y ) -a y y = b x x If d=, that is a ad b are coprime, the y-y =-at x-x = bt for some t Z Therefore (x, y) = (x + bt,y at), t Z. If d the a d x+ b d y= c d a b But ow gcd(, ) = ad the geeral solutio takes the form d d b a (x, y) = (x + t,y t), t Z. d d 8

EXAMPLE Solve the Diophatie equatios (a) 6x+4y=2 (b) 6x+3y=2 (c) 6x+5y=2 Solutios (a) gcd(6,4)=2. Sice 2 does ot divide 2, there is o solutio. (b) gcd(6,3)=. Sice 2, there is a solutio. The Euclidea algorithm gives 3=2 6+ Hece =3-6 2, that is 6 (-2)+3 = Multiply by 2: 6 (-42)+3 2=2 A particular solutio is (-42,2) The geeral solutio is (-42+3t,2-6t) (c) gcd(6,5)=3. Sice 3 2, there is a solutio. Method A: Direct The Euclidea algorithm gives 5=2 6+3 6 = 2 3+ (thus gcd=3) Hece 3=5-6 2, that is 6 (-2)+5 =3 Multiply by 7: 6 (-4)+3 7=2 A particular solutio is (-4,7) The geeral solutio is (-4+5t,7-2t) Method B: divide the equatio by 3; it reduces to case gcd= 2x+5y=7 Now gcd(2,5)=. The Euclidea algorithm gives 5 = 2 2+ Hece =5-2 2, that is 2 (-2)+5 = Multiply by 7: 2 (-4)+5 7=7 A particular solutio is (-4,7) The geeral solutio is (-4+5t,7-2t) 9

5. CONGRUENCES For ay Z +, we defie the equivalece relatio i Z a b(mod) a-b or equivaletly a ad b leave the same remaider whe divided by We say that a ad b are cogruet modulo (ad the equivalece relatio is called cogruece). For example 27 2(mod5) There are 5 equivalece classes modulo 5, (mod5) (mod5) 2(mod5) 3(mod5) 4(mod5) it is the set {5k k Z} it is the set {5k+ k Z} it is the set {5k+2 k Z} it is the set {5k+3 k Z} it is the set {5k+4 k Z} I geeral, there are equivalece classes modulo (mod) (mod) 2(mod) (-)(mod) They are also kow as residue classes modulo. The questio fid 27(mod5) meas fid the correspodig residue class. Thus 27 2(mod5) As the cogruece modulo reduces to divisibility, some first results are trivial 2

Properties of cogrueces Let The a b(mod) ad c d(mod) a+c b+d(mod) a-c b-d(mod) ac bd(mod) Proofs. a b(mod) a-b c d(mod) c-d st property: just otice that (a-b) + (c-d) = (a+c)-(b+d) a+c b+d(mod) 2 d property: similarly 3 rd property: (a-b)(c-d) = ac-bc-ad+bd = ac-bc-ad+2bd-bd = ac-bd-(bc-bd)-(ad-bd) = ac-bd-b(c-d)-d(a-b) Hece ac-bd ac bd(mod) Based o these properties we ca also prove the followig Let a b(mod) The a k b k (mod) k Z + ma mb(mod) m Z f(a) f(b)(mod) where f is a polyomial with iteger coefficiets 2

Fermat s Little theorem For ay a Z ad prime p that does ot divide a, a p- (modp) For example 3 4 (mod5) 5 2 (mod3) This theorem helps us to fid the residue class of a large umber. EXAMPLE Fid 5 28 (mod3) Solutio By Fermat s little theorem 5 2 (mod3) 5 2 68 68 (mod3) 5 26 (mod3) 5 26 5 2 5 2 (mod3) 5 28 25(mod3) 5 28 2(mod3) Sometimes we caot start by usig Fermat, but we try to start by a similar relatio of the form a (mod) or a -(mod). EXAMPLE Fid the last digit of 3 28. I other words, fid 3 28 (mod) Solutio Method : We observe that 3 4 (mod). Thus 3 4 54 54 (mod) 3 26 (mod) 3 26 3 2 3 2 (mod) 3 28 9(mod) Thus the last digit is 9. 22

Method 2: We observe that 3 2 -(mod). Thus 3 2 9 (-) 9 (mod) 3 28 -(mod) 3 28 9(mod) Thus the last digit is 9. NOTICE It is ot always possible to start with a relatio of the form a (mod) or a -(mod). We must improvise by usig similar techiques. For x (mod) with x> we ca simplify the base x by choosig a cogruet base y modulo (sice x y(mod) x y (mod). EXAMPLE Fid the last digit of 28 28, that is 28 28 (mod) Solutio Firstly, we reduce the base 28 to a smaller oe: 28-2(mod) 28 28 (-2) 28 (mod) 28 28 2 28 (mod) Thus the problem reduces to fidig 2 28 (mod). [2 is always eve, thus we ca t start by 2 (mod) for some. There are may alterative methods; I suggest oe] We observe that 2 4 (mod5). Thus 2 4 54 54 (mod5) 2 26 (mod5) 2 27 2(mod5) But also 2 27 2(mod2). Thus 2 27 2(mod2 5) 2 27 2(mod) 2 2 27 2 2(mod) 2 28 4(mod) Therefore, the last digit of 28 28 is 4. 23

Solvig liear cogrueces Cosider the liear cogruece equatio 3x 4(mod5) Notice that if x=a satisfies the equatio the the whole class a(mod5) satisfies the equatio (easy to verify). Amog the 5 classes mod5 oly 3(mod5) satisfies the equatio sice I geeral, 3 3=9 4(mod5) Cosider the liear cogruece with d=gcd(a,). ax b(mod) The equatio has a solutio if ad oly if d b. (a) If d= there is a uique solutio of the form x (mod) (b) If d we divide the whole equatio by d ad get It reduces to case (a). a x b (mod ) Give the uique solutio x (mod ), we obtai d solutios mod: x (mod) b x + (mod) d 2b x + (mod) etc d I fact the problem of solvig a liear cogruet is equivalet to the problem of solvig a Diophatie equatio. Ideed, ax b(mod) ax-b=k ax - k = b I Diophatie equatios we seek pairs (x,k), I liear cogrueces we seek classes x(mod) [igore k] Thus the strategies are very similar. 24

We saw i a previous paragraph a example of 3 Diophatie equatios (a) 6x+4y=2 (b) 6x+3y=2 (c) 6x+5y=2 Let us see ow the 3 correspodig liear cogrueces. EXAMPLE Solve the liear cogrueces (a) 6x 2(mod4) (b) 6x 2(mod3) (c) 6x 2(mod5) Solutios (a) gcd(6,4)=2. Sice 2 does ot divide 2, there is o solutio. (b) gcd(6,3)=. Sice 2, there is a uique solutio mod3. The Euclidea algorithm gives 3=2 6+ Hece =3-6 2, that is 6 (-2)+3 = Multiply by 2: 6 (-42)+3 2=2 The solutio is -42(mod3), that is (mod3) (c) gcd(6,5)=3. Sice 3 2, there are 3 solutios (mod5). Divide the equatio by 3: 2x 7(mod5) Now gcd(2,5)=. The Euclidea algorithm gives 5 = 2 2+ Hece =5-2 2, that is 2 (-2)+5 = Multiply by 7: 2 (-4)+5 7=7 The solutio is -4(mod5), that is (mod5) The 3 solutios (mod5) are the followig (mod5) 6(mod5) (mod5) 25

Chiese Remaider Theorem Cosider the simultaeous liear cogrueces x b (mod ) x b 2 (mod 2 ) x b k (mod k ) If, 2,, k are pairwise coprime ad = 2 k there is a uique solutio mod. Sketch of the proof for 3 cogrueces x b (mod ) x b 2 (mod 2 ) x b 3 (mod 3 ) Existece - we form 3 auxiliary liear cogrueces 2 3 A (mod ) 3 B (mod 2 ) 2 C (mod 3 ) - we fid the particular solutios A, B, C - We calculate x b ( 2 3 A)+b 2 ( 3 B)+b 3 ( 2 C) The iteger x satisfies the 3 cogrueces (easy to check). Uiqueess If aother iteger y also satisfies the 3 equatios the x y(mod ) x y(mod 2 ) x y(mod 3 ) Thus, 2, 3 divide x-y ad sice they are pairwise coprime = 2 3 divides x-y that is x y(mod) 26

EXAMPLE Solve the system of liear cogrueces x (mod2) x 2(mod3) x 4(mod5) Solutio Sice 2,3,5 are pairwise coprime there is a uique solutio mod3. Method (it follows the ratioale of the proof) - we form 3 auxiliary liear cogrueces 3 5A (mod2) i.e 5A (mod2) 2 5B (mod3) i.e B (mod3) 2 3C (mod5) i.e 6C (mod5) - we fid the particular solutios A=, B=, C= - We estimate x (5A)+2(B)+4(6C) = 5+2+24 = 59 The solutio is x 59(mod3), that is x 29(mod3). Method 2 (more practical) st equatio x= 2a+ 2 d equatio 2a+ 2(mod3) 2a (mod3) a 2(mod3) hece a=3b+2 x=2(3b+2)+ x=6b+5 3 rd equatio 6b+5 4(mod5) 6b -(mod5) b=4 Therefore x = 29 ad the solutio is x 29(mod3). More geeral form of the Chiese Remaider Theorem a x c (mod ) a 2 x c 2 (mod 2 ) a 3 x c 3 (mod 3 ) We solve the 3 liear cogrueces separately. Suppose they have uique solutios: x b (mod ) x b 2 (mod 2 ) x b 3 (mod 3 ) Thus the problem reduces to the simple case above. 27

If for example the first cogruece has 2 solutios x b (mod ) ad x b (mod ) (ad the other two uique) we have to solve two distict systems x b (mod ) x b (mod ) x b 2 (mod 2 ) x b 2 (mod 2 ) x b 3 (mod 3 ) x b 3 (mod 3 ) EXAMPLE Solve the system of liear cogrueces 3x (mod2) 5x (mod3) 2x 3(mod5) Solutio 3x (mod2) has the uique solutio x (mod2) 5x (mod3) has the uique solutio x 2(mod3) 2x 3(mod5) has the uique solutio x 4(mod5) The three ew cogrueces form i fact the system of the previous example, so the solutio is x 29(mod3). EXAMPLE Solve the system of liear cogrueces 2x (mod3) 6x 2(mod4) Solutio The st equatio has the uique solutio x 2(mod3). The 2 d equatio has the two solutios x (mod4) ad x 3(mod4). We obtai two systems x 2(mod3) x 2(mod3) x (mod4) x 3(mod4) The first system has the solutio x 5(mod2). The secod system has the solutio x (mod2). 28

A iterestig applicatio of the Chiese remaider theorem is give below. It provides a additioal tool for fidig the residue class of a large umber. EXAMPLE Fid 7 28 (mod3) by usig Chiese remaider theorem. Solutio Sice 3=2 3 5, we split the questio ito 3 problems: Problem : Fid 7 28 (mod2) 7 (mod2) 7 28 (mod2) Problem 2: Fid 7 28 (mod3) 7 (mod3) 7 28 (mod3) Problem 3: Fid 7 28 (mod5) 7 2(mod3) 7 28 2 28 (mod5) Thus we have to fid 2 28 (mod5) 2 4 (mod5) 2 4 54 54 (mod5) 2 26 (mod5) 2 28 2 2 (mod5) 7 28 4(mod5) Thus x=7 28 satisfies the equatios x (mod2) x (mod3) x 4(mod5) By usig the Chiese remaider theorem, there is a uique solutio mod3: st equatio x= 2a+ 2 d equatio 2a+ (mod3) 2a (mod3) a (mod3) hece a=3b x=2(3b)+ x=6b+ 3 rd equatio 6b+ 4(mod5) 6b 3(mod5) b=3 Therefore x = 9 The solutio is x 9(mod3). 29

6. REPRESENTATION OF NUMBERS The decimal system vs the base-b system The stadard system of expressig umbers is the decimal system (or base- system) which uses digits,, 2, 3, 4, 5, 6, 7, 8, 9 A iteger i this system has a expressio of the form which implies a a La a + 2 + a+ a2 + L + a a Followig the same ratioale we ca express a iteger by usig b digits i the base-b system a + 2 + ab+ a2b + L + a b ab For example, i the base 5 system we use oly 5 digits,,2,3,4 The umber 243 i the base-5 system is equal to 2 3 3 + 5+ 5 + 4 5 + 2 that is 778 i the decimal system. We write (243) 5 = (778) Thus, the process of traslatig a umber to the decimal system (243) 5 = (?) is straightforward (just performig the aalysis above). What about the iverse process? For example (778) = (?) 5 We divide cotiuously by 5: 778 : 5 quotiet 355, remaider = 3 355 : 5 quotiet 7, remaider = 7 : 5 quotiet 4, remaider = 4 : 5 quotiet 2, remaider = 4 2 : 5 quotiet, remaider = 2 We just write the remaiders i the opposite order (778) = (243) 5 2 a a 5 4 3

EXAMPLE Express the umber (96) i the biary (i.e. base-2) system. Solutio 96 : 2 quotiet 98, remaider = 98 : 2 quotiet 49, remaider = 49 : 2 quotiet 24, remaider = 24 : 2 quotiet 2, remaider = 2 : 2 quotiet 6, remaider = 6 : 2 quotiet 3, remaider = 3 : 2 quotiet, remaider = : 2 quotiet, remaider = Thus (96) = () 5 I the base-6 system we use the 6 digits,, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F EXAMPLE Express (2AF3) 6 (a) I the decimal system (b) I the biary system Solutio 2 3 (a) (2AF3) 6 = 3 + F 6+ A 6 + 2 6 = = (995) 2 3 + 5 6+ 6 + 2 (b) Method : we ca divide cotiuously 995 (decimal) by 2. We will fid () 2 Method 2: (applies i the base-4, base-8, base-6 systems) We traslate each base-6 digit i biary form of legth 4 2 A F 3 6 3 Thus the biary form is ( ) 2 3

Divisibility tests (i the decimal system) Cosider the iteger a i the decimal system a= (a = a Laa) a + a + L + a+ We ca test if a is divisible by 2,3,4,5,6,7,8,9, or as follows Divisio by 2 a is divisible by 2 the last digit of a is eve a Proof. Therefore a = a + a + L + a+ + + + a + L (mod2) a (mod2) 2 a 2 a a For example, Divisio by 3 Proof. 37532268 is divisible by 2 sice 8 (last digit) is eve a is divisible by 3 the sum of the digits is divisible by 3 We first observe that for ay k Z + Thus, Therefore (mod3) k a = a + a + L + a+ a a + + a+ a + L (mod3) 3 a 3 sum of digits (mod3) a For example, 37532268 is divisible by 3 sice sum of digits = 36 which is divisible by 3 32

Divisio by 4 Proof. a is divisible by 4 (a a) (last 2 digits) is divisible by 4 We first observe that k Z + with k 2 Thus, Therefore k (mod4) (sice, etc. are divisible by 4) a = a + a + L + a+ a + a (mod4) a) (a (mod4) 4 a 4 (a a) a For example, 37532268 is divisible by 4 sice 68 (last 2 digits) is divisible by 4 Divisio by 5 a is divisible by 5 the last digit is either or 5 Proof. Therefore a = a + a + L + a+ + + + a + L (mod5) a (mod5) 5 a 5 a a is or 5 a For example, 37532268 is ot divisible by 5 sice the last digit is 8 Divisio by 6 a is divisible by 6 it is divisible by 2 ad by 3 For example, 37532268 is divisible by 6 sice it is by 2 ad by 3 33

Divisio by 7 a is divisible by 7 (aa L a) 2a is divisible by 7 Proof. Therefore 2a= 2(a + a + + a+ a) = = L 2(a + a + L + a) + - 2 2(a + a + L + a) + 2a 2a - (a + a + L + a) + 2a (mod7) (a a L a ) + 2a mod7 7 a 7 2a 7 (aa a) 2a L For example, for 37532268 is ot divisible by 7 sice Divisio by 8 Proof. check 3753226-2 8 = 37532 check 37532-2 = 37532 check 37532-2 = 3753 check 3753-2 = 3753 check 375-2 3 = 369 check 36-2 9 = 8 which is ot divisible by 7 a is divisible by 8 (a 2 aa) (last 3 digits) is divisible by 8 We first observe that for ay k Z + with k 3 Thus, k (mod8) (sice, etc. are divisible by 8) a = a + a + L + a+ a 2 a + a 2 aa) + (mod8) (a (mod8) Therefore 8 a 8 (a 2 aa) a For example, 37532268 is ot divisible by 8 sice 268 (last 3 digits) is ot divisible by 8. 34

Divisio by 9 a is divisible by 9 the sum of the digits is divisible by 9 Proof. We first observe that for ay k Z + Thus, Therefore (mod9) k (mod9) a = a + a + L + a+ a a + + a + a + L (mod9) 9 a 9 sum of digits a For example, 37532268 is divisible by 9 sice sum of digits = 36 which is divisible by 9 Divisio by a is divided by the last digit is Proof. Therefore a = a + a + L + a+ + + + a + L (mod) a (mod) a a a is a For example, 37532268 is ot divisible by sice the last digit is ot Amog the two-digit divisors the case of is quite iterestig. 35

Divisio by Proof. a is divided by a -a +a 2 -a 3 + is divisible by We first observe that for ay k Z + Thus, Therefore (mod) k (mod) if k is eve k (mod) if k is odd a = a + a + a+ L + a a a + a2 3 a + L (mod) a a a + a + L 2 a3 For example, 37532268 is ot divisible by sice 8-6+2-2+3-5+7-3 = 4 is ot divisible by 36

7. RECURRENCE RELATIONS Recurrece relatios of first degree Let u + = ru d, with u give The geeral solutio has the form u = ar + b EXAMPLE Give that u = 5 ad u = 3u + 7 fid a geeral term of u Solutio The geeral solutio has the form Sice u = 5, 3a + b= 5 u = a3 + b We fid u 2 = 22, thus 9a + b= 22 The simultaeous equatios give Therefore, u = 7 a= ad 6 7 6 3 7 2 7 b= 2 Recurrece relatios of secod degree (homogeeous case) Let u Au + Bu + 2 + =, with u, u 2 give We use the characteristic (or auxiliary) equatio r 2 + Ar+ B= If the equatio has two distict solutios r, r2 (either real or complex) the geeral solutio has the form u = ar + br If the equatio has oe double root, the geeral solutio has the form 2 u = ar + br 37

EXAMPLE Solve the recurrece relatio problems Solutio (a) u + 4u + 3u, = 5, u 7 2 = u = (b) u + 4u + 4u, = 5, u 8 2 = u = (c) u + 4u + 5u, = 4, u 8 2 = (a) The characteristic equatio is r 2 4r+ 3= u = The solutios are ad 3. Thus the geeral solutio has the form The first two terms give u = a + b3 = a+ b3 a + b= 5 ad a + 3b= 7 Thus a = 4, b= ad the geeral solutio is u + = 4 3 (b) The characteristic equatio is r 2 4r+ 4= The solutio is 2. Thus the geeral solutio has the form u = a2 + b2 The first two terms give a= 5 ad 2a + 2b= 8 Thus a= 5, b= ad the geeral solutio is (c) The characteristic equatio is u = (5 )2 The solutios are r 2 4r+ 5 = 2± i. Thus the geeral solutio has the form u = a(2+ i) + b(2 i) The first two terms give a + b= 4 2a + 2b+ ai bi = 8 Thus a = 2, b= 2 ad the geeral solutio is u = 2(2+ i) + 2(2 i) 38