Discrete Mathematics. Dr. J. Saxl. Michælmas 1995

Size: px
Start display at page:

Download "Discrete Mathematics. Dr. J. Saxl. Michælmas 1995"

Transcription

1 Discrete Mathematics Dr. J. Saxl Michælmas 1995 These notes are maintained by Paul Metcalfe. Comments and corrections to

2 Revision: 2.3 Date: 1999/10/21 11:21:05 The following people have maintained these notes. date Paul Metcalfe

3 Contents Introduction v 1 Integers Division The division algorithm The Euclidean algorithm Applications of the Euclidean algorithm Continued Fractions Complexity of Euclidean Algorithm Prime Numbers Uniqueness of prime factorisation Applications of prime factorisation Modular Arithmetic Solving Congruences Systems of congruences Euler s Phi Function Public Key Cryptography Induction and Counting The Pigeonhole Principle Induction Strong Principle of Mathematical Induction Recursive Definitions Selection and Binomial Coefficients Selections Some more identities Special Sequences of Integers Stirling numbers of the second ind Generating Functions Catalan numbers Bell numbers Partitions of numbers and Young diagrams Generating function for self-conjugate partitions Sets, Functions and Relations Sets and indicator functions De Morgan s Laws Inclusion-Exclusion Principle iii

4 iv CONTENTS 3.2 Functions Permutations Stirling numbers of the first ind Transpositions and shuffles Order of a permutation Conjugacy classes in S n Determinants of an n n matrix Binary Relations Posets Products of posets Eulerian Digraphs Countability Bigger sets

5 Introduction These notes are based on the course Discrete Mathematics given by Dr. J. Saxl in Cambridge in the Michælmas Term These typeset notes are totally unconnected with Dr. Saxl. Other sets of notes are available for different courses. At the time of typing these courses were: Probability Discrete Mathematics Analysis Further Analysis Methods Quantum Mechanics Fluid Dynamics 1 Quadratic Mathematics Geometry Dynamics of D.E. s Foundations of QM Electrodynamics Methods of Math. Phys Fluid Dynamics 2 Waves (etc.) Statistical Physics General Relativity Dynamical Systems Physiological Fluid Dynamics Bifurcations in Nonlinear Convection Slow Viscous Flows Turbulence and Self-Similarity Acoustics Non-Newtonian Fluids Seismic Waves They may be downloaded from or or you can soc-archim-notes@lists.cam.ac.u to get a copy of the sets you require. v

6 Copyright (c) The Archimedeans, Cambridge University. All rights reserved. Redistribution and use of these notes in electronic or printed form, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of the electronic files must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in printed form must reproduce the above copyright notice, this list of conditions and the following disclaimer. 3. All materials derived from these notes must display the following acnowledgement: This product includes notes developed by The Archimedeans, Cambridge University and their contributors. 4. Neither the name of The Archimedeans nor the names of their contributors may be used to endorse or promote products derived from these notes. 5. Neither these notes nor any derived products may be sold on a for-profit basis, although a fee may be required for the physical act of copying. 6. You must cause any edited versions to carry prominent notices stating that you edited them and the date of any change. THESE NOTES ARE PROVIDED BY THE ARCHIMEDEANS AND CONTRIB- UTORS AS IS AND ANY EPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABIL- ITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ARCHIMEDEANS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EEMPLARY, OR CONSE- QUENTIAL DAMAGES HOWEVER CAUSED AND ON ANY THEORY OF LI- ABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUD- ING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THESE NOTES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAM- AGE.

7 Chapter 1 Integers Notation. The natural numbers, which we will denote by N, are The integers Z are f1 2 3 :::g: f::: ;2 ; :::g: We will also use the non-negative integers, denoted either by N 0 or Z +, which is N [ f0g. There are also the rational numbers Q and the real numbers R. Given a set S, we write x 2 S if x belongs to S, and x =2 S otherwise. There are operations + and on Z. They have certain nice properties which we will tae for granted. There is also ordering. N is said to be well-ordered, which means that every non-empty subset of N has a least element. The principle of induction follows from well-ordering. Proposition (Principle of Induction). Let P (n) be a statement about n for each n 2 N. Suppose P (1) is true and P () true implies that P ( +1)is true for each 2 N. Then P is true for all n. Proof. Suppose P is not true for all n. Then consider the subset S of N of all numbers for which P is false. Then S has a least element l. We now that P (l ; 1) is true (since l>1), so that P (l) must also be true. This is a contradiction and P holds for all n. 1.1 Division Given two integers a, b 2 Z, we say that a divides b (and write a j b) ifa 6= 0 and b = a q for some q 2 Z (a is a divisor of b). a is a proper divisor of b if a is not 1 or b. Note. If a j b and b j c then a j c, for if b = q 1 a and c = q 2 b for q 1, q 2 2 Z then c =(q 1 q 2 )a. Ifd j a and d j b then d j ax + by. The proof of this is left as an exercise. 1

8 2 CHAPTER 1. INTEGERS 1.2 The division algorithm Lemma 1.1. Given a, b 2 N there exist unique integers q, r 2 N with a = qb + r, 0 r<b. Proof. Tae q the largest possible such that qb a and put r = a;qb. Then 0 r<b since a ; qb 0 but (q +1)b a. Now suppose that a = q 1 b + r with q 1, r 1 2 N and 0 r 1 <b. Then 0=(q ; q 1 )b +(r ; r 1 ) and b j r ; r 1. But ;b <r; r 1 <bso that r = r 1 and hence q = q 1. It is clear that b j a iff r =0in the above. Definition. Given a, b 2 N then d 2 N is the highest common factor (greatest common divisor) of a and b if: 1. d j a and d j b, 2. if d 0 j a and d 0 j b then d 0 j d (d 0 2 N). The highest common factor (henceforth hcf) of a and b is written (a b) or hcf(a b). The hcf is obviously unique if c and c 0 are both hcf s then they both divide each other and are therefore equal. Theorem 1.1 (Existance of hcf). For a, b 2 N hcf(a b) exists. Moreover there exist integers x and y such that (a b) =ax + by. Proof. Consider the set I = fax + by : x y 2 Z and ax + by > 0g. Then I 6= so let d be the least member of I. Now9x 0 y 0 such that d = ax 0 + by 0, so that if d 0 j a and d 0 j b then d 0 j d. Now write a = qd + r with q, r 2 N 0, 0 r < d. We have r = a ; qd = a(1;qx 0 )+b(;qy 0 ).Sor =0, as otherwise r 2 I: contrary to d minimal. Similiarly, d j b and thus d is the hcf of a and b. Lemma 1.2. If a, b 2 N and a = qb + r with q, r 2 N 0 (a b) =(b r). and 0 r < b then Proof. If c j a and c j b then c j r and thus c j (b r). In particular, (a b) j (b r). Now note that if c j b and c j r then c j a and thus c j (a b). Therefore (b r) j (a b) and hence (b r) =(a b). 1.3 The Euclidean algorithm Suppose we want to find ( ). We use lemmas (1.1) and (1.2) to obtain: 525 = = = = So ( ) = (231 63) = (63 42) = (42 21) = 21. In general, to find (a b):

9 1.3. THE EUCLIDEAN ALGORITHM 3 a = q 1 b + r 1 with 0 <r 1 <b b = q 2 r 1 + r 2 with 0 <r 2 <r 1 r 1 = q 3 r 2 + r 3 with 0 <r 3 <r 2. r i;2 = q i r i;1 + r i with 0 <r i <r i;1. r n;3 = q n;1 r n;2 + r n;1 with 0 <r n <r n;1 r n;2 = q n r n;1 +0: This process must terminate as b>r 1 >r 2 > >r n;1 > 0. Using Lemma (1.2), (a b) = (b r 1 ) = = (r n;2 r n;1 ) = r n;1. So (a b) is the last non-zero remainder in this process. We now wish to find x 0 and y 0 2 Z with (a b) =ax 0 + by 0. We can do this by bacsubstitution. 21 = 63 ; 1 42 =63; (231 ; 3 63) =4 63 ; 231 =4 (525 ; 2 231) ; 231 =4 525 ; 9 231: This wors in general but can be confusing and wasteful. These numbers can be calculated at the same time as (a b) if we now we shall need them. We introduce A i and B i. We put A ;1 = B 0 = 0 and A 0 = B ;1 = 1. We iteratively define Now consider ab j ; ba j. Lemma 1.3. A i = q i A i;1 + A i;2 B i = q i B i;1 + B i;2 : ab j ; ba j =(;1) j+1 r j : Proof. We shall do this using strong induction. We can easily see that (1.3) holds for j = 1 and j = 2. Now assume we are at i 2 and we have already checed that r i;2 =(;1) i;1 (ab i;2 ; ba i;2 ) and r i;i =(;1) i (ab i;1 ; ba i;1 ).Now r i = r i;2 ; q i r i;1 =(;1) i;1 (ab i;2 ; ba i;2 ) ; q i (;1) i (ab i;1 ; ba i;1 ) =(;1) i+1 (ab i ; ba i ), using the definition of A i and B i.

10 4 CHAPTER 1. INTEGERS Lemma 1.4. A i B i+1 ; A i+1 B i =(;1) i Proof. This is done by bacsubstitution and using the definition of A i and B i. An immediate corollary of this is that (A i B i )=1. Lemma 1.5. A n = a (a b) B n = b (a b) : Proof. (1.3) for i = n gives ab n = ba n. Therefore a (a b) B n = b (a b) A n.now a (a b) b and are coprime. A (a b) n and B n are coprime and thus this lemma is therefore an immediate consequence of the following theorem. Theorem 1.2. If d j ce and (c d) =1then d j e. Proof. Since (c d) = 1 we can write 1 = cx + dy for some x, y 2 Z. Then e = ecx + edy and d j e. Definition. The least common multiple (lcm) of a and b (written [a b]) is the integer l such that 1. a j l and b j l, 2. if a j l 0 and b j l 0 then l j l 0. It is easy to show that [a b] = ab (a b). 1.4 Applications of the Euclidean algorithm Tae a, b and c 2 Z. Suppose we want to find all the solutions x, y 2 Z of ax +by = c. A necessary condition for a solution to exist is that (a b) j c, so assume this. Lemma 1.6. If (a b) j c then ax + by = c has solutions in Z. Proof. Tae x 0 and y 0 2 Z such that ax 0 + by 0 =(a b). Then if c = q(a b) then if x 0 = qx 0 and y 0 = qy 0, ax 0 + by 0 = c. Lemma 1.7. Any other solution is of the form x = x Z. b (a b), y = y 0 ; a (a b) for Proof. These certainly wor as solutions. Now suppose x 1 and y 1 is also a solution. a Then (x (a b) 0 ; x 1 ) = ; b (y a (a b) 0 ; y 1 ). Since and b are coprime we have (a b) (a b) a j (y b (a b) 0 ; y 1 ) and j (x (a b) 0 ; x 1 ). Say that y 1 = y 0 ; a, 2 Z. Then (a b) x 1 = x 0 + b (a b).

11 1.4. APPLICATIONS OF THE EUCLIDEAN ALGORITHM Continued Fractions We return to 525 and 231. Note that Notation. a b = = = = = =[ ] = : Note that 2, 3, 1 and 2 are just the q i s in the Euclidean algorithm. The rational > 0 is written as a continued fraction a b = q q q 3 + ::: 1 q n with all the q i 2 N 0, q i 1 for 1 <i<nand q n 2. Lemma 1.8. Every rational a b with a and b 2 N has exactly one expression in this form. Proof. Existance follows immediately from the Euclidean algorithm. As for uniqueness, suppose that a b = p p p 3 + ::: 1 p m with the p i s as before. Firstly p 1 = q 1 as both are equal to b a b c. Since 1 p 2+ ::: 1 a ;1 b ; p 1 a ;1 1 = p 2 + = 1 b ; q 1 = q 2 + : Thus p 2 = q 2 and so on. p ::: : q ::: < 1 then Now, suppose that given [q 1 q 2 ::: q n ] we wish to find a b equal to it. Then we wor out the numbers A i and B i as in the Euclidean algorithm. Then a b = An B n by lemma (1.3). If we stop doing this after i steps we get Ai B i =[q 1 q 2 ::: q i ]. The numbers Ai B i are called the convergents to a b. Using lemma (1.4), we get that Ai B i ; Ai;1 B i;1 = (;1)i B i;1b i. Now the B i are strictly increasing, so the gaps are getting smaller and the signs alternate. We get A 1 < A 3 < < a B 1 B 3 b < < A 4 < A 2 : B 4 B 2 The approximations are getting better and better; in fact Continued fractions for irrationals Ai B i ; a b 1 B ib i+1. This can also be done for irrationals, but the continued fractions become infinite. For instance we can get approximations to using the calculator. Tae the integral part, print, subtract it, invert and repeat. We get =[ :::]. The convergents are 3, and. We are already within ;4 of. There is a good approximation as B i increases. As an exercise, show that p 2=[ :::].

12 6 CHAPTER 1. INTEGERS 1.5 Complexity of Euclidean Algorithm Given a and b, how many steps does it tae to find (a b). The Euclidean algorithm is good. Proposition. The Euclidean algorithm will find (a b), a>bin fewer than 5d(b) steps, where d(b) is the number of digits of b in base 10. Proof. We loo at the worst case scenario. What are the smallest numbers needing n steps. In this case q i =1for 1 i<nand q n =2. Using these q i s to calculate A n and B n we find the Fibonacci numbers, that is the numbers such that F 1 = F 2 =1, F i+2 = F i+1 + F i. We get A n = F n+2 and B n = F n+1.soifb<f n+1 then fewer than n steps will do. If b has d digits then p! 5d+2 b 10 d ; 1 p ; 1 <F 5d as " F n = p 1 5 p! n 1+ 5 ; 1 ; p 5 2 2! n # : This will be shown later. 1.6 Prime Numbers A natural number p is a prime iff p>1 and p has no proper divisors. Theorem 1.3. Any natural number n>1 is a prime or a product of primes. Proof. If n is a prime then we are finished. If n is not prime then n = n 1 n 2 with n 1 and n 2 proper divisors. Repeat with n 1 and n 2. Theorem 1.4 (Euclid). There are infinitely many primes. Proof. Assume not. Then let p 1 p 2 ::: p n be all the primes. Form the number N = p 1 p 2 :::p n +1.NowN is not divisible by any of the p i butn must either be prime or a product of primes, giving a contradiction. This can be made more precise. The following argument of Erdös shows that the th smallest prime p satisfies p 4 ;1 +1. Let M be an integer such that all numbers M can be written as the product of the powers of the first primes. So any such number can be written m 2 p i1 1 pi2 2 :::pi with i 1 ::: i 2f0 1g. Nowm p M, so there are at most p M 2 possible numbers less than M. Hence M 2 p M,orM 4. Hence p A much deeper result (which will not be proved in this course!) is the Prime Number Theorem, that p log.

13 1.7. APPLICATIONS OF PRIME FACTORISATION Uniqueness of prime factorisation Lemma 1.9. If p j ab, a b 2 N then p j a and/or p j b. Proof. If p - a then (p a) =1and so p j b by theorem (1.2). Theorem 1.5. Every natural number > 1 has a unique expression as the product of primes. Proof. The existence part is theorem (1.3). Now suppose n = p 1 p 2 :::p = q 1 q 2 :::q l with the p i s and q j s primes. Then p 1 j q 1 :::q l,sop 1 = q j for some j. By renumbering (if necessary) we can assume that j =1. Now repeat with p 2 :::p and q 2 :::q l, which we now must be equal. There are perfectly nice algebraic systems where the decomposition into primes is not unique, for instance Z p ;5 = fa + b p ;5 : a b 2 Zg, where 6 = (1 + p ;5)(1 ; p ;5) =2 3 and 2 3 and 1 p ;5 are each prime. Or alternatively, 2Z = fall even numbersg, where prime means not divisible by Applications of prime factorisation Lemma If n 2 N is not a square number then p n is irrational. Proof. Suppose p n = a b, with (a b) =1. Then nb2 = a 2.Ifb>1 then let p be a prime dividing b. Thus p j a 2 and so p j a, which is impossible as (a b) =1. Thus b =1and n = a 2. This lemma can also be stated: if n 2 N with p n 2 Q then p n 2 N. Definition. A real number is algebraic if it satisfies a polynomial equation with coefficients in Z. Real numbers which are not algebraic are transcendental (for instance and e). Most reals are transcendental. If the rational a b ( with (a b) = 1 ) satisfies a polynomial with coefficients in Z then c n a n + c n;1 a n;1 b + :::b n c 0 =0 so b j c n and a j c 0. In particular if c n =1then b =1, which is stated as algebraic integers which are rational are integers. Note that if a = p 1 1 p2 2 :::p and b = p 1 1 p2 2 :::p with i i 2 N 0 then (a b) = p 1 1 p2 2 :::p and [a b] = p 1 1 p2 2 :::p, i = minf i i g and i = maxf i i g. Major open problems in the area of prime numbers are the Goldbach conjecture ( every even number greater than two is the sum of two primes ) and the twin primes conjecture ( there are infinitely many prime pairs p and p +2 ).

14 8 CHAPTER 1. INTEGERS 1.8 Modular Arithmetic Definition. If a and b 2 Z, m 2 N we say that a and b are congruent mod(ulo) m if m j a ; b. We write a b (mod m). It is a bit lie = but less restrictive. It has some nice properties: a a (mod m), if a b (mod m) then b a (mod m), if a b (mod m) and b c (mod m) then a c (mod m). Also, if a 1 b 1 (mod m) and a 2 b 2 (mod m) a 1 + a 2 b 1 + b 2 (mod m), a 1 a 2 b 1 a 2 b 1 b 2 (mod m). Lemma For a fixed m 2 N, each integer is congruent to precisely one of the integers f0 1 ::: m; 1g: Proof. Tae a 2 Z. Then a = qm + r for q r 2 Z and 0 r < m. Then a r (mod m). If 0 r 1 <r 2 < m then 0 <r 2 ; r 1 < m, som - r 2 ; r 1 and thus r 1 6 r 2 (mod m). Example. No integer congruent to 3 (mod 4) is the sum of two squares. Solution. Every integer is congruent to one of (mod 4). The square of any integer is congruent to 0 or 1 (mod 4) and the result is immediate. Similarly, using congruence modulo 8, no integer congruent to 7 (mod 8) is the sum of 3 squares. 1.9 Solving Congruences We wish to solve equations of the form ax b (mod m) given a b 2 Z and m 2 N for x 2 Z. We can often simplify these equations, for instance 7x 3 (mod 5) reduces to x 4 (mod 5) (since 21 1 and 9 4 (mod 5)). This equations are not always soluble, for instance 6x 4 (mod 9), as 9-6x ; 4 for any x 2 Z. Howtodoit The equation ax b (mod m) can have no solutions if (a m) - b since then m - ax;b for any x 2 Z. So assume that (a m) j b. We first consider the case (a m) = 1. Then we can find x 0 and y 0 2 Z such that ax 0 + my 0 = b (use the Euclidean algorithm to get x 0 and y 0 2 Z such that ax 0 + my 0 = 1). Then put x 0 = bx 0 so ax 0 b (mod m). Any other solution is congruent to x 0 (mod m),asm j a(x 0 ; x 1 ) and (a m) =1. So if (a m) =1then a solution exists and is unique modulo m.

15 1.10. EULER S PHI FUNCTION Systems of congruences We consider the system of equations x a mod m x b mod n: Our main tool will be the Chinese Remainder Theorem. Theorem 1.6 (Chinese Remainder Theorem). Assume m n 2 N are coprime and let a b 2 Z. Then 9x 0 satisfying simultaneously x 0 a (mod m) and x 0 b (mod n). Moreover the solution is unique up to congruence modulo mn. Proof. Write cm + dn = 1 with m n 2 Z. Then cm is congruent to 0 modulo m and 1 modulo n. Similarly dn is congruent to 1 modulo m and 0 modulo n. Hence x 0 = adn + bcm satifies x 0 a (mod m) and x 0 b (mod n). Any other solution x 1 satisfies x 0 x 1 both modulo m and modulo n, so that since (m n) =1, mn j x 0 ; x 1 and x 1 x 0 (mod mn). Finally, if 1 < (a m) then replace the congruence with one obtained by dividing by (a m) that is consider a (a m) x b (a m) mod m (a m) : Theorem 1.7. If p is a prime then (p ; 1)! ;1 (mod p). Proof. If a 2 N, a p ; 1 then (a p) =1and there is a unique solution of ax 1 (mod p) with x 2 N and x p ; 1. x is the inverse of a modulo p. Observe that a = x iff a 2 1 (mod p), iffp j (a + 1)(a ; 1), which gives that a =1or p ; 1. Therefore the elements in f2 3 4 ::: p;2g pair off so that 234(p;2) 1 (mod p) and the theorem is proved Euler s Phi Function Definition. For m 2 N, define (m) to be the number of nonnegative integers less than m which are coprime to m. (1) = 1. Ifp is prime then (p) =p ; 1 and (p a )=p 1 a ; 1 p. Lemma If m n 2 N with (m n) =1then (mn) =(m)(n). is said to be multiplicative. Let U m = fx 2 Z :0 x<m (x m) =1, the reduced set of residues or set of invertible elements. Note that (m) =ju m j. Proof. If a 2 U m and b 2 U n then there exists a unique x 2 U mn. with c a (mod m) and c b (mod n) (by theorem (1.6)). Such a c is prime to mn, since it is prime to m and to n. Conversely, any c 2 U mn arises in this way, from the a 2 U m and b 2 U n such that a c (mod m), b c (mod n). Thus ju mn j = ju m jju n j as required.

16 10 CHAPTER 1. INTEGERS An immediate corollary of this is that for any n 2 N, Y (n) =n 1 ; 1 : p pjn p prime Theorem 1.8 (Fermat-Euler Theorem). Tae a, m 2 N such that (a m) =1. Then a (m) 1 (mod m). Proof. Multiply each residue r i by a and reduce modulo m. The (m) numbers thus obtained are prime to m and are all distinct. So the (m) new numbers are just r 1 ::: r (m) in a different order. Therefore r 1 r 2 :::r (m) ar 1 ar 2 :::ar (m) (mod m) a (m) r 1 r 2 :::r (m) (mod m): Since (m r 1 r 2 :::r (m) )=1we can divide to obtain the result. Corollary (Fermat s Little Theorem). If p is a prime and a 2 Z such that p - a then a p;1 1 (mod p). This can also be seen as a consequence of Lagrange s Theorem, since U m is a group under multiplication modulo m. Fermat s Little Theorem can be used to chec that n 2 N is prime. If 9a coprime to n such that a n;1 6 1 (mod n) then n is not prime Public Key Cryptography Private ey cryptosystems rely on eeping the encoding ey secret. Once it is nown the code is not difficult to brea. Public ey cryptography is different. The encoding eys are public nowledge but decoding remains impossible except to legitimate users. It is usually based of the immense difficulty of factorising sufficiently large numbers. At present digit numbers cannot be factorised in a lifetime. We will study the RSA system of Rivest, Shamir and Adleson. The user A (for Alice) taes two large primes p A and q A with > 100 digits. She obtains N A = p A q A and chooses at random A such that ( A (N A )) = 1. We can ensure that p A ; 1 and q A ; 1 have few factors. Now A publishes the pair N A and A. By some agreed method B (for Bob) codes his message for Alice as a sequence of numbers M<N A. Then B sends A the number M A (mod N A ). When Alice wants to decode the message she chooses d A such that d A A 1 (mod )(N A ). Then M AdA M (mod N A ) since M (NA) 1. No-one else can decode messages to Alice since they would need to factorise N A to obtain (N A ). If Alice and Bob want to be sure who is sending them messages, then Bob could send Alice E A (D B (M )) and Alice could apply E B D A to get the message if it s from Bob.

17 Chapter 2 Induction and Counting 2.1 The Pigeonhole Principle Proposition (The Pigeonhole Principle). If nm +1objects are placed into n boxes then some box contains more than m objects. Proof. Assume not. Then each box has at most m objects so the total number of objects is nm a contradiction. A few examples of its use may be helpful. Example. In a sequence of at least l+1distinct numbers there is either an increasing subsequence of length at least +1 or a decreasing subsequence of length at least l+1. Solution. Let the sequence be c 1 c 2 ::: c l+1. For each position let a i be the length of the longest increasing subsequence starting with c i. Let d j be the length of the longest decreasing subsequence starting with c j.ifa i and d i l then there are only at most l distinct pairs (a i d j ). Thus we have a r = a s and d r = d s for some 1 r<s l +1. This is impossible, for if c r <c s then a r >a s and if c r >c s then d r >d s. Hence either some a i >or d j >l. Example. In a group of 6 people any two are either friends or enemies. Then there are either 3 mutual friends or 3 mutual enemies. Solution. Fix a person. Then has either 3 friends or 3 enemies. Assume the former. If a couple of friends of are friends of each other then we have 3 mutual friends. Otherwise, s 3 friends are mutual enemies. infinitely many rationals p q satisfying ; p Dirichlet used the pigeonhole principle to prove that for any irrational there are < Induction Recall the well-ordering axiom for N 0 : that every non-empty subset of N 0 has a least element. This may be stated equivalently as: there is no infinite descending chain in N 0. We also recall the (wea) principle of induction from before. q 11 q 2.

18 12 CHAPTER 2. INDUCTION AND COUNTING Proposition (Principle of Induction). Let P (n) be a statement about n for each n 2 N 0. Suppose P ( 0 ) is true for some 0 2 N 0 and P () true implies that P ( +1)is true for each 2 N. Then P (n) is true for all n 2 N 0 such that n 0. The favourite example is the Tower of Hanoi. We have n rings of increasing radius and 3 vertical rods (A, B and C) on which the rings fit. The rings are initially staced in order of size on rod A. The challenge is to move the rings from A to B so that a larger ring is never placed on top of a smaller one. We write the number of moves required to move n rings as T n and claim that T n =2 n ; 1 for n 2 N 0. We note that T 0 =0=2 0 ; 1, so the result is true for n =0. We tae >0 and suppose we have rings. Now the only way to move the largest ring is to move the other ; 1 rings onto C (in T ;1 moves). We then put the largest ring on rod B (in 1 move) and move the ; 1 smaller rings on top of it (in T ;1 moves again). Assume that T ;1 =2 ;1 ; 1. Then T =2T ;1 +1=2 ; 1. Hence the result is proven by the principle of induction. 2.3 Strong Principle of Mathematical Induction Proposition (Strong Principle of Induction). If P (n) is a statement about n for each n 2 N 0, P ( 0 ) is true for some 0 2 N 0 and the truth of P () is implied by the truth of P ( 0 ), P ( 0 +1), :::, P ( ; 1) then P (n) is true for all n 2 N 0 such that n 0. The proof is more or less as before. Example (Evolutionary Trees). Every organism can mutate and produce 2 new versions. Then n mutations are required to produce n +1end products. Proof. Let P (n) be the statement n mutations are required to produce n +1end products. P 0 is clear. Consider a tree with +1end products. The first mutation (the root) produces 2 trees, say with 1 +1and 2 +1end products with 1 2 <. Then +1= so = If both P ( 1 ) and P ( 2 ) are true then there are 1 mutations on the left and 2 on the right. So in total we have mutations in our tree and P () is true is P ( 1 ) and P ( 2 ) are true. Hence P (n) is true for all n 2 N Recursive Definitions (Or in other words) Defining f (n), a formula or functions, for all n 2 N 0 with n 0 by defining f ( 0 ) and then defining for > 0, f () in terms of f ( 0 ), f ( 0 +1), :::, f ( ; 1). The obvious example is factorials, which can be defined by n! = n(n ; 1)! for n 1 and 0! = 1. Proposition. The number of ways to order a set of n points is n! for all n 2 N 0. Proof. This is true for n =0. So, to order an n-set, choose the 1 st element in n ways and then order the remaining n ; 1-set in (n ; 1)! ways. Another example is the Acermann function, which appears on example sheet 2.

19 2.5. SELECTION AND BINOMIAL COEFFICIENTS Selection and Binomial Coefficients We define a set of polynomials for m 2 N 0 as x m = x(x ; 1)(x ; 2) :::(x ; m +1) which is pronounced x to the m falling. We can do this recursively by x 0 =1and x m =(x ; m +1)x m;1 for m>0. We also define x to the m rising by x m = x(x + 1)(x +2):::(x + m ; 1): ; x We further define m (read x choose m ) by x = xm m m! : ; x It is also convienient to extend this definition to negative m by m =0if m<0, m 2 Z. By fiddling a little, we can see that for n 2 N, n m n n! = m m!(n ; : m)! ; n Proposition. The number of -subsets of a given n-set is. Proof. We can choose the first element to be included in our -subset in n ways, then then next in n ; 1 ways, down to the th which can be chosen in n ; +1ways. However, ordering of the -subset is not important (at the moment), so divide n! to get the answer. Theorem 2.1 (The Binomial Theorem). For a and b 2 R, n 2 N 0 then (a + b) n n = a b n; : There are many proofs of this fact. We give one and outline a second. Proof. (a +b) n =(a +b)(a +b) :::(a +b), so the coefficient of a b n; is the number of -subsets of an n-set so the coefficient is ; n. Proof. This can also be done by induction on n, using the fact that n n ; 1 n ; 1 = + : ; 1 There are a few conseqences of the binomial expansion. 1. For m n 2 N ; n 0 and n m, m 2 N0 so m! divides the product of any m consecutive integers. ; n so the number P 2. Putting a = b =1in the binomial theorem gives 2 n = of subsets of an n-set is 2 n. There are many proofs of this fact. An easy one is by induction on n. Write S n for the total number of subsets of an n-set. Then S 0 =1and for n>0, S n =2S n;1. (Pic a point in the n-set and observe that there are S n;1 subsets not containing it and S n;1 subsets containing it.

20 14 CHAPTER 2. INDUCTION AND COUNTING ; n (;1) so in any finite set the number of subsets of P 3. (1 ; 1) n =0= even sizes equals the number of subsets of odd sizes. It also gives us another proof of Fermat s Little Theorem: if p is prime then a p a (mod p) for all a 2 N 0. Proof. It is done by induction on a. It is obviously true when a =0, so tae a>0 and assume the theorem is true for a ; 1. Then a p =((a ; 1) + 1) p (a ; 1) p +1 mod p as a ; 1+1 a mod p mod p p 0 (mod p) unless =0or = p Selections The number of ways of choosing m objects out of n objects is ordered unordered ; no repeats n m n ; m repeats n m n;m+1 ; m n;m+1 The only entry that needs justification is m. But there is a one-to-one correspondance betwen the set of ways of choosing m out of n unordered with possible repeats and the set of all binary strings of length n + m ; 1 with m zeros and n ; 1 ones. For suppose there are m i occurences of element i, m i 0. Then There are ; n;m+1 m n m i = m $ 0 :::0 {z } {z } 10:::01 :::10:::0 i=1 m 1 m 2 such strings (choosing where to put the 1 s) Some more identities Proposition. n n = n ; {z } n 2 N 0 2 Z m n : Proof. For: choosing a -subset is the same as choosing an n ; -subset to reject. Proposition. n = n ; 1 ; 1 + n ; 1 n 2 N 0 2 Z Proof. This is trivial if n<0or 0, so assume n 0 and >0. Choose a special element in the n-set. Any -subset will ; either contain this special element (there are such) or not contain it (there are n;1 such). ; n;1 ;1

21 2.5. SELECTION AND BINOMIAL COEFFICIENTS 15 In fact Proposition. x = x ; 1 ; 1 + x ; 1 2 Z Proof. Trivial if <0, so let 0. Both sides are polynomials of degree and are equal on all elements of N 0 and so are equal as polynomials as a consequence of the Fundamental Theorem of Algebra. This is the polynomial argument. This can also be proved from the definition, if you want to. Proposition. x m x x ; = m 2 Z: m m ; Proof. If < 0 or m < then both sides are zero. Assume m 0. Assume x = n 2 N (the general case follows by the polynomial argument). This is choosing a -subset contained in an m-subset of a n-set. Proposition. x = x x ; 1 ; 1 2 Z nf0g Proof. We may assume x = n 2 N and > 0. This is choosing a -team and its captain. Proposition. Proof. For n +1 and so on. m +1 = n +1 m +1 = n =0 n n + = m m +1 m n 2 N 0 m n + m n ; 1 m + n ; 1 m +1 P n A consequence of this is that =1 m = 1 (n m+1 +1)m+1 P, which is obtained by n multiplying the previous result by m!. This can be used to sum Proposition. r + s = m + n r s m + n ; =1 m. r s m n2 Z Proof. We can replace n by m + n and by m + and so we may assume that m =0. So we have to prove: r + s r s = r s n2 Z: n n ; Tae an (r + s)-set and split it into an r-set and an s-set. Choosing an n-subset amounts to choosing a -subset from the r-set and an (n ; )-subset from the s-set for various.

22 16 CHAPTER 2. INDUCTION AND COUNTING 2.6 Special Sequences of Integers Stirling numbers of the second ind Definition. The Stirling number of the second ind, S(n ), n 2 N 0 is defined as the number of partitions of f1 ::: ng into exactly non-empty subsets. Also S(n 0) = 0 if n>0and 1 if n =0. ; n Note that S(n ) = 0 if > n, S(n n) = 1 for all n, S(n n ; 1) = 2 and S(n 2) = 2 n;1 ; 1. Lemma 2.1. A recurrence: S(n ) =S(n ; 1 ; 1) + S(n ; 1 ). Proof. In any partition of f1 ::: ng, the element n is either in a part on its own (S(n; 1 ; 1) such) or with other things (S(n ; 1 ) such). Proposition. For n 2 N 0, x n = P S(n )x. Proof. Proof is by induction on n. It is clearly true when n =0, so tae n>0 and assume the result is true for n ; 1. Then x n = xx n;1 = x S(n ; 1 )x = = = = S(n ; 1 )x (x ; + ) S(n ; 1 )x +1 + S(n ; 1 ; 1)x + S(n )x as required. S(n ; 1 )x S(n ; 1 )x Generating Functions Recall the Fibonacci numbers, F n such that F 1 = F 2 =1and F n+2 = F n+1 + F n. Suppose that we wish to obtain a closed formula. First method Try a solution of the form F n = n. Then we get 2 ; ; 1=0and = 1p 5.We 2 then tae! n F n = A 1+p 5 + B 1 ; p! n and use the initial conditions to determine A and B. It turns out that " p! n F n = p ; 1 ; p! n # 5 : 5 2 2

23 2.6. SPECIAL SEQUENCES OF INTEGERS 17 Note that 1+p 5 > 1 and 2 1;p 5 2 < 1 so the solution grows exponentially. A shorter form is that F n is the nearest integer to p n. p Second Method Or we can form an ordinary generating function G(z) = n0 F n z n : Then using the recurrence for F n and initial conditions we get that G(z)(1 ; z ; z 2 )= z. We wish to find the coefficient of z n in the expansion of G(z) (which is denoted [z n ]G(z)). We use partial fractions and the binomial expansion to obtain the same result as before. In general, the ordinary generating function associated with the sequence (a n ) n2n0 is G(z) = P n0 a nz n, a formal power series. It is deduced from the recurrence and the initial conditions. Addition, subtraction, scalar multiplication, differentiation and integration wor as expected. The new thing is the product of two such series: 0 a z l0 b l z l = n0 c n z n where c n = n =0 a b n; : (c n ) n2n0 is the convolution of the sequences (a n ) n2n0 and (b n ) n2n0. Some functional substitution also wors. Any identities give information about the coefficients. We are not concered about convergence, but within the radius of convergence we get extra information about values Catalan numbers A binary tree is a tree where each vertex has a left child or a right child or both or neither. The Catalan number C n is the number of binary trees on n vertices. Lemma 2.2. C n = 0n;1 C C n;1; Proof. On removing the root we get a left subtree of size and a right subtree of size n ; 1 ; for 0 n ; 1. Summing over gives the result. This loos lie a convolution. In fact, it is [z n;1 ]C(z) 2 where C(z) = n0 C n z n : We observe that therefore C(z) =zc(z) 2 +1, where the multiplication by z shifts the coefficients up by 1 and then +1 adjusts for C 0. This equation can be solved for C(z) to get C(z) = 1 p 1 ; 4z : 2z

24 18 CHAPTER 2. INDUCTION AND COUNTING Since C(0)=1we must have the ; sign. From the binomial theorem 1 (1 ; 4z) = (;4) z : Thus C n = ; 2; 1 12 n+1 ; 2n the corollary that (n +1)j n. Other possible definitions for C n are: 0 (;4) n+1. Simplifying this we obtain C n = n+1; 1 2n n and note The number of ways of braceting n +1variables. The number of sequences of length 2n with n each of 1 such that all partial sums are non-negative Bell numbers Definition. The Bell number B n is the number of partitions of f1 ::: ng. P It is obvious from the definitions that B n = S(n ). Lemma 2.3. B n+1 = 0n n B Proof. For, put the element n +1in with a -subset of f1 ::: ng for =0to = n. There isn t a nice closed formula for B n, but there is a nice expression for its exponential generating function. Definition. The exponential generating function that is associated with the sequence (a n ) n2n0 is ; n ^A(z) = n a n n! zn : If P we have P ^A(z) and ^B(z) (with obvious notation) and ^A(z) ^B(z) = n cn n! zn then c n = a b n;, the exponential convolution of (a n ) n2n0 and (b n ) n2n0. Hence B n+1 is the coefficient of z n in the exponential convolution of the sequences ::: and B 0 B 1 B 2 :::. Thus ^B(z) 0 = e z ^B(z). (Shifting is achieved by differentiation for exponential generating functions.) Therefore ^B(z) = e ez +C and using the condition ^B(0)=1we find that C = ;1. So ^B(z) =e ez ;1 : Partitions of numbers and Young diagrams For n 2 N let p(n) be the number of ways to write n as the sum of natural numbers. We can also define p(0)=1. For instance, p(5) = 7:

25 2.6. SPECIAL SEQUENCES OF INTEGERS Notation Notation These partitions of n are usefully pictured by Young diagrams. The conjugate partition is obtained by taing the mirror image in the main diagonal of the Young diagram. (Or in other words, consider columns instead of rows.) By considering (conjugate) Young diagrams this theorem is immediate. Theorem 2.2. The number of partions of n into exactly parts equals the number of partitions of n with largest part. We now define an ordinary generating function for p(n) Proposition. P (z) = 1 1 ; z P (z) =1+ p(n)z n : n2n 1 1 Y 1 ; z 2 1 ; z 3 = 2N 1 1 ; z : Proof. The RHS is (1 + z + z 2 + :::)(1 + z 2 + z 4 + :::)(1 + z 3 + z 6 :::) :::. We get a term z n whenever we select z a1 from the first bracet, z 2a2 from the second, z 3a3 from the third and so on, and n = a 1 +2a 2 +3a 3 + :::, or in other words 1 a1 2 a2 3 a3 ::: is a partition of n. There are p(n) of these. We can similarly prove these results. Proposition. The generating function P m (z) of the sequence p m (n) of partitions of n into at most m parts (or the generating function for the sequence p m (n) of partitions of n with largest part m) satisfies P m (z) = ; z 1 ; z 2 1 ; z ::: ; z m : Proposition. The generating function for the number of partitions into odd parts is 1 1 ; z ; z 3 1 ; z :::: 5 Proposition. The generating function for the number of partitions into unequal parts is (1 + z)(1 + z 2 )(1 + z 3 ) ::::

26 20 CHAPTER 2. INDUCTION AND COUNTING Theorem 2.3. The number of partitions of n into odd parts equals the number of partitions of n into unequal parts. Proof. (1 + z)(1 + z 2 )(1 + z 3 ) ::: = 1 ; z2 1 ; z = 1 1 ; z 1 ; z 4 1 ; z 6 1 ; z 2 1 ; z ::: ; z 3 1 ; z ::: 5 Theorem 2.4. The number of self-conjugate partitions of n equals the number of partitions of n into odd unequal parts. Proof. Consider hoos along the main diagonal lie this. This process can be reversed, so there is a one-to-one correspondance Generating function for self-conjugate partitions Observe that any self-conjugate partition consists of a largest subsquare and twice a partition of 1 2 (n ; 2 ) into at most parts. Now 1 (1 ; z 2 )(1 ; z 4 ) :::(1 ; z 2m ) is the generating function for partitions of n into even parts of size at most 2m, or alternatively the generating function for partitions of 1 n into parts of size m. We 2 deduce that z l (1 ; z 2 )(1 ; z 4 ) :::(1 ; z 2m ) is the generating function for partitions of 1 (n ; l) into at most m parts. Hence the 2 generating function for self-conjugate partitions is z 2 1+ (1 ; z 2N 2 )(1 ; z 4 ) :::(1 ; z 2 ) : Note also that this equals Y 2N 0 (1 + z 2+1 ) as the number of self-conjugate partitions of n equals the number of partitions of n into unequal odd parts. In fact in any partition we can consider the largest subsquare, leaving two partitions of at most parts, one of (n; 2 ;j), the other of j for some j. The number

27 2.6. SPECIAL SEQUENCES OF INTEGERS 21 Q of these two lots are the coefficients of z n;2 ;j and z j 1 in i=1 1;z respectively. i Thus z 2 P (z) =1+ 2N ((1 ; z)(1 ; z 2 ) :::(1 ; z : )) 2

28 22 CHAPTER 2. INDUCTION AND COUNTING

29 Chapter 3 Sets, Functions and Relations 3.1 Sets and indicator functions We fix some universal set S. We write P (S) for the set of all subsets of S the power set of S. IfS is finite with jsj = m (the number of elements), then jp (S)j =2 m. Given a subset A of S (A S) we define the complement A of A in S as A = fs 2 S : s=2 Ag. Given two subsets A, B of S we can define various operations to get new subsets of S. A \ B = fs 2 S : s 2 A and s 2 Bg A [ B = fs 2 S : s 2 A (inclusive) or s 2 Bg A n B = fs 2 A : s =2 Bg A B = fs 2 S : s 2 A (exclusive) or s 2 Bg =(A [ B) n (A \ B) =(AnB) [ (B n A): the symmetric difference The indicator function I A of the subset A of S is the function I A : S 7! f0 1g defined by ( 1 x 2 A I A (s) = 0 otherwise. It is also nown as the characteristic function A. Two subsets A and B of S are equal iff I A (s) =I B (s) 8s 2 S. These relations are fairly obvious: I A =1; I A I A\B = I A I B Proposition. A (B C) =(A B) C. I A[B = I A + I B I AB = I A + I B mod 2: 23

30 24 CHAPTER 3. SETS, FUNCTIONS AND RELATIONS Proof. For, modulo 2, I A(BC) = I A + I BC = I A + I B + I C = I AB + I C = I (AB)C mod 2: Thus P (S) is a group under. Checing the group axioms we get: Given A B 2 P (S), A B 2 P (S) closure, A (B C) =(A B) C associativity, A = A for all A 2 P (S) identity, A A = for all A 2 P (S) inverse. We note that A B = B A so that this group is abelian De Morgan s Laws Proposition. 1. A \ B = A [ B Proof. 2. A [ B = A \ B I A\B =1; I A\B =1; I A I B =(1; I A )+(1; I B ) ; (1 ; I A )(1 ; I B ) = I A + I B ; I A\ B = I A[ B: We prove 2 by using 1 on A and B. A more general version of this is: Suppose A 1 ::: A n S. Then 1. T n i=1 A i = S n i=1 A i 2. S n i=1 A i = T n i=1 A i. These can be proved by induction on n Inclusion-Exclusion P Principle Note that jaj = s2s I A(s). Theorem 3.1 (Principle of Inclusion-Exclusion). Given A 1 ::: A n S then ja 1 [[A n j = (;1) jjj;1 ja J j where A J = \ 6=Jf1 ::: ng i2j A i.

31 3.1. SETS AND INDICATOR FUNCTIONS 25 Proof. We consider A 1 [[A n and note that I A1[[A n = I A 1\\ A n = IA 1 IA 2 :::IA n =(1; I A1 )(1 ; I A2 ) :::(1 ; I An ) = Jf1 ::: ng Summing over s 2 S we obtain the result A1 [[A n = which is equivalent to the required result. (;1) jjj I AJ Jf1 ::: ng Just for the sae of it, we ll prove it again! (;1) jjj ja J j Proof. For each s 2 S we calculate the contribution. If s 2 S but s is in no A i then there is a contribution 1 to the left. The only contribution to the right is +1 when J =. If s 2 S and K = fi 2f1 ::: ng : s 2 A i g is non-empty then the contribution to the (;1) i =0, the same as on the left. right is P IK (;1)jIj = P i=0 ; i Example (Euler s Phi Function). (m) =m Y p prime pjm 1 ; 1 p Q n Solution. Let m = i=1 pai i, where the p i are distinct primes and a i 2 N. Let A i be the set of integers less than m which are divisible by p i. Hence (m) = T n i=1 A i. Now ja i j = m p i, in fact for J f1 ::: mg we have ja J j = Qi2J m. Thus pi : (m) =m ; m ; m ;; m p 1 p 2 p n + m + m + + m + + m p 1 p 2 p 1 p 3 p 2 p 3 p n;1 p n. +(;1) n m Y p 1 p 2 :::p n = m 1 ; 1 p p prime pjm as required. Example (Derangements). Suppose we have n psychologists at a meeting. Leaving the meeting they pic up their overcoats at random. In how many ways can this be done so that none of them has his own overcoat. This number is D n, the number of derangements of n objects.

32 26 CHAPTER 3. SETS, FUNCTIONS AND RELATIONS Solution. Let A i be the number of ways in which psychologist i collects his own coat. Then D n = A 1 \\ A n.ifj f1 ::: ng with jjj = then jaj j =(n ; )!. Thus A 1 \\ A n n n = n! ; (n ; 1)! + (n ; 2)! ; ::: 1 2 = n! n =0 (;1) :! Thus D n is the nearest integer to n! e ;1, since Dn n!! e ;1 as n! Functions Let A B be sets. A function (or mapping, or map) f : A 7! B is a way to associate a unique image f (a) 2 B with each a 2 A. IfA and B are finite with jaj = m and jbj = n then the set of all functions from A to B is finite with n m elements. Definition. The function f : A 7! B is injective (or one-to-one) if f (a 1 ) = f (a 2 ) implies that a 1 = a 2 for all a 1 a 2 2 A. The number of injective functions from an m-set to an n-set is n m. Definition. The function f : A 7! B is surjective (or onto) if each b 2 B has at least one preimage a 2 A. The number of surjective functions from an m-set to an n-set is n! S(m n). Definition. The function f : A 7! B is bijective if it is both injective and surjective. If A and B are finite then f : A 7! B can only be bijective if jaj = jbj. If jaj = jbj < 1 then any injection is a bijection; similarly any surjection is a bijection. There are n! bijections between two n-sets. If A and B are infinite then there exist injections which are not bijections and vice versa. For instance if A = B = N, define ( 1 n =1 f (n) = and g(n) =n +1: n ; 1 otherwise Then f is surjective but not injective and g is injective but not surjective. Proposition. n n n! S(m n) = (;1) (n ; ) m =0 Proof. This is another application of the Inclusion-Exclusion principle. Consider the set of functions from A to B with jaj = m and jbj = n. For any i 2 B, define i to be the set of functions avoiding i. So the set of surjections is 1 \\ n. Thus the number of surjections from A to B is 1 \\ n. By the inclusion-exclusion principle this is PJB (;1)jJj j J j. If jjj = then j J j =(n ; ) m. The result follows. Mappings can be composed. Given f : A 7! B and g : B 7! C we can define gf : A 7! C by gf(a) =g(f (a)). Iff and g are injective then so is gf, similarly for surjectivity. If we also have h : C 7! D, then associativity of composition is easily verified : (hg)f h(gf).

33 3.3. PERMUTATIONS Permutations A permutation of A is a bijection f : A 7! A. One notation is f = : The set of permutations of A is a group under composition, the symmetric group sym A. IfjAj = n then sym A is also denoted S n and jsym Aj = n!. S n is not abelian you can come up with a counterexample yourself. We can also thin of permutations as directed graphs, in which case the following becomes clear. Proposition. Any permutation is the product of disjoint cycles. We have a new notation for permutations, cycle notation. 1 above, we write For our function f f = (1)(2 3 4)(5 8)(6 7) = (2 3 4)(5 8)(6 7): Stirling numbers of the first ind Definition. s(n ) is the number of permutations of f1 ::: ng with precisely cycles (including fixed points). ; n For instance s(n n) = 1, s(n n ; 1) = 2, s(n 1) = (n ; 1)!, s(n 0) = s(0 )=0for all n 2 N but s(0 0) = 1. Lemma 3.1. s(n ) =s(n ; 1 ; 1)+(n ; 1)s(n ; 1 ) Proof. Either the point n is in a cycle on its own (s(n;1 ;1) such) or it is not. In this case, n can be inserted into any of n ; 1 places in any of the s(n ; 1 ) permutations of f1 ::: n; 1g. We can use this recurrence to prove this proposition. (Proof left as exercise.) Proposition. x n = s(n )x Transpositions and shuffles A transposition is a permutation which swaps two points and fixes the rest. Theorem 3.2. Every permutation is the product of transpositions. Proof. Since every permutations is the product of cycles we only need to chec for cycles. This is easy: (i 1 i 2 ::: i )=(i 1 i 2 )(i 2 i 3 ) :::(i ;1 i ). Theorem 3.3. For a given permutation, the number of transpositions used to write as their product is either always even or always odd. 1 See the Algebra and Geometry course for more details.

34 28 CHAPTER 3. SETS, FUNCTIONS AND RELATIONS ( +1 if always even even We write sign =. We say that is an ;1 if always odd odd permutation. Let c() be the number of cycles in the disjoint cycle representation of (including fixed points). Lemma 3.2. If =(a b) is a transposition that c() =c() 1. Proof. If a and b are in the same cycle of then has two cycles, so c() = c()+1.ifa and b are in different cycles then they contract them together and c() = c() ; 1. Proof of theorem 3.3. Assume = 1 ::: = 1 ::: l. Then c() =c() + c() +l (mod 2). Hence l (mod 2) as required. We note that sign = (;1) n;c(), thus sign( 1 2 ) = sign 1 sign 2 and thus sign is a homomorphism from S n to f1g. A -cycle is an even permutation iff is odd. A permutation is an even permutation iff the number of even length cycles in the disjoint cycle representation is odd even odd Order of a permutation If is a permutation then the order of is the least natural number n such that n =. The order of the permutation is the lcm of the lengths of the cycles in the disjoint cycle decomposition of. In card shuffling we need to maximise the order of the relevant permutation. One can show (see) that for of maximal length we can tae all the cycles in the disjoint cycle representation to have prime power length. For instance with 30 cards we can get a 2 S 30 with an order of 4620 (cycle type ) Conjugacy classes in Sn Two permutations 2 S n are conjugate iff 9 2 S n such that = ;1. Theorem 3.4. Two permutations are conjugate iff they have the same cycle type. This theorem is proved in the Algebra and Geometry course. We note the corollary that the number of conjugacy classes in S n equals the number of partitions of n Determinants of an n n matrix In the Linear Maths course you will prove that if A =(a ij ) is an n n matrix then det A = 2S n sign ny j=1 a j(j) :

35 3.4. BINARY RELATIONS Binary Relations A binary relation on a set S is a property that any pair of elements of S may or may not have. More precisely: Write S S, the Cartesian square of S for the set of pairs of elements of S, S S = f(a b) :a b 2 Sg. A binary relation R on S is a subset of S S. We write a R b iff (a b) 2R. We can thin of R as a directed graph with an edge from a to b iff a R b. A relation R is: reflexive iff a R a 8a 2 S, symmetric iff a R b ) b R a 8a b 2 S, transitive iff a R b b R c ) a R c 8a b c 2 S, antisymmetric iff a R b b R a ) a = b 8a b 2 S. The relation R on S is an equivalence relation if it is reflexive, symmetric and transitive. These are nice properties designed to mae R behave something lie =. Definition. If R is a relation on S, then [a]r =[a] =fb 2 S : a R bg: If R is an equivalence then these are the equivalence classes. Theorem 3.5. If R is an equivalence relation then the equivalence classes form a partition of S. Proof. If a 2 S then a 2 [a], so the classes cover all of S. If [a] \ [b] 6= then 9c 2 [a] \ [b]. Nowa R c and b R c ) c R b. Thus a R b and b 2 [a]. Ifd 2 [b] then b R d so a R d and thus [b] [a]. We can similarly show that [a] [b] and thus [a] =[b]. The converse of this is true: if we have a partition of S we can define an equivalence relation on S by a R b iff a and b are in the same part. An application of this is the proof of Lagrange s Theorem. The idea is to show that being in the same (left/right) coset is an equivalence relation. Given an equivalence class on S the quotient set is S=R, the set of all equivalence classes. For instance if S = R and a R b iff a ; b 2 Z then S=R is (topologically) a circle. If S = R 2 and (a 1 b 1 ) R (a 2 b 2 ) iff a 1 ; a 2 2 Z and b 1 ; b 2 2 Z the quotient set is a torus. Returning to a general relation R, for each 2 N we define R () = f(a b) :there is a path of length at from a to bg: R (1) = R and R (1) = S t(r), the transitive closure of R. R (1) is defined as i1 R(i).

Discrete Mathematics. Dr. J. Saxl. Michælmas These notes are maintained by Paul Metcalfe. Comments and corrections to

Discrete Mathematics. Dr. J. Saxl. Michælmas These notes are maintained by Paul Metcalfe. Comments and corrections to Discrete Mathematics Dr. J. Saxl Michælmas 1995 These notes are maintained by Paul Metcalfe. Comments and corrections to pdm23@cam.ac.u. Revision: 2.5 Date: 2004/07/26 07:20:10 The following people have

More information

1 Basic Combinatorics

1 Basic Combinatorics 1 Basic Combinatorics 1.1 Sets and sequences Sets. A set is an unordered collection of distinct objects. The objects are called elements of the set. We use braces to denote a set, for example, the set

More information

Part IA Numbers and Sets

Part IA Numbers and Sets Part IA Numbers and Sets Definitions Based on lectures by A. G. Thomason Notes taken by Dexter Chua Michaelmas 2014 These notes are not endorsed by the lecturers, and I have modified them (often significantly)

More information

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2000 2013 Contents 9 Introduction to Number Theory 63 9.1 Subgroups

More information

Chapter 1 : The language of mathematics.

Chapter 1 : The language of mathematics. MAT 200, Logic, Language and Proof, Fall 2015 Summary Chapter 1 : The language of mathematics. Definition. A proposition is a sentence which is either true or false. Truth table for the connective or :

More information

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2006 Contents 9 Introduction to Number Theory and Cryptography 1 9.1 Subgroups

More information

Part IA Numbers and Sets

Part IA Numbers and Sets Part IA Numbers and Sets Theorems Based on lectures by A. G. Thomason Notes taken by Dexter Chua Michaelmas 2014 These notes are not endorsed by the lecturers, and I have modified them (often significantly)

More information

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations Page 1 Definitions Tuesday, May 8, 2018 12:23 AM Notations " " means "equals, by definition" the set of all real numbers the set of integers Denote a function from a set to a set by Denote the image of

More information

0 Sets and Induction. Sets

0 Sets and Induction. Sets 0 Sets and Induction Sets A set is an unordered collection of objects, called elements or members of the set. A set is said to contain its elements. We write a A to denote that a is an element of the set

More information

are the q-versions of n, n! and . The falling factorial is (x) k = x(x 1)(x 2)... (x k + 1).

are the q-versions of n, n! and . The falling factorial is (x) k = x(x 1)(x 2)... (x k + 1). Lecture A jacques@ucsd.edu Notation: N, R, Z, F, C naturals, reals, integers, a field, complex numbers. p(n), S n,, b(n), s n, partition numbers, Stirling of the second ind, Bell numbers, Stirling of the

More information

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers ALGEBRA CHRISTIAN REMLING 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers by Z = {..., 2, 1, 0, 1,...}. Given a, b Z, we write a b if b = ac for some

More information

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Lecture Notes 1 Basic Concepts of Mathematics MATH 352 Ivan Avramidi New Mexico Institute of Mining and Technology Socorro, NM 87801 June 3, 2004 Author: Ivan Avramidi; File: absmath.tex; Date: June 11,

More information

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations D. R. Wilkins Academic Year 1996-7 1 Number Systems and Matrix Algebra Integers The whole numbers 0, ±1, ±2, ±3, ±4,...

More information

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws Index absolute value, 135 141 additive identity, 254 additive inverse, 254 aleph, 465 algebra of sets, 245, 278 antisymmetric relation, 387 arcsine function, 349 arithmetic sequence, 208 arrow diagram,

More information

Chapter 3. Rings. The basic commutative rings in mathematics are the integers Z, the. Examples

Chapter 3. Rings. The basic commutative rings in mathematics are the integers Z, the. Examples Chapter 3 Rings Rings are additive abelian groups with a second operation called multiplication. The connection between the two operations is provided by the distributive law. Assuming the results of Chapter

More information

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively 6 Prime Numbers Part VI of PJE 6.1 Fundamental Results Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively D (p) = { p 1 1 p}. Otherwise

More information

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr. Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr. Chapter : Logic Topics:. Statements, Negation, and Compound Statements.2 Truth Tables and Logical Equivalences.3

More information

MAT115A-21 COMPLETE LECTURE NOTES

MAT115A-21 COMPLETE LECTURE NOTES MAT115A-21 COMPLETE LECTURE NOTES NATHANIEL GALLUP 1. Introduction Number theory begins as the study of the natural numbers the integers N = {1, 2, 3,...}, Z = { 3, 2, 1, 0, 1, 2, 3,...}, and sometimes

More information

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

2 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 information

Part IA. Numbers and Sets. Year

Part IA. Numbers and Sets. Year Part IA Year 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2004 2003 2002 2001 2017 19 Paper 4, Section I 1D (a) Show that for all positive integers z and n, either z 2n 0 (mod 3) or

More information

PRIME NUMBERS YANKI LEKILI

PRIME NUMBERS YANKI LEKILI PRIME NUMBERS YANKI LEKILI We denote by N the set of natural numbers: 1,2,..., These are constructed using Peano axioms. We will not get into the philosophical questions related to this and simply assume

More information

Course 2316 Sample Paper 1

Course 2316 Sample Paper 1 Course 2316 Sample Paper 1 Timothy Murphy April 19, 2015 Attempt 5 questions. All carry the same mark. 1. State and prove the Fundamental Theorem of Arithmetic (for N). Prove that there are an infinity

More information

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

INTEGERS. 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 information

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

This 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 information

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime. PUTNAM TRAINING NUMBER THEORY (Last updated: December 11, 2017) Remark. This is a list of exercises on Number Theory. Miguel A. Lerma Exercises 1. Show that the sum of two consecutive primes is never twice

More information

Lecture 6: Introducing Complexity

Lecture 6: Introducing Complexity COMP26120: Algorithms and Imperative Programming Lecture 6: Introducing Complexity Ian Pratt-Hartmann Room KB2.38: email: ipratt@cs.man.ac.uk 2015 16 You need this book: Make sure you use the up-to-date

More information

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2 8. p-adic numbers 8.1. Motivation: Solving x 2 a (mod p n ). Take an odd prime p, and ( an) integer a coprime to p. Then, as we know, x 2 a (mod p) has a solution x Z iff = 1. In this case we can suppose

More information

Notation Index. gcd(a, b) (greatest common divisor) NT-16

Notation Index. gcd(a, b) (greatest common divisor) NT-16 Notation Index (for all) B A (all functions) B A = B A (all functions) SF-18 (n) k (falling factorial) SF-9 a R b (binary relation) C(n,k) = n! k! (n k)! (binomial coefficient) SF-9 n! (n factorial) SF-9

More information

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31 Contents 1 Lecture 1: Introduction 2 2 Lecture 2: Logical statements and proof by contradiction 7 3 Lecture 3: Induction and Well-Ordering Principle 11 4 Lecture 4: Definition of a Group and examples 15

More information

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel Lecture Notes on DISCRETE MATHEMATICS Eusebius Doedel c Eusebius J. Doedel, 009 Contents Logic. Introduction............................................................................... Basic logical

More information

A Guide to Arithmetic

A Guide to Arithmetic A Guide to Arithmetic Robin Chapman August 5, 1994 These notes give a very brief resumé of my number theory course. Proofs and examples are omitted. Any suggestions for improvements will be gratefully

More information

Chapter 5. Number Theory. 5.1 Base b representations

Chapter 5. Number Theory. 5.1 Base b representations Chapter 5 Number Theory The material in this chapter offers a small glimpse of why a lot of facts that you ve probably nown and used for a long time are true. It also offers some exposure to generalization,

More information

Foundations Revision Notes

Foundations Revision Notes oundations Revision Notes hese notes are designed as an aid not a substitute for revision. A lot of proofs have not been included because you should have them in your notes, should you need them. Also,

More information

Algebraic structures I

Algebraic structures I MTH5100 Assignment 1-10 Algebraic structures I For handing in on various dates January March 2011 1 FUNCTIONS. Say which of the following rules successfully define functions, giving reasons. For each one

More information

1 Overview and revision

1 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 information

Rings and Fields Theorems

Rings and Fields Theorems Rings and Fields Theorems Rajesh Kumar PMATH 334 Intro to Rings and Fields Fall 2009 October 25, 2009 12 Rings and Fields 12.1 Definition Groups and Abelian Groups Let R be a non-empty set. Let + and (multiplication)

More information

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya BBM 205 Discrete Mathematics Hacettepe University http://web.cs.hacettepe.edu.tr/ bbm205 Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya Resources: Kenneth Rosen,

More information

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

CHAPTER 6. Prime Numbers. Definition and Fundamental Results CHAPTER 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results 6.1. Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and the only positive divisors of p are 1 and p. If n

More information

Introduction to Number Theory

Introduction to Number Theory INTRODUCTION Definition: Natural Numbers, Integers Natural numbers: N={0,1,, }. Integers: Z={0,±1,±, }. Definition: Divisor If a Z can be writeen as a=bc where b, c Z, then we say a is divisible by b or,

More information

Chapter 8. P-adic numbers. 8.1 Absolute values

Chapter 8. P-adic numbers. 8.1 Absolute values Chapter 8 P-adic numbers Literature: N. Koblitz, p-adic Numbers, p-adic Analysis, and Zeta-Functions, 2nd edition, Graduate Texts in Mathematics 58, Springer Verlag 1984, corrected 2nd printing 1996, Chap.

More information

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms

REVIEW QUESTIONS. Chapter 1: Foundations: Sets, Logic, and Algorithms REVIEW QUESTIONS Chapter 1: Foundations: Sets, Logic, and Algorithms 1. Why can t a Venn diagram be used to prove a statement about sets? 2. Suppose S is a set with n elements. Explain why the power set

More information

D-MATH Algebra I HS 2013 Prof. Brent Doran. Solution 3. Modular arithmetic, quotients, product groups

D-MATH Algebra I HS 2013 Prof. Brent Doran. Solution 3. Modular arithmetic, quotients, product groups D-MATH Algebra I HS 2013 Prof. Brent Doran Solution 3 Modular arithmetic, quotients, product groups 1. Show that the functions f = 1/x, g = (x 1)/x generate a group of functions, the law of composition

More information

Chapter 1. Sets and Numbers

Chapter 1. Sets and Numbers Chapter 1. Sets and Numbers 1. Sets A set is considered to be a collection of objects (elements). If A is a set and x is an element of the set A, we say x is a member of A or x belongs to A, and we write

More information

NOTES ON FINITE FIELDS

NOTES ON FINITE FIELDS NOTES ON FINITE FIELDS AARON LANDESMAN CONTENTS 1. Introduction to finite fields 2 2. Definition and constructions of fields 3 2.1. The definition of a field 3 2.2. Constructing field extensions by adjoining

More information

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth Sets We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth century. Most students have seen sets before. This is intended

More information

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is 1. Describe the elements of the set (Z Q) R N. Is this set countable or uncountable? Solution: The set is equal to {(x, y) x Z, y N} = Z N. Since the Cartesian product of two denumerable sets is denumerable,

More information

MATH 215 Sets (S) Definition 1 A set is a collection of objects. The objects in a set X are called elements of X.

MATH 215 Sets (S) Definition 1 A set is a collection of objects. The objects in a set X are called elements of X. MATH 215 Sets (S) Definition 1 A set is a collection of objects. The objects in a set X are called elements of X. Notation 2 A set can be described using set-builder notation. That is, a set can be described

More information

MATH 326: RINGS AND MODULES STEFAN GILLE

MATH 326: RINGS AND MODULES STEFAN GILLE MATH 326: RINGS AND MODULES STEFAN GILLE 1 2 STEFAN GILLE 1. Rings We recall first the definition of a group. 1.1. Definition. Let G be a non empty set. The set G is called a group if there is a map called

More information

Basic elements of number theory

Basic 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 information

Basic elements of number theory

Basic 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 information

4 PRIMITIVE ROOTS Order and Primitive Roots The Index Existence of primitive roots for prime modulus...

4 PRIMITIVE ROOTS Order and Primitive Roots The Index Existence of primitive roots for prime modulus... PREFACE These notes have been prepared by Dr Mike Canfell (with minor changes and extensions by Dr Gerd Schmalz) for use by the external students in the unit PMTH 338 Number Theory. This booklet covers

More information

Instructor: Bobby Kleinberg Lecture Notes, 25 April The Miller-Rabin Randomized Primality Test

Instructor: Bobby Kleinberg Lecture Notes, 25 April The Miller-Rabin Randomized Primality Test Introduction to Algorithms (CS 482) Cornell University Instructor: Bobby Kleinberg Lecture Notes, 25 April 2008 The Miller-Rabin Randomized Primality Test 1 Introduction Primality testing is an important

More information

8 Primes and Modular Arithmetic

8 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 information

Contest Number Theory

Contest Number Theory Contest Number Theory Andre Kessler December 7, 2008 Introduction Number theory is one of the core subject areas of mathematics. It can be somewhat loosely defined as the study of the integers. Unfortunately,

More information

MATH 363: Discrete Mathematics

MATH 363: Discrete Mathematics MATH 363: Discrete Mathematics Learning Objectives by topic The levels of learning for this class are classified as follows. 1. Basic Knowledge: To recall and memorize - Assess by direct questions. The

More information

Fundamentals of Pure Mathematics - Problem Sheet

Fundamentals of Pure Mathematics - Problem Sheet Fundamentals of Pure Mathematics - Problem Sheet ( ) = Straightforward but illustrates a basic idea (*) = Harder Note: R, Z denote the real numbers, integers, etc. assumed to be real numbers. In questions

More information

7. Prime Numbers Part VI of PJE

7. Prime Numbers Part VI of PJE 7. Prime Numbers Part VI of PJE 7.1 Definition (p.277) A positive integer n is prime when n > 1 and the only divisors are ±1 and +n. That is D (n) = { n 1 1 n}. Otherwise n > 1 is said to be composite.

More information

Contribution of Problems

Contribution of Problems Exam topics 1. Basic structures: sets, lists, functions (a) Sets { }: write all elements, or define by condition (b) Set operations: A B, A B, A\B, A c (c) Lists ( ): Cartesian product A B (d) Functions

More information

INFINITY: CARDINAL NUMBERS

INFINITY: CARDINAL NUMBERS INFINITY: CARDINAL NUMBERS BJORN POONEN 1 Some terminology of set theory N := {0, 1, 2, 3, } Z := {, 2, 1, 0, 1, 2, } Q := the set of rational numbers R := the set of real numbers C := the set of complex

More information

Week Some Warm-up Questions

Week Some Warm-up Questions 1 Some Warm-up Questions Week 1-2 Abstraction: The process going from specific cases to general problem. Proof: A sequence of arguments to show certain conclusion to be true. If... then... : The part after

More information

2) e = e G G such that if a G 0 =0 G G such that if a G e a = a e = a. 0 +a = a+0 = a.

2) e = e G G such that if a G 0 =0 G G such that if a G e a = a e = a. 0 +a = a+0 = a. Chapter 2 Groups Groups are the central objects of algebra. In later chapters we will define rings and modules and see that they are special cases of groups. Also ring homomorphisms and module homomorphisms

More information

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. Chapter 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p. If n > 1

More information

2. Prime and Maximal Ideals

2. Prime and Maximal Ideals 18 Andreas Gathmann 2. Prime and Maximal Ideals There are two special kinds of ideals that are of particular importance, both algebraically and geometrically: the so-called prime and maximal ideals. Let

More information

Mathematical Reasoning & Proofs

Mathematical Reasoning & Proofs Mathematical Reasoning & Proofs MAT 1362 Fall 2018 Alistair Savage Department of Mathematics and Statistics University of Ottawa This work is licensed under a Creative Commons Attribution-ShareAlike 4.0

More information

Math 511, Algebraic Systems, Fall 2017 July 20, 2017 Edition. Todd Cochrane

Math 511, Algebraic Systems, Fall 2017 July 20, 2017 Edition. Todd Cochrane Math 511, Algebraic Systems, Fall 2017 July 20, 2017 Edition Todd Cochrane Department of Mathematics Kansas State University Contents Notation v Chapter 0. Axioms for the set of Integers Z. 1 Chapter 1.

More information

MATH 361: NUMBER THEORY FOURTH LECTURE

MATH 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 information

A connection between number theory and linear algebra

A connection between number theory and linear algebra A connection between number theory and linear algebra Mark Steinberger Contents 1. Some basics 1 2. Rational canonical form 2 3. Prime factorization in F[x] 4 4. Units and order 5 5. Finite fields 7 6.

More information

6 Cosets & Factor Groups

6 Cosets & Factor Groups 6 Cosets & Factor Groups The course becomes markedly more abstract at this point. Our primary goal is to break apart a group into subsets such that the set of subsets inherits a natural group structure.

More information

Mathematics for Cryptography

Mathematics for Cryptography Mathematics for Cryptography Douglas R. Stinson David R. Cheriton School of Computer Science University of Waterloo Waterloo, Ontario, N2L 3G1, Canada March 15, 2016 1 Groups and Modular Arithmetic 1.1

More information

Beautiful Mathematics

Beautiful Mathematics Beautiful Mathematics 1. Principle of Mathematical Induction The set of natural numbers is the set of positive integers {1, 2, 3,... } and is denoted by N. The Principle of Mathematical Induction is a

More information

In N we can do addition, but in order to do subtraction we need to extend N to the integers

In N we can do addition, but in order to do subtraction we need to extend N to the integers Chapter 1 The Real Numbers 1.1. Some Preliminaries Discussion: The Irrationality of 2. We begin with the natural numbers N = {1, 2, 3, }. In N we can do addition, but in order to do subtraction we need

More information

MATH 2112/CSCI 2112, Discrete Structures I Winter 2007 Toby Kenney Homework Sheet 5 Hints & Model Solutions

MATH 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 information

In N we can do addition, but in order to do subtraction we need to extend N to the integers

In N we can do addition, but in order to do subtraction we need to extend N to the integers Chapter The Real Numbers.. Some Preliminaries Discussion: The Irrationality of 2. We begin with the natural numbers N = {, 2, 3, }. In N we can do addition, but in order to do subtraction we need to extend

More information

Proof Techniques (Review of Math 271)

Proof Techniques (Review of Math 271) Chapter 2 Proof Techniques (Review of Math 271) 2.1 Overview This chapter reviews proof techniques that were probably introduced in Math 271 and that may also have been used in a different way in Phil

More information

MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM

MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM MATH 61-02: PRACTICE PROBLEMS FOR FINAL EXAM (FP1) The exclusive or operation, denoted by and sometimes known as XOR, is defined so that P Q is true iff P is true or Q is true, but not both. Prove (through

More information

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel LECTURE NOTES on DISCRETE MATHEMATICS Eusebius Doedel 1 LOGIC Introduction. First we introduce some basic concepts needed in our discussion of logic. These will be covered in more detail later. A set is

More information

The Symmetric Groups

The Symmetric Groups Chapter 7 The Symmetric Groups 7. Introduction In the investigation of finite groups the symmetric groups play an important role. Often we are able to achieve a better understanding of a group if we can

More information

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1).

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1). 1 Background 1.1 The group of units MAT 3343, APPLIED ALGEBRA, FALL 2003 Handout 3: The RSA Cryptosystem Peter Selinger Let (R, +, ) be a ring. Then R forms an abelian group under addition. R does not

More information

2 Generating Functions

2 Generating Functions 2 Generating Functions In this part of the course, we re going to introduce algebraic methods for counting and proving combinatorial identities. This is often greatly advantageous over the method of finding

More information

ERRATA. Abstract Algebra, Third Edition by D. Dummit and R. Foote (most recently revised on March 4, 2009)

ERRATA. Abstract Algebra, Third Edition by D. Dummit and R. Foote (most recently revised on March 4, 2009) ERRATA Abstract Algebra, Third Edition by D. Dummit and R. Foote (most recently revised on March 4, 2009) These are errata for the Third Edition of the book. Errata from previous editions have been fixed

More information

Part II. Number Theory. Year

Part II. Number Theory. Year Part II Year 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2017 Paper 3, Section I 1G 70 Explain what is meant by an Euler pseudoprime and a strong pseudoprime. Show that 65 is an Euler

More information

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z:

NUMBER SYSTEMS. Number theory is the study of the integers. We denote the set of integers by Z: NUMBER SYSTEMS Number theory is the study of the integers. We denote the set of integers by Z: Z = {..., 3, 2, 1, 0, 1, 2, 3,... }. The integers have two operations defined on them, addition and multiplication,

More information

Math 120 HW 9 Solutions

Math 120 HW 9 Solutions Math 120 HW 9 Solutions June 8, 2018 Question 1 Write down a ring homomorphism (no proof required) f from R = Z[ 11] = {a + b 11 a, b Z} to S = Z/35Z. The main difficulty is to find an element x Z/35Z

More information

FROM GROUPS TO GALOIS Amin Witno

FROM GROUPS TO GALOIS Amin Witno WON Series in Discrete Mathematics and Modern Algebra Volume 6 FROM GROUPS TO GALOIS Amin Witno These notes 1 have been prepared for the students at Philadelphia University (Jordan) who are taking the

More information

MATH 310 Course Objectives

MATH 310 Course Objectives MATH 310 Course Objectives Upon successful completion of MATH 310, the student should be able to: Apply the addition, subtraction, multiplication, and division principles to solve counting problems. Apply

More information

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant).

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant). Sets and Functions 1. The language of sets Informally, a set is any collection of objects. The objects may be mathematical objects such as numbers, functions and even sets, or letters or symbols of any

More information

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction

Math 324 Summer 2012 Elementary Number Theory Notes on Mathematical Induction Math 4 Summer 01 Elementary Number Theory Notes on Mathematical Induction Principle of Mathematical Induction Recall the following axiom for the set of integers. Well-Ordering Axiom for the Integers If

More information

RMT 2013 Power Round Solutions February 2, 2013

RMT 2013 Power Round Solutions February 2, 2013 RMT 013 Power Round Solutions February, 013 1. (a) (i) {0, 5, 7, 10, 11, 1, 14} {n N 0 : n 15}. (ii) Yes, 5, 7, 11, 16 can be generated by a set of fewer than 4 elements. Specifically, it is generated

More information

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...}

WORKSHEET ON NUMBERS, MATH 215 FALL. We start our study of numbers with the integers: N = {1, 2, 3,...} WORKSHEET ON NUMBERS, MATH 215 FALL 18(WHYTE) We start our study of numbers with the integers: Z = {..., 2, 1, 0, 1, 2, 3,... } and their subset of natural numbers: N = {1, 2, 3,...} For now we will not

More information

8. Prime Factorization and Primary Decompositions

8. Prime Factorization and Primary Decompositions 70 Andreas Gathmann 8. Prime Factorization and Primary Decompositions 13 When it comes to actual computations, Euclidean domains (or more generally principal ideal domains) are probably the nicest rings

More information

ECEN 5022 Cryptography

ECEN 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 information

D-MATH Algebra I HS18 Prof. Rahul Pandharipande. Solution 1. Arithmetic, Zorn s Lemma.

D-MATH Algebra I HS18 Prof. Rahul Pandharipande. Solution 1. Arithmetic, Zorn s Lemma. D-MATH Algebra I HS18 Prof. Rahul Pandharipande Solution 1 Arithmetic, Zorn s Lemma. 1. (a) Using the Euclidean division, determine gcd(160, 399). (b) Find m 0, n 0 Z such that gcd(160, 399) = 160m 0 +

More information

Modular Arithmetic and Elementary Algebra

Modular Arithmetic and Elementary Algebra 18.310 lecture notes September 2, 2013 Modular Arithmetic and Elementary Algebra Lecturer: Michel Goemans These notes cover basic notions in algebra which will be needed for discussing several topics of

More information

MATH FINAL EXAM REVIEW HINTS

MATH FINAL EXAM REVIEW HINTS MATH 109 - FINAL EXAM REVIEW HINTS Answer: Answer: 1. Cardinality (1) Let a < b be two real numbers and define f : (0, 1) (a, b) by f(t) = (1 t)a + tb. (a) Prove that f is a bijection. (b) Prove that any

More information

Summary Slides for MATH 342 June 25, 2018

Summary Slides for MATH 342 June 25, 2018 Summary Slides for MATH 342 June 25, 2018 Summary slides based on Elementary Number Theory and its applications by Kenneth Rosen and The Theory of Numbers by Ivan Niven, Herbert Zuckerman, and Hugh Montgomery.

More information

1. multiplication is commutative and associative;

1. multiplication is commutative and associative; Chapter 4 The Arithmetic of Z In this chapter, we start by introducing the concept of congruences; these are used in our proof (going back to Gauss 1 ) that every integer has a unique prime factorization.

More information

The integers. Chapter 3

The integers. Chapter 3 Chapter 3 The integers Recall that an abelian group is a set A with a special element 0, and operation + such that x +0=x x + y = y + x x +y + z) =x + y)+z every element x has an inverse x + y =0 We also

More information

Math 2070BC Term 2 Weeks 1 13 Lecture Notes

Math 2070BC Term 2 Weeks 1 13 Lecture Notes Math 2070BC 2017 18 Term 2 Weeks 1 13 Lecture Notes Keywords: group operation multiplication associative identity element inverse commutative abelian group Special Linear Group order infinite order cyclic

More information

Rings. Chapter 1. Definition 1.2. A commutative ring R is a ring in which multiplication is commutative. That is, ab = ba for all a, b R.

Rings. Chapter 1. Definition 1.2. A commutative ring R is a ring in which multiplication is commutative. That is, ab = ba for all a, b R. Chapter 1 Rings We have spent the term studying groups. A group is a set with a binary operation that satisfies certain properties. But many algebraic structures such as R, Z, and Z n come with two binary

More information

Discrete Mathematics GCD, LCM, RSA Algorithm

Discrete 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 information