advertisement

I \342\200\242!\342\200\242 * I i i \342\200\242 I \342\200\242 \342\200\242 : i i : i i \\ 1*1 \342\200\242 \302\253 i i \342\200\242 I \342\200\242 I \342\200\242 i \\ / Mathematics Topic Level Higher 10 - Option: Discrete Mathematics for the Paul Ben Fannon, Woolley IB Diploma Vesna Kadelburg, and Stephen Ward CAMBRIDGE UNIVERSITY PRESS Cambridge, New Mexico Delhi, Cape Town, Madrid, Melbourne, York, Singapore, SaoPaulo, Cambridge PRESS UNIVERSITY CAMBRIDGE City Press University Building, Cambridge CB28RU, The Edinburgh UK www.cambridge.org Information on \302\251 is in publication www.cambridge.org/9781107666948 Press 2013 University Cambridge This title: this Subject to copyright. provisions of relevant no reproduction of any part may and to the permission First in Poland the without written Press. by Opolgraf this ISBN 978-1-107-66694-8 Cambridge exception agreements, 2013 A catalogue recordfor Coverimage: statutory licensing take place of Cambridge University published Printed collective is available publication from the British Library Paperback Thinkstock University accuracy of URLs for Press has no external for responsibility or third-party internet the persistence websites referred or to in this publication, and does not guarantee that any content on such websites is, or will remain, accurate or appropriate. Information regarding prices, travel in this work is correct at timetables and other factual information given the time of first printing but Cambridge University Press does not guarantee the accuracyof such information thereafter. NOTICE TO TEACHERS and copies of them remain such copies may not be distributed Worksheets and purchasing institution. copyright of Cambridge University or used in any way outside the in the Press Contents this book How to use v viii Acknowledgements 1 Introduction Proof 3 of proof Methods 1 4 contradiction by 6 principle Pigeonhole 9 Strong induction Divisibilityand prime Factors, multiples The Euclidean Bl Prime 13 and remainders J3 Greatestcommondivisor I 13 numbers least and common multiple 23 algorithm 26 numbers Representation of integers in differentbases How fingers many Arithmetic Linear in need to do we between Changing different 2J Solutions 5 general Introduction: working with Rules of modular arithmetic and 19 Chinese linear remainders congruences remainder theorem little theorem solutions 42 44 47 51 arithmetic Division 42 46 solution subject to constraints Modular Fermat's integer solutions are there? the 33 36 equations with 33 35 bases Examplesof equations Finding count? bases different Diophantine How many 19 51 53 56 59 62 Contents \342\200\242 it*' ^ q, \302\243^% 6 67 theory Graph to graphs |#EJ Introduction E3 Definitions EW Some 67 69 important theorems 79 and complements 85 a graph 87 E\302\243J Subgraphs around [\342\200\24213 Moving m Eulerian graphs 89 C2I Hamiltonian 93 7 graphs on Algorithms 98 graphs 98 UJ Weighted graphs Q3 Minimum Ed Finding the shortest path: Dijkstra's Q3 Travelling Q3 Visiting 8 Recurrence relations spanning First Kruskal's 102 106 algorithm algorithm edges: Chinesepostmanproblem vertices: Travelling salesman problem along all the all the sequences |*\302\243J Defining Q3 tree: order linear 134 relations 136 (?9 Second order recurrencerelations |Jl\302\243JModelling 9 Summary using recurrence 118 134 recursively recurrence 112 139 143 relations and mixed examination practice 149 Answers 158 Glossary 172 Index Contents 177 N VT book book the of -+Q,f\302\261\342\200\236 this use to How Structure 7~^>-T iHK This book coversallthe material for Option) of the HigherLevel Mathematics 10 (Discrete Topic 1h for the International Baccalaureate course.It is largely of the independent syllabus from the Core topics,soit can be studied at any point during the course.The only required of the core are proof by induction and and series 1.4) Topic sequences (Syllabus (Syllabus the material that will be examinable. 1.1). We have tried to includein the main text only Mathematics material parts Topic There aremany interesting highlight some of thesein The is split book into three order the in given, covered first. with many practice, Each chapter starts perspective' and we have tried to beyond the syllabus and 'Research explorer'boxes. blocks. Chapters 2 to 5 covernumbertheory, of each that are required throughout the a summary of all the topicsand further of the questionsmixingseveraltopics- a trick favourite are best other. Chapter proof 9 contains Chapter each block within independent 7 graph 6 and chapters The chapters relations. recurrence three blocks arelargely but the introduces somemethodsofmathematical shouldbe ideas that go another 'From and theory and chapter8 sequences studied and applications the in IB 1 course, and examination * examinations. an idea about what the chapter give you start of the what problem topicthat illustrates introductory you should be able to do after you have completed the topic. You should not expectto be able to solve the at the but want to think about possible strategiesand what sort of new facts start, problem you may and methods would helpyou. The solution to the introductory problem is providedat the end of contains.Thereis the topic, a list with objectives to of learning at the an at the start of chapter9. Key point boxes The most important ideas formulae are given in the are emphasisedin the 'KEY the Formulabooklet,there will the Formula booklet and you are not in formulae to derive and formulae be an icon: may need ; if to learn the When boxes. POINT' this icon is not present,then them or at least know how them. Worked examples Eachworkedexample is split into the example Sometimes you an idea of what two is required to scorefull is about muchmorethan On the columns. right is what might include more detail then you and examinations method marks remembering strictly you shouldwrite need, in examinations. methods. down. is designed to give However, mathematics but it So, on the left of the worked and suggest which routeyou should use with exercise that differ from hope help you questions any the worked examples. It is very deliberatethat some of the questions require you to do morethan in the worked examples.Mathematicsis about thinking! the methods repeat examples are notes that tackle the question. We \342\200\242 the describe that thought these will processes How to use to this book ,' ' v lrsM VS. fy * Signposts boxes that appear several are There \302\243 throughout the book. Theory of knowledge issues is a lesson Every be but this Theory of knowledgelesson,but is frequently used as an Mathematics obvious. is often not the case.In these ambiguities links to other mathematics links the exampleof certainty may not and ^ truth, will try to highlight some of the as wellas showinghow we boxes in mathematics and weaknesses sometimes /f areas of knowledge. From another perspective as highlighting well these also boxes *>\302\245 historical, look pragmatic Research \\ \\ looking at things in different ways. differences between mathematicians at other perspectives on the mathematics we are covering: and cultural. Baccalaureate\302\256 encourages International The As some international explorer askedto write a report on a mathematical as topicofyour choice. It is sometimes difficult to know which topicsaresuitable a basis for such reports, and so we have tried to show where a topic can actas a ideas for an Extended point for further work. This can alsogive jumping-off you out there! essay. Thereis a lot of greatmathematics As of your part course, you will be hint Exam we would Although learning in order encourageyou to think as more than there are somecommonerrors an examination, to pass of mathematics just it is to be awareof. If thereisa commonpitfall we will try to highlight it in these boxes. We also point out where graphical calculators can be used to simplify a question or speed up your work. effectively for you useful L / rewind forward Fast T^> Mathematicsis all about makinglinks.You ^. something you <s may need to go have learned just back and indicate connectionswith will be remind yourself other sections might be interested to see how used elsewherein the course,or you of a previous topic. These boxes of the book to help you find your way around. How to use the questions Calculatoricon / to use a graphical calculatorin the final examination paper for this Option. Somequestions can be done in a particularly cleverway by one of the graphical calculator functions.However, we recommend that using the aid of a calculator. These questions you try to answer some questionswithout You will be allowed are marked with x? vi rsM How to use this book a non-calculator symbol. ^ N VT The v are colour-codedto distinguish are they easy, not structured usually are quite of them some Each tests a question each Within different skill.Letteredsubparts of all of (ii),...), which that recommend are examination-stylequestionswhich Green questions ^^ a question ^j part there may be multiple roman-numeralparts Unless you want to do lots of practice we would lettered are of a similar difficulty. answer. you only do one roman-numeral part and then check your made a mistake then you may want to think about what went wrongbeforeyou try Otherwise move on to the nextletteredpart. ((i), * 7- tough. drill numbered differently are of increasing difficulty. ) levels. the between are drill questions.They help you practise the methods described in the book,but like the questionsin the examination. This does not mean they are Black questions y -+Q,f\302\261\342\200\236 colour-coding The questions ' 7~^>-T iHK be should If you any have more. on to students accessible the path to gettinga grade3or 4. Blue are questions harder questions. If you are aimingfor most of these. through examination-style should beableto makesignificant progress a grade Red questions are at the very top end of difficulty in the examinations.If you then you are likelyto be on coursefor a grade 7. Gold questions D thinking are a type that are in order discussion and not can 5 or do 6 you these but are designed to provoke of a particular understanding the examination, set in to help you a better to concept. At chapter you will see longerquestions of each end the International Baccalaureate\302\256 Of course,theseare a green if you just These examinations. guidelines. If you you have to deal with time pressure of the the same second section of colour-coding scheme. not be surprised if you find at all areas of the syllabus. equally good Equally, will guarantee you get a grade 7; after all, in the and examination stress! are aiming question you cannot do. Peoplearenever can do all the red questions that does not examination typical follow for a grade 6, do These questions are gradedrelative to our of the final examination, so when first experience you start the course you will find all the questionsrelatively but the end of the course hard, by they should seem more straightforward. Do not get intimidated! We hope you find might also find it after lots of revision the Discrete Mathematics Option an interestingand quite challenging, but and practice. do not get intimidated, Persevere and you will enriching frequently course. You topics only makesense succeed. The author team \302\273 r 1 How to use this book vii &$< Acknowledgements The authors and publishersaregrateful for in either the original or adapted form. While / the permissions every effort granted to reproduce materials has been made, it has not always the sources of all the materialsused,orto trace all possible If any omissions are broughtto our notice,we will be happy to include the to identify been on reprinting. acknowledgements IBexam International Baccalaureate Baccalaureate permission to reproduce Cover image:Thinkstock questions \302\251 International ) I Diagrams in Photos: viii *%) Chapter Acknowledgements the book 5 page were created 51, Edyta Organization. Organization by Ben Woolley. Pawlowska/Shutterstock copyright holders. appropriate We gratefully intellectual acknowledge property. Introduction In this \342\200\242 about to how solutions of find integer find a remainder used in mathematics prime numbersare so important and why of integers, divisibility \342\200\242 of proof methods different \342\200\242 about will earn: yo Option linear equations in variables two (Diophantine equations) \342\200\242 to how when one integer is dividedby calculations and solve equationswith \342\200\242 about various remainders of remainders, properties \342\200\242 about including the Chinese RemainderTheorem a graph, structure called mathematical new a lines, and can be usedto modelnetworks how arithmetic) (modular and Little Theorem Fermat's \342\200\242 to perform how and another, solve to problems optimisation on graphs, for of consists which finding example points the joined by route shortest between two points \342\200\242 how find to by a recurrence relation. problem Introductory Supposeyou can you for a sequence given a formula have supply of a large 20 cent and 30centstamps.In how many different ways make up $5 postage? Discrete several branches of mathematics concerned with the study of rather than continuous.This meansthat they are made up of discrete (separate) objects,such as whole numbers or vertices of a cube, ratherthan continuous quantities such as distance or time (represented real Some aspects of discrete mathematics, numbers). by the of whole numbers, date back to antiquity. of the areas started developing mainly theory Many in the 17thcentury in and found substantial the 20th. Oneofthe main drivers applications only includes mathematics are discrete, which structures recent behind discrete fundamentally Theory is the first and divisibility particularly around especially Oneof the main the 3rd topics subject is its science, in computer use as computers are machines. of Discrete Five branches Number in the developments Mathematicsarestudiedwithin part the IB syllabus: option. It is concerned with properties of wholenumbers, numbers. Number theory was studiedby Greek mathematicians, of this prime century AD, of interest and a little bit later was Diophantine by Indian and Islamicmathematicians. equations - equations where we are only interested in integer solutions. We will study these in chapter 4 of this option.Numbertheory has held the interest of mathematicians all over the world for many centuries. This is because it is full of problems that have remained unsolved for a long time. Some examples of these problemsare: the Goldbach the twin (that every even integer greater than 2 isa sumof two primes); conjecture there are of consecutive odd numbers which are prime conjecture (that pairs infinitely many Introduction **- (* both prime); Theorem Last Fermats and greater than 2), which was first stated a topic of active research becausethey n is are + b\342\200\236\302\273Arr~-^ there arestillmany we things don't 'v ,\342\200\236. xn + yn (that there are no integerssatisfying in 1637 but only proved in the 1990s. Prime have know about found recently applications \342\200\224 zn when numbers but in cryptography, their distribution and how to find them. describe how to get fromoneterm in a sequence to the next. Given a recurrence relationand a sufficient number of starting terms we canuse theserules for the behaviour of the sequence it is moreuseful to to build the However, up sequence. analysing in the sequence. know how the value of each term depends on its position an for equation Finding the nth term of a sequence can be remarkably difficult and in many cases even impossible.In the final of this option we will learn how to solve sometypes of recurrence relations. We will chapter also use recurrence relationsto solve and model financial situations problems counting involving are equations that relations Recurrence Logic is the study and circuit and rules of both mathematics electronic debt repayment. and interest compound 1h of reasoning and structureof arguments.It isa part of as being of philosophicalinterest,it is importantin science and the study of artificial Within the IB intelligence. principles As well philosophy. computer design, syllabus,logicis covered in in Theory and Studies Mathematical of Knowledge. can be modelledon a network. This is when a set of points arejoinedby lines, possibly with a length assigned to each line.Thesegraphs could road molecular electronic circuits or for networks, structures, flowcharts, represent planning One class of problems involves the properties of graphs, such as various ways of example. studying from one to another.Another class is where point important optimisation problems, getting graph for the shortest possible route between example, theory is required to develop an algorithmto find, two or the optimal time. points, sequence of operations to completea taskin the shortest possible This is very different from continuous optimisation problems, which are solved usingcalculus. in was first studied the 18th but of the developments are more recent Graph theory century, many in and have applications such diverse fields as computer science,physics, and chemistry, sociology with problems that is concerned Theory Graph graph theory in the secondpart of this option. of the underlying structure of a collectionof objects,rather Group Theory is an abstract study than themselves. For example, counting hours on a 12-hourclock, rotations and objects by 30\302\260, in that they repeat after remainders when numbers are divided by 12all have the same structure, 12 steps. can be applied Group theory is an exampleof how a singleabstractmathematical concept in many concrete situations.It is importantwithin in the theory of polynomial mathematics equations and topology (the study of certain properties of shapes), but it alsohas applicationsin in and chemistry because it can be used to describe symmetries. Groups are covered the physics We will study linguistics. Sets, and Groups Relations In the first of this chapter in subsequent option. we will introduce option theory, chapter8 Recurrence relations. someof combine which lj 2 various methodsof proofwhich chapters. Chapters 2-5 coverNumber 9 contains Chapter from material different chapters a selection 6 and 7 Graph will be needed theory, and of examination-stylequestions, chapters. Introduction v\\ 3$) ?> q, vv, ^+0... . \342\200\236. _ I . .O ^ (a ^<+^ this In Methods \342\200\242 by proof of \342\200\242 the proof \342\200\242 have discussedin the introduction,Discrete Mathematics both the properties of large systems as graphs (such Can with deals with many points and lines)and has In such systems it is there are infinitely many). impossible to checkall possiblecases,sohow can we be certain about what is true?In mathematics, truth is established through proof, which is a sequence of logicalstepsleadingfromknown (of which We used have quadratic formula are someexamples. direct proofs, this meansthat we we alreadyknewand derived new However,there aresome mathematical be proved in this way. One of the the proof is expansion An is an v2 that alternative cannot it proved? the were some results direct calculation. by from started results cannot that results most quoted examples is sinceits decimal that it never show is to try approach of x2 and of these Most irrational number: we infinite, be true before A derivative the identities, Double-angled been derive new this course to throughout proofs results: mathematical a conclusions. to new or assumptions facts principle induction. statement numbers of natural properties contradiction pigeonhole strong As we you chapter learn: will and show cannot v2 that repeats! as a fraction; but how canyou show by direct that something cannot be done?In this situation we need to use an indirect proof, where we find some roundabout of that the statement must be true. For example, way showing we couldtry to see what would happen if v2 couldbewritten as a fraction and hope that this leads to an impossibleconclusion; be written calculation +G this is called You have by contradiction. proof already met oneexample showingthat that it starting is true first In this for proof value. This is involves > y that one; we can then conclude the only statement directly If you have shown than proving directly, does establish that something can be proved, rather for the proved for all integers,even if we have the proof statement proof, a given that starting number,and for some number we can alsoprove it for statement proved having the next the indirect of by induction, which is usedto show true for all integers above a certain it that its truth? can be proved it for one. chapter which we look in more detail at someindirectmethods will be needed later in the course. a2 1 Methods \342\200\242 rsM of proof VS. ^ <Kvv, .Ok\" * ^ (a ^<+^ by contradiction Proof Sometimesit is Proof a special general of form is disproved states proposition or its which For example, It is must negation be true. BCE. One famous that are been was his proof since then, validity has been some, most century in Oneof its the proofthat disputed by by the 20th notably and mathematician Dutch philosopher has it Although used tool a widely mathematics many (see Worked 2.15). example can prove that a statement is true by showing that if the opposite was true, it would contradictsomeofyour else we already knowto be true). (or something assumptions You infinitely prime numbers L.E.J. Brouwer. the v2 in the form \342\200\224, where using start is that irrational number of an impossible) +a of proof by contradictionis examples is an irrational number. Rememberthat the cited most definition form to express the fact integers. It is difficult a number that Here proof an equation. that v2 by assuming q are p and be written it cannot is of the (if is not Prove that v2 be written in cannot the form by contradiction,wherewe form is a \342\200\224, 1 where \342\200\224, really useful tool. p,qeZ. q contradiction: Start# v2 as a fraction and Try proof by by writing show that this leads Suppose that and that the v2 = \342\200\224 with p,q e Z, to impossible consequences The same fraction can several ways so we should be (e.g. - in# written = - = specify which that one we are using Topic 10 - Option: Discretemathematics p \342\200\224) iAm*>AJ** and fraction q have not of a certain orked example 1.1 rsM this contradiction by most the of examples there Proof *y 4fJjf^ 300 around Euclid try 1.1 POINT KEY Proof by contradiction could odd know whether don't we but square must also be an by contradiction. proof was already used by opposite an odd have not really obvioushow to start.We root of n2, is this is what we are produces an oddnumber(remember, about what would to happen prove!). However,thinking trying if n was not an odd numberallows us to do some calculations: If n was not oddit would be even, and the product of two even numbers is alsoeven, so n2 would be even. But we were told that n2 was odd, so this situation is impossible!We can therefore conclude that n must be odd. This way of reasoning is in common all branches of and is known as mathematics, very a either that the we to prove that n want we and suppose that must that something directly simpler to show that much the square taking conclusion.This type of argument relies on the low of excluded middle, impossible. number. a proposition by showing that its lead to an impossible would truth it is n2 show to difficult be true, but number od which in > argument, reductio absurdum, 1' more of a case called is contradiction by v is in its simplest no common factors. form so a- * (a * 1 ^ - ^ v <+/* \\ it ) continued... We calculations do some now can \342\200\242 P2 \342\200\224 = 2 Then (squaring eo p2 both eldee), = 2q2- \302\260l useful in common for Looking (2r)2=2f => 4r2 = 2<f =>2r2 = eo cf as p and that of is even and therefore Hence p and reached a contradiction/ assumed we also be eo p must even, Then integers We have p2 \\e even: p = 2r involving problems solving that means This is# factors c\\ have c\\ even. is also factor common 2, is a which contradiction. q had no So V2 common factors cannot be written as \342\200\224. 1 proof by contradiction to prove severalresultsin this The exercise below is intended to give some option. you in this of but does not practice proof, represent writing up type We will use typical examinationquestions. One of Cantor's put all (infinite) 1. Prove that if n2 is Show that there X2 - examples of diagonal proof, it is impossible real numbers into that which to an list. 1A Exercise 2. most proof by contradictionis shows +G the *SHG? fascinating an even integer than n is alsoan are no positive integersx and y such even integer. that = 1. y2 3. Prove that log2 4. Prove 5. The is no there that mean age 6. Show that of five be at them must the 5 is an irrationalnumber. least sum largest even students is 18 years of a integer. 18.Showthat at least one of old. rational and an irrational numberis irrational. 7. Prove converse the sidesof a triangle of Pythagoras' Theorem: \342\200\224 and a2 + b2 G = c2, then If a,b,c arethe 90\302\260. 1 Methods ' of proof t*J VS. ?3n .0 ' * ^ (* v c+^ 8. calculator to show that Use your (a) has one realroot,and this find the to 3 significant correct root x +1 = 0 x3 + equation figures. that Prove (b) root is this irrational. principle Pigeonhole If you in a year, of 367 a group have them share so a birthday. This if each person people, you can be certain had a different KEY The principle pigeonhole is also 4fJjf^ 19th century German mathematician are example given the real numbers 11 different of those two between 1 and numbers 100 differ by at we have 1 1 pigeonhole two least is a pigeons. 1.2 principle to show that Since then there n pigeonholes, in pigeonholewhich containsat Gustav Lejeune Dirichlet. You principle If n + 1 pigeonsareplaced after the difficult 1.2 Pigeonhole principle, orked POINT can be *^f as known Dirichlet's would this birthday 366 people.This simple observation a surprisingly powerful tool in solving seemingly very in It is stated the form: problems. traditionally following of 366 days for at most account two that are at most there is because numbers, to use# principle we need 10 'pigeonholes' Divide the pigeonhole 10. Interval 10 into [1,100] ec\\ua\\ Intervale: ...,91-100 1-10,11-20, Since there +a Use the inclusive. most be in the are 11numbers, same Interval two of them must (by the pigeonhole principle). What is the two between largest numbers possible in the same difference\342\200\242 These two numbers differ by at the most 10. interval? Notice that we could alsohave proved the above claim by contradiction. Put the 11numbersin order, that x1 < x2 <... < xu, and suppose of consecutive numbers differ more than 10. Then, pair by as xx > 1, it follows that x2 > xx +10 > 11, x3 > x2 +10 > 21,and so with xu > 101,which contradictsthe assumption that on, ending all the numbers are between 1 and 100.Hencethere must be two of the numbers which differ at most 10. by each The pigeonhole principle itself can be proved A more general form of the principleis: Topic 10 rsM 3$) - Option: Discrete mathematics by contradiction. ' ^ (0- -^^c^ 1.3 POINT KEY General principle pigeonhole If kn + 1 objectsare be may then empty) k + least v (some of which n groups divided into there is a group which containsat 1 objects. orked example 1.3 the Prove know don't We principle pigeonhole general about anything objects are split into proof seems unlikely. so groups, So stated above. Suppose that the statementisfalse, how the# a direct a proof by try of the each n at most k contains groups so objects. contradiction Then the total most This kn. about the of number of number can be objects at the assumption contradicts objects. least one of the groups contain at least k + 1 objects. Hence at must Not all statementsthat can be proved using the pigeonhole principle can easily be proved by contradiction. The next exampleusesthe generalpigeonhole principle. orked 1.4 example Nineteen points are drawn inside a square it is possible to find three pointsthat of side that form 3 cm. Usethe pigeonhole to show principle with an area lessthan 1 cm2. a triangle +G one want We of the to# 'pigeonholes' contain a triangle,so we (since 2x9= 'pigeonholes' The Since 19= 2x9 18) there at is the What triangle side 1 cm? It is not obviousthat contradiction. an area could we can We try to show that large, but sincesomeofthe anything their about total powerofthe pigeonhole principle would be to difficult prove using the overlap triangles area. This in into nine 1, by three of the the pigeonhole squares Q, VVj principle contains which points. form a triangle the area of the with square, which is 1 cm2. statement by the triangles have total it is area is too difficult to say last exampleillustratesthe proving any other statements which method. 1 Methods ^ of squares the above that all assuming try than 1 and more prove least + of these area less than a square inside is is one Thesethreepoints area of a# of possible largest which be split can square side 1 cm. 9 to define need of proof I ^ * ^ (a v ^<+^ is an example of a non-constructive existence proof. In the last a triangle with the required but not how to find it. Some exists, property if we mathematicians the of such Is it useful to that exists know dispute validity proofs. something don't know how to find it? Can an object be said to exist if there is no known method of finding The pigeonhole we example or principle found that > y it? constructing \302\253^. ^^ the pigeonhole use will We about graphs, theorems principle to see Worked example some prove \302\253^. ^^ 6.1. IB Exercise 1. A pick to be certainthat need to do you colour?Proveyour 2. Prove that if you (inclusive) if 9 that Show must be three 5. Showthat at friends Five the it is are points whose 8 integers it is possible to find 10 a 0. the party and some of them are friends. party. there are two of friends. 7. are two seated in a row of 12chairs,there occupied chairs. (b) Show that +a integers there impossible that there is botha person with everyone and a person who has no is friends who principle. it is why Explain same integers between 1 and them must add up to 9. 91 positive in There are n people at (a) of the five different people are consecutive among three have sweets by 7. pick whosesumends 6. 8 positive two of then you the pigeonhole using any among 3. Prove that 4. result is divisible difference different colours.How many of five sweets contains bag drawn on the people who have the same number surface of an orange. Prove that to cut the orange in half in sucha way that at least the points areon the samehemisphere points (any along the cut count as beingonboth hemispheres). possible four of lying 8. Each point in the planeis coloured either red or blue. Show that 1 cm apart. there are two points of the same colour which are exactly \342\200\242i* The of graphs. colouring any in the group It whom 8 other, know - know Discrete Option: ^ cl \302\243%*.. are selectedinsidea squareof side1m.Show to find three of thosepointswhich lie inside radius that it a \342\200\224 m. 7 10. of rsM 3$) circle of In people, there or three none each other. Topic10 51 points is possible is often form: are eitherthree who all each 9. with following of six ^88 Ramsey's which deals theorem, stated 10 is in question result a special case of mathematics and diagonal of a regularhexagonis coloured either red or blue. Show that there is a triangle with all three sides of the same colour. Each side induction Strong |QP You will have learnt that about statements some positive ofmathematical integers can be proved usingthe Principle if we know induction. The key idea in inductive proofs is that that the statement is truefora certainpositive we can integer, use this to show that it is true for the next integer.This relies on a connection between the statement for n and the establishing statement for n + 1. on more However,sometimesthe statementfor n depends value. One familiar is the Fibonacci previous example = values Fn_1 + Fn_2 with sequence, defined by Fn starting \342\200\224 \342\200\224 If 1. we want to about need Fl F2 Fn we prove something than one about both information let us For example, formula by Fn \342\200\224 + Fn_1 Now suppose true Fk = prove that terms for all Fk_1 + Fk_2, Fn < 2n for for n starting values: Fx up to we need all n. First of all, the > 3, so we needto start -1 and including Fk_x for to use the resultfor As we are assuming that to and includingFk_x, we checked have we F2 < 22. = 1 statement is some two k. Since terms. previous the statement fact that use the can and < 21 that the checked have we that Fn_2. applies only Fn_2 the two checking and Fn_1 Fk_x < 2k~l up and Fk_2<2k~2. Then: = Fk Fk-i + pk-2 <2k~l + 2k-2 = 2*\"2(2 + l) <2fc\"2x4 = 2fc that shows This \342\200\242 The integers n, then n for that the It follows as we the for n is true 2n n-k. n \342\200\224 1 and for all n < k then we \342\200\224 2. can show that it \342\200\224 k. statement can reach statements use statement is also true for so the is true statement is also true the Fn < statement \342\200\242 If the Use < 2k, shown that: we have Thus Fk for statements Fn is true < 2n for all positive any n by repeating the stepsabove: n = 1 and iovn n-2Xo prove it when n - \342\200\224 2 and n \342\200\224 3 to prove 3, it for n - 4, and so on. This variant of proof by induction, we needto useseveralprevious called strong induction. where in the inductive step rather than just one, is values * ^ (* KEY ' 1^ ^1 ^ V vc+^ l .4 POINT Strong induction Supposethat a statement have we (or rule) (a) the statement is true for somenumber (b) assuming that the (this is calledthe inductive is true the statement then for base of can that: show and cases, can for all n<k,we is true statement about a positive integern. If we also true it is that show for n-k step) all n. integers positive number of basecasesneeded on how depends in the next term many previous terms are requiredto calculate each term was found by the sequence. In our exampleabove, two base values. using two previous terms,sowe needed Note that the Sometimes the inductive step requiressomeofthe previous terms, don't necessarily knowwhich ones.We then really need to know that the statement is true for all previous values of n. This is but we wherethe methodofstrong orked to show induction strong that every positive integer n can bewritten n= where p e N It is not each and obvious how1 cases we need,solook at the inductive obvious is no There 2pcv + 1p~xcv_x 0 or 1. q is either immediately many base step first connectionf connection k and between If k is even we can +... Inductive + 2q - ^ q, vv, \342\200\242V^ + o be either even 2 relate k to this by Option:Discrete can all _ - \302\253 k le even, then so we know that If 2 to get km mathematics \342\200\224 le an Integer leee than 2^cp + is also 2?cv_y k, k : the statement letrue fom = \342\200\224 2 cy-0 or 1. Then which Topic 10 oaeee\\ k statement for or odd. k = 10 + c0 two separate for some p and rsM form step: Conelder 2 Multiply the in Suppose that we have proved the n< k, and look at n = k. between n = k and any particular as the previous terms. However, required expression involves powers of 2, we may be able to establish a +a useful. 1.5 example Use is particularly induction + 2c0 form. required +... of the + 22q a- * (a * 1 ^ - ^ v <+/* \\ continued... k is If relate k to we can odd, is odd, \342\200\242\342\200\242 \342\200\224^If k \\ k \342\200\224 is an Integer \\eee 2 is true the statement that n = for k, so than we know k \342\200\224 1 : 2 = 2'cp+2P-1cH + ... ^ for eome p and To get need k we k = 1 add and 0 or = which 1. + 2{2Pcp+2P-'cp_, 2P+'cp+2Pcp_, is also of + ... + 2c,+c0)+ that yet: we case base and can get = 3 n not done have we n by using only need one write Always a ... + 22c,+2c0+\\ n = 1, When 1, so we = take p \342\200\242 a conclusion is true for to assume of k in value each k. Hence the strong get the n \342\200\224 \\, and if it is true for it is alsotrue for statement istrue for all integers Induction. V^^^^^^^^t^^^iA^ A ,^fc._Ajt -^-n (^ The value used depended on = 10 and n = 11we used n = 5 we used n = 15. This is why we needed statement was true for all previousvalues of n. values. for n exampleis called binary ofn. It isa special a number = \\to the above example, The form from the previous or base 2 representation ^^form, ^^ the that c0 we can show that k then n< ^ +a and Conclusion: n > 1 by we usedoneofthe previous k; soto prove the statement and to prove it for n = 31 =0 required n = for k. base case a\\\\ the statement n = form. The statement To prove for E3asecaee: \342\200\242 n = 2 to /\\ the correct form. Thereforethe statementis true Remember + c0 Then double* to c = + 2q base, which will we the case in more investigate in chapter3. of<^^ detail ^^ Exercise 1C In 1. this that Given t*J a natural number. and a0=2yal=5 = an+2 5an+1 - 6an, show that + 3n. a=2n 2. n is exercise, A sequence ax \342\200\224 0,a2 is defined = l,a3 = 4. by an+3 Prove that = 3an+2 for - + an 3an+l all n, an = (n-l) with . 1 ' ^^VNOC, Methods of proof * (* ' ^ 1^ 3. numbers from (n numbers are in the 17th century believed that and (He only checked the first only 100 years later was Euler proved that F5 is The sequence Gn all prime. were they four!) It Gn+3 are Gn+2 + Gn+l that defined by Fn the Show and Xn-fl\\ = 22\" first = by G1 is defined + Gn. = l,x2=2 +1 for n>\\. one end in Prove that a 7. 1,G2= 2,G3= 3 and all n>l,Gn< 2n. that for that in fact Showthat divisible by 641. It is not known whether any other Fermat numbers = by x1 numbers exceptfor all Fermat 4 question is defined xn V vc+^ Show l)(*n-l + *n-2) \342\226\240 Fermat Fermat studied the ^ The sequence ~ = *\302\253 ^1 12 made be greater than or equalto 4 using only cent and 5 cent stamps. of postage amount any can cents prime. that Show for all integers n> is 2, the numbercos \342\200\224 irrational. 8. Letu0 = 1and thatun = 2n 9. Showthat most +a 12 Topic 10 - Option: ^ q,vv, Discrete mathematics 2n un \342\200\224 + for alln n straight regions. un_x un_2 +... + u2+ul+ 2u0 forn>\\. Show e N. lines divide the plane into at ^ (a ^<+^ In this chapter will learn: you Divisibility \342\200\242 about including multiples, and and factors the greatest common prime divisorand the least common numbers multiple for finding \342\200\242 a method common the greatest divisorof always be added, subtracted and multiplied whole number. The only basicoperation not always result in a whole number is division.For at factors is an important tool in solving looking the that does this reason, theory. Some of the materialin this chapter be familiar to you already, but some of the more abstract will results may expected to You are new. be be ableto prove many useful properties \342\200\242 why are The proofs are also examplesof techniquesyou to use in later chapters. need large Euclidean of factors and multiples results. these will \342\200\242 various in number problems (the algorithm) is a result and of can numbers Whole numbers two prime numbers so important. j multiples and remainders Factors, ES9 number of Much of multiples cannotbe the basic divided and the divisibility of properties this chapter, Throughout number a whole mean we factors or when numbers section we review some of relevant to division and numbers. whole with finding at remainders or looking In this exactly. terminology 'number' is concerned theory numbers, by (integer). Consider two numbers, a and b. If thereisa numberk such b = kawe can write a \\ b and say that: +G a divides or by a, or a is a factor of b, or is b Note in and basic properties a and \342\200\242 If a |b \342\200\242 If a | b then Note is a that 1 is \\ a c then b= 0 is always find any number for of every a factor > a\\(b\302\261c). factor of itself.When can that of divisibility: \\ (be) specify whether we want We but zero, 2.1 POINT Some we cannot divide by fact a | 0 for all a. 0 as a ^ possible KEY of a. a multiple that that b, divisible is b i number, and that about talking to include numbers b \342\200\224 ka + c. k and r and factors, 1 and every number we will always the number itself. r suchthat: 0<r<a A3 2 Divisibility \342\200\242 and prime numbers 13 rsM ^ vs. <K vv, \342\200\242V^ + o ' * ^ (* 1^ ^1 ^ v vc+^ * by a. Note that write b = ka. 4 we will In chapter examine other rules with working l^>for r = 0 The process of finding ]^> called remainders, the quotient call k We it seems Although useful surprisingly modulararithmetic. to perform called the division algorithm. very simple, writing b as ka + r or ka is when proving other results. is divisible by 2 if its last digit is even. \342\200\242 A number is divisible by 5 if its last digit is 0 or 5. \342\200\242 A number is divisible by 10 if its last digit is 0. by 4 if the numberformedby is divisible digits by 4. is divisible two digits is three last test Divisibility using is divisible \342\200\242 A number is divisible its digits prove divisibility ]^> tests for numbers in written other bases theory, and and structure by 9 if the sumofits digits is by 11. (Soifthe numberhas the sum \342\200\224 ax a2 + a3 of digits -...) the divisibilitytests listedabove.You reproduce those proofs in an exambut, more they are examples of types of proofusedin number similar you will be asked to produce proofs with prove asked to importantly, ]^> is we calculate al,a2,a3... now by 3 if the sumofits digits by 11 if the alternatingsum is divisible \342\200\242 A number be digits: by 9. divisible will all the by 3. divisible could its divisible by 8. is divisible \342\200\242 A number We to its by 8 if the numberformedby is divisible \342\200\242 A number will number \342\200\242 A number last 3 you the of 1H last digits: tests using \342\200\242 A number chapter tests which usethe digits 1- 2.2 POINT Divisibility In r is k and there are divisibility be divided. +G can we case long process, it is usefulto have ways of whether one number divides anotherwithout having the division. For divisibilityby many small numbers deciding KEY divided b is be a can division As and r the remainderwhen if and only ifa\\b, and in that J some of using similar techniques. 10. than In orderto number using KEY POINT ' If AT then: is a those derive its we need a way of expressinga digits. 2.3 /c-digit N = lOkak+10k-lak_1 We use proofs number + ... with digits ak,ak_x. .. a2, a^, wq + 102a2+10a1+a0. shorthandN = (akak x...a2a1a0). 1 14 rsM Topic10 - Option: Discrete mathematics VS. ^ Q,VVj ^ * (* - * + V *<l+r * ) orked 2.1 example number is divisible Prove that a and only 4 if by if the numberformedby digits is last two such that the number two is divisible its divisible by 4. is an This we so statement\342\200\242 to Let (i) digits prove last two prove. number by its that Frove N \\aet digits by 4. by 4. is divisible is divisible digits whole number As the statement of be a N formed something about the last two us a way to start, so first gives 'if the number formed by the Knowing the 'if and only iP have two things by 4, then is divisible by 4' is about Let N = \\0kak +... + 102a2+ + 10^%^ \\0ay + a0 sense to write it makes N, digits\342\200\242 N = [akak_}...a2a}a0) Separate We are told that (0^0), This 4. by 4A/I for it as two last the proving a good some number A/I what a factor is divisible We now need to It is reverse look for by 4, \\02a2) + (\\0a,+a0) a good the previous an alternative idea to So we write N separate in \342\200\242 = both \342\200\242* + a2) + 4M 100(l0^2%+10M%_1+... other divisible \342\200\242 Nbe a number that the number (ii) Let and try strategy of its the last two if are divisible both parts by 4. 4 1100, As proof (and only terms + 4M is) by 4 the prove = (/\\0kak+/\\0k-'ak_,+... + /\\02a2) first so doesn't and + of 100 divisible are terms direction. A/I in the terms the have bracket 100 \342\226\240\342\226\240(\\0kak+\\0k-'ak_,+... not (it's divisibility, it is usually idea to take out common factors. All But digits\342\200\242\342\200\242 is lOO] + o0/ is divisible means that we can write important When 2 last the that digits* which formed by 4, eo N is by 4. Frove its last two digits is by is divisible by 4. divisible this work) digits\342\200\242 digits Let N = = \\0kak {\\0kak + + 10fc-1flfc_! = 100(I0fc~2 We can see that the first part is# divisible by 4. We have also assumed that N is divisible by 4. If 4 | (b + c) and 4 I b then it must be that 4 | c As 4 I N \\0k-yak_y and +... + 102a2 + \\0ay + 102a2) +... ak+\\Ok-Z)ak_^+... + a0 + (10^ + a0) + a2) + {\\0a^+a0) 4 1100, it follows that4l(10fll+fl0> 2 Divisibility and prime numbers 15 vs. ^^%\302\253. .0 I * *~ (a V -+*<; +n HINT EXAM a statement To prove to produce two 'A form the of proofs: separate the Often (but not always) and if and A. B then if use similar directions different two you need if B' only then B, if A techniques. The proofs for results, | I from the 9 and 11 use the following Factor Theorem. 2.4 POINT KEY I by 3, divisibility follow which For any integer For any odd power n, power n, an \342\200\224 bn an + bn a factor has (a-b). factor (a + b). has a orked example2.2 number and to write sensible seems It then in is divisible by 9 thenthe sumofits digits number if a that Prove Let the# of its terms separate = N digits sum of the by 9. is divisible /\\Okak + ... +10fc\"1flfc_1 + 102a2 + 10^ +a0 Then the digits N = (ak +ak_i + ... + a1 +(lOfc_1 -1)%^ +... form (10p -1) hae a factor of the first bracket are divisible (10-1) = 9, + +a0) (/\\Ok -\\)ak + (102-1)02+(10-1)0! All one of the are form (10 so we can use from Key the after brackets the point 2.4 +G But we are divisibleby bracket eo a\\\\ As N after terms also first is divisible (ak + %_-, by 9, +... + a-, + a0) use the sametechnique is divisible digits by 9 then You can for divisibility proofs We can to show the number by 3 and 11follow combine these basicdivisibility that if the KEY a similar tests 16 A? Topic10 - Option: Discrete If a | AT and (other than of this result proof 9. The argument. to check the for following 2.5 POINT the ]^> sum of the is divisibleby divisibility by other numbers.In doingso,we use result, which we will prove in the next section. the also be must by 9. divisible be ^4 See the end of ]^> next sectionfor 9. by 9 divisible ^ by = 1 N is# so the must -1), with 10,5 told that 9, Each result the 0 = of the term first\342\200\242 b 1), \\ AT, then and if a (ab) and b have no commonfactors N. \\ mathematics I - ' * ^ (* orked 2.3 example Find the possible valuesof digitsp and divisible by q such the five-digit that number (386pq)is 18. 18 = 2 x 9, for sufficient that the As v -^^c^ is it need We to be divisible \"5&6pq by 9. 2 and by for tests divisibility 9 and 2 both We know the 18 by divisibility number is divisible by 2 and* Divisibility by 2: q for 9 Divisibility by 9: is an even digit 3 + 8+6 +p + q = 9k <^\\7 +p+q=9k As p and q are digits, they between 0 and 9, which are both * + ci<\\&, But 0<p = p + o[ so \\ or \\0. the limits possibilities now combine this We can the fact* that q is even with = 1: Ifp+q If = 10: p+q q = 4, p = 6 q = 6, = q &, As well as showingthat is divisible number a specific p = 4 = 2 p by that a whole class of prove something, we can sometimes numbers is divisible number. Two main methods by a given used in such \342\200\242 in particular factorising, the resultsof +a \342\200\242 proof are: proofs point Key the difference of two squares and 2.4 by induction. example illustratesthe useof factorising: The following orked example2.4 If n is ^ 4 We can an odd integer, prove n2 -1 using factorise the of = 2x4, that one of the factors Since 8 the odd, one other and that hopefully n2 -1 that difference\342\200\242 two we is divisible by 8. H2 - 1= (n - 1) (H + 1) squares can show* is divisible by 2 and n is 4. Remember that by other even number is every divisible by 4 (n \342\200\224 1) 1) are two so they are both and integers, one of them Hence their ae (n + is divisible ^ Q,vv,-V yy\\ + 0U divisible by 2, and by 4. productis divisible by 2 x 4 = &, required. 2 it*f\302\273 even consecutive Divisibility and prime numbers ' a- * (a V ^<+^ next The shows a example such questions in seen asked in this proof by induction. You the core course,but they have can already also be option. orked example2.5 by We follow standard the start so induction, positive integer n, for every that induction Prove format of proof by# by checking the case n= 1 If is divisible number a useful be it in a later be# can some integer a. This as 7a for written by 7, 2n+2 When h So it istrue for it is Assume for some for rpn+Z We need to use the The easiest way assumption for is to express one terms equation using = n \342\200\224 \\. true for = 2 (*) integer a. n = , k+V. rz2n+1 _ the x (7a - pk+3 . = 14a+ 32M)+ the are divisible terms the Principle of 1. Check the whole k +1. by 7 for all n e Z+ by Mathematical induction. whether each of thesenumbers (a) (i) 333444 (b) (i) (d) (i) (a) (i) (b) (i) (613c&) Option: ^ q,vv, Discrete mathematics by 3,4 and 11: 8765432 (ii) (ii) 747472 515152 (32a4fc) divisible (ii) 5151515 515151 2. Find the missingdigits is 33334444 (ii) (c) (i) 123456 - 7, so 2A Exercise Topic 10 by 7. by n = is divisible expression 18 using (*) = 1, As the expressionis divisible by 7 when n = and if it divisible by 7 for \302\253k then it is also = k +1, it follows that the divisible by 7 for n conclusion1 +a rsM 32M 9 x 7x3ZM expression is divisible Hence it is true for write r^Zk+Z) (*) Both Remember to = k: Then n = 2x2k+z+9x3ZM k* n = /c. \342\200\242 of = 5x7 23+33=35 Then for n = 1: 2k+2+32k+'=7a may calculation Relate to the expression by 7. is divisible + 32n+1 so the given that number is divisibleby (ii) (llc65&) (ii) (2213ab) 36: * (a v l+r + ) Find by divisible pk | 0 not by for that p, q such that of n the all values least two factors (otherthan Prove by inductionthat valuesof n. (a) Q 4/c + prove that digit values which 9? (b) 11? by 4 for all [6 marks] in one of 1 + 2. takes the can only number have which numbers are and which of n is the divisible form 4/c or be of the form 8/c, [8 marks] the hundreds by 15. number 111-41 divisible and the [5 marks] by [4 marks] Number N is given in termsofits digits + ... + N = 10fcaJfc+10fc-1aJfc_1 N is that divisible is divisible by as: 102a2+10a1+a0 by 11 if and only + %-%-i+%-2-\342\200\242\342\200\242\342\200\242 (-!) Prove [3 marks] 4/c \302\261 1, 4/c number has at + 35 + 12n2 positive integer canbewritten a square 1H that ndigits (a) Show show itself). 4. Q Findallthree units digits equal +G n4 is divisible -1 forms: 4k, a square or 8A; + 8A; +1 For \\ q, l. (c) Prove that J p 1- [5 marks] number 1 and 5n Explain why every the following four (b) Hence [6 marks] integer k. positive eveiy digits) is 44. integers positive for gfc 1958 (400 19581958 number 22 but two Show [7 marks] the by Given number (2006ab) is 33. Showthat Q that the b so a and digits divisible if ^0 by 11. induction [8marks] that 7n + 4n is divisible +1 [8 marks] by6forallneZ+. 13 Greatest common divisor and least common multiple the result from Key point 2.5, which only applies when two numbers do not have any common factors. For many results in number theory it is importantto know the common factors of two numbers. In the section previous we used 2 Divisibility and prime numbers 19 vs. ?3n * ^ (a v ^<+^ ) common divisor (gcd) The greatest numberd the higWco^Jbut example, gcd(4,6) called relatively prime the hcf, or factor, are notation IB uses gcd (a, b). algorithm ]^> Section the in ]^> 2C. b. A more efficient The greatest common divisor 35 use to should try theses in involved proofs, will the thought as they can examination proofs here. You processesand strategies be appliedto proving results. other yo^ to understand on required show one of the been have papers in the past, so we greatest checking can you 1H has someimportantproperties prove other results.The proofs of these properties which is useful for are 1- themselves divisor, common =2 gcd(a,b) is to list all the factorsofa and slightly way is to list only the prime = factors. For example, 36 2x2x3x3 and 90 = 2x3x3x5, so gcd(36,90) = 2x3x3 = 18.Finding factors can prime be difficult, so in the next section we will see an alternative numbers. method, which is of moreuse with larger calculator \302\243nfind d \342\200\224 gcd(a,b). prime. relatively which ^Your the largest One way to find Euclidean See common no have b is and gcd(l2,35)= 1.Two numbers (or coprime) if their gcdis 1 (sothey 12and factors other than 1). For example, For called is also The gcd a and b. We write a and both divides which of answers. orked example 2.6 a b if gcd that Prove It is a a, b and can b we a and both gcd = 1. d d idea to write some good relating equation \342\200\224 d then (a, b) sort of \342\200\242 d. As d divides a = write We can write to show that a = md b = and = Qcd(m,n) nd. Then we need /i. md and b=nd +G Give gcd(m, n) a about something try to and name find out# using definitions of it, that a factor. But a and both know we common factor Remember that f = wanted 20 rsM ^\\ Topic 10 - to of gcd(m, know b have fd that the a and as# largest b is d n), and that n = oft, eo a = f. Then pf and m- = pfd and b = oftd. n and This shows m gcd (m,n) Suppose we* this is 1 that meane This the However, both a and Hence f eof largest b is < 1. E3ut \342\200\224 \\, ae fd d'wldee both number d, eo fd f is that a and b. d'wldee < d. a positive Integer, required. Option: Discrete mathematics vs. ^ <k \302\243%*.. .Ok\" The above their greatestcommondivisor, two numbers divide if we example says that the by are numbers resulting relatively prime. There are two further important properties happens to the gcdwhen we subtract two results are summarisedbelow: | =1 \342\200\224,\342\200\224 \342\200\242 gcd b I d) U = d \342\200\242 I All three = d then: If gcd(a,b) gcd(a,a-b) I numbers. us what 2.6 POINT KEY which tell - \342\200\242 =d qb) gcd(b,a for Z q e any return to the resultin 2.5: if a and b both point Key = N and if gcd(a,b) divide N. For 1, then ab alsodivides x 6 and 5 both divide 600 so 30 6 (= 5) alsodivides example, 600. 6 and 4 both divide 36,but 24 (= 6 x 4) does However, Let us Sothe condition to Notice that that gcd(a,b) is divisible which not. for the result is necessary 12isthe smallest divide 36, and by both 4 and 6. 12 does apply. number = 1 important concept. The least common multiple(1cm) of a and b is the smallestnumber/ such that both a and b divide /. We write / = lcm(a,b). For example, = = lcm (4,6) 12and 1cm (5,6) 30. The above examplesuggests the following extension of Key point 2.5. another us to leads This KEY_PQJNI2.7 If a | N and b \\ this result To prove then N lcm(ab) \\ N. we need to lookin detail more properties of and relationshipbetween and lcm find the lcmby listing multiples a number which is in both lists.A slightly We can at the gcd. and b until we find method is to use = 120 2x2x2x3x5, of a better and prime factors.For example18= 2x3x3 so every multiple of both 18 and 120 must be divisible 23, 32 by = = and 5. Hence lcm(l8,120) 23 x 32 x 5 360. A convenient way to see what's going on is to draw a Venn diagram showing prime factors of the two numbers. The two Any common prime so gcd sets, common appear in product lcm(l8,120) factors are those in the intersection ofthe (18,120) = 2 x 3 = 6. must multiple at least one of the contain all the factorswhich numbers, so the lcmis the the prime factors in the unionofthe two sets, = 23 x32 x 5 = 360.Notice = 2160 and that 6x360 of all 18x120 = 2160.This is one , - 3rvV% example of a very important result. * a- (a * ^ 1 ^ - v <+/* \\ ; 2.8 POINT KEY x 1cm (a, b) = ab gcd(a,fr) Once The proof 1cm. papers, Prove that gcd(a,b) = md and b= * with nd may 1H Let 5 be IcmlO/b):it' b, and it is multiple. How can we such express 5 = md andb any ka and kind \342\200\224 nd with b\\ ka \342\200\224 is a 5,eo . is a , whole = 1. gcd (m,n) a and b. Then of both multiple . Then fact? first the a = Then We know two things about is a of both a and multiple smallest = $cd(a,b) Let d = 1 (m,n) gcd the result has often appearedon examination example of a more complexnumber be asked to produce. 1- x lcm(a,b) \342\200\224 ab. write a can the 2.7 example We can be usedto find also an you proof theory this result gcd(a,fo), of this it is and orked found have we whole number. , number, eo km . \342\200\224 is a n nd whole number. How and can to get trying factors. no common n have that Remember /cm? divide n an expression in Now we use the fact that of is the# lcm(o,b) As smallest S. The possible value of of = qna = qmnd = q \342\200\224 smallest possiblevalue corresponds to q =1. } = \342\200\224 d eo lcm(a,b) now can qn is the \\cm(a,b) S, it \\cm(a,b) V +G We k= Hence is 1 q k; eo divide q. 5 = ka and d smallest possiblevalue must Hence b of a, some for are We terms As gcd (m,n)= 1,n mm prove the result xqcd(a,b) = ab. of Key point 2.7. orked example2.8 that Prove if a We \\ common and almost 2.7, example N of a 22 3$) Topic 10 - N 1cm (a, then this in have shown b) | N. \342\200\242 Worked that From the any and b can be written previousproof, N = ab But \342\200\224 = lcm{a,b), eo lcm{a,b) q\342\200\224. d divides N. d as rsM \\ proved as we multiple b S = for q\342\200\224 some q. Option: Discrete mathematics ^ Q,VVj VS. .Ok\" *~ * (a ' K^ V <+/* when a and b special case In the result from Key are If a andb \342\200\242 lcm( \342\200\242 If a\\ 2.5. point are relatively prime then: ayb)-ab. N and b \\ N then ab \\ N. 2B Exercise the greatestcommondivisor multiple for the following pairs 36 and 68 (a) (i) (ii) 1. Find (c) (i) (d) (e) (i) (f) (i) (ii) 25pq2 Verify that the pairs following (a) (i) 68 and (b) (i) 120and (c) (i) 35 and (p, Prove Q resultsin Key points are q and prime are q 2.8 are and 2.6 prime numbers numbers true that if a 32 60 16 write (ii) 56 and (ii) 100 and (ii) 42 and / = pa 21 50 25 and / = qb. Prove that [7 marks] \\ (be) that In section we describe greatestcommon this divisor when gcd(a + b,a-b) is [6 marks] and Euclidean numbers the for of numbers: gcd(a,b) If d = gcd(a,b) and/is any a and b, prove that f\\d. large 105 = 1. q) The for p and and 15pq where p If gcd(a,b)= 1 prove either 1 or 2. +G 85 and (ii) 27 and 18 Let / = lcm(a,b)and gcd 135 360 and 35 and 9pq3 where and 42 and 35 (ii) 64 and 72 6p2q of numbers: (ii) 49 56 common least the and (ii) 56 and 81 28 and (i) 180 and 225 (i) the 2.9 KEY POINT (b) we get prime, relatively other = 1 then a \\ c. common divisor [5 marks] of [5 marks] algorithm method for finding the of two one which is useful numbers, factorisation is not feasible. prime another 2 ^ q, \302\243^% Divisibility and prime numbers ' a- * (a ^<+^ Euclidean appears but that believed It was solve is it had been at least a century later discovered both in by astronomers earlier. India and trying to needed equations The Euclidean JF/T^ it independently China *y Euclid's in Elements, known algorithm 2.10 POINT KEY The V \342\200\242 Find the remainder when a \342\200\242 Find the remainder \342\200\242 Find the remainder this \342\200\242 Continue to make for finding gcd(a, b) with algorithm this rx. when b is divided by rx. Call this r2. when divided rx is at each divided by r2. Call this r3. stage finding the byrn + 1. is gcd(a, remainder non-zero last Call rn is when \342\200\242 The b. process, remainder accurate calendars. is divided by a > b: b). I an orked Use the Euclideanalgorithm the finding example. 2.9 example Start by to find and quotient gcd(102,72). step we the next Continue are dividing is no there until 102 = remainder* when 102 is divided by For 72 1x72 + gcd is the \342\200\242 30. by remainder 72 = 2 x 30+ on the# penultimate line says gcd(a, b) But we +G gcd (a, \342\200\224 gcd (b,a- divided b) statements This result will \302\253^. ^^ in used to solve Section be 4C Diophantine equations. well W Topic 10 - in the same pattern. We together so that, following important Worked in gcd(30, can example 12) = these connect 2.9 we gcd(12, have 6) = 6. common divisorof two algorithm can be used to prove the the greatest Euclidean the result. KEYPOINT2.il \302\253^. There exist ^^ The \342\200\242V^ + o have: we So provides: argument numbers, Option: Discrete mathematics ^ q,vv, a- qb is the remainder = gcd(r1,r2) as finding Euclidean illustrated 24 that which we calledrx. by b, gcd(102,72)= gcd(72,30)= As q so of = gcd(b,rx) continues this result from Key point 2.6, of the qb). can choose a value gcd(b, r1) And = 6 because works identical An 0 that: a is when + .\\gcd(l02,72) method which 12 +6 = 2x12 30 remainder This 30 72 12= 2x6 The when illustrated with much clearer becomes method The integers algorithm in the m and n such that ma + nb \342\200\224 gcd(a,b). provides a way of finding next example. m and n, as ^ * (* orked - the previous rearrange and 72, line to express second the *<l+r then 12 the in we terms of want an = -2x72 + = -2x72 + 5x(102-1x72) the only is not this that m = -19, n = 27 chapter 3 that line penultimate pair of such integers;for is anotherpossibility. are there In we will fact, many pairs infinitely 5x30 = 5x102-7x72 .*. Note 30-2x12 = 30-2x(72-2x30) and 72, 102 of terms we work back from 6 = rearrange so on. As and 30, and expression for 6 in 72 + 72n \342\200\224 6. example, we can# to express 30 in 102 of terms line first the that 102m n such and m From V 2.10 example Find integers * + 5, n = m = -7 example, see in of such numbers. Exercise 2C 1. Use the Euclidean a = 35,fc = 12 to find algorithm gcd(a,b) in the following cases: (a) (b) a = 122,fc39 = a = (c) (d) a = a = (e) +a 2. For each 42 = 80 320,fc 462,fo = 200 of numbers pair Use Euclidean the from the n such that m and integers (a) 63,fc = algorithm (b) Find a pair of integersx and 86.x + 45jy = 1. Let that 48p Use = d. gcd(48,30) the Find two + 30q = d. Euclidean are always relatively algorithm previous question,find ma + nb- gcd(a,b). to show that that y such integers, p to show = 1. gcd(86,45) that and marks] [6 marks] q> such 3/c +1 and 13/c + prime. positive coprimeintegersa and b, show that possible to find two consecutivepositive integerssuch is a multiple of a and the othera multiple of b. Given two [7 4 [4 marks] it is that one [4 marks] 2 ^ q,vv, \342\200\242V^ + o Divisibility and prime numbers * ^ (a ^<+^ Prime numbers 9 A 1 is 1 and itself.Remember number, as it has only a prime not two factors, has exactly number prime that one are not prime are calledcomposite. Note all other numbers even prime prime number, only When lemma in the appears \342\231\246y a Elements, collection of by Euclid of known for the best a thousandeditions published to theory most one of results. related KEY POINT 2.12 believed to published the Bible. book after lemma, numbers, results. important date, must more two many it is prime at least those numbers. For example, 600 15 x 40 and we know that 31600, so 3 must divide either 15 or 40.Composite numbers do not have this property: For example, 61600but it does not divide either 15 or 40.Thereare With over second divide a product of two divides if a = number the thenit the Elements also contain be that formal first of geometry, treatment which states is Euclid's ones important Alexandria around 300BCE.Although the odd. are to division,primenumbershave some which distinguish them from composite properties interesting results mathematical written 2 is that it comes numbers.Oneofthe most JfjJ^ Numbers factor. which Euclid's v (i) If p is (ii) If p is prime (iii) If a and and b be will You proofs, as a are the p \\ and p \\ c2 then or p | n. p |m then mn p \\ c and p21 c2. relatively prime and ab = c2,then botha b are numbers. square to use expected in and prime these resultsto produceother example. following orked example 2.12 that Show If we +a it is put all terms we equation, We relatively prime. cannot that \342\200\224 \342\200\224c2 n. n2 an \342\200\242 be able to factorise it may to check need c such and side of one n on with a result have positive numbersn to find impossible ^> n(n-/l)= c2 about ob that Two two the = c2, but numbers have any n -1 n are are relatively numbers consecutive and we* common factors are coneecut'we numbers, eo they Hence both n and n -1 are prime. square numbers. E3utthere arenttwo numbers, eo such n coneecut'we and c do ec\\uare not exist. Prime numbers are 'building blocks' of arithmetic, as all other numbers can be made some by multiplying together = x x 23 360 32 5; this is called prime numbers. For example, primefactorisation. Every whole number factorisation,and this resultis soimportant a name. 26 Topic10 - Option: Discrete rsM ^\\ ^ <k \302\243%*.. mathematics has a that unique prime it is given I \\ ^ (a -^^c+^ ) 2.13 POINT KEY of Arithmetic Theorem Fundamental Thereis exactly one a given to write way number N > 1 in form: the 1- N=p1p2...pk ...<pk are primenumbers. where p1<p2< so that < < ... < pk for prime factors p1 p2 is no danger of thinking, for example, the order We there are two and 3x3x5 3x5x3 1h convenience, that of Some factorisations. different values can bethe same,and we usually write the prime factorisation in a shortened form N = pilpp \342\200\242 \342\200\242 \342\200\242 pmm- the p It is things: positive integer greater of prime numbers. product Every 2. Thereis only one than 1 can bewritten mentions proving a as the prove this theoremusing a methods of proof you already know. induction. proved usingstrong You can explicitly syllabus The Fundamental of Theorem this. to do way of Theorem Fundamental the that really states two Arithmetic 1. to note important as an Arithmetic The first statement can be strong of example and of facts combination induction. orked example 2.13 that Prove every integer positive two or moreprimenumbers. is a This true be for all statement positive possible it +G not is greater than which should be# integers, so it may to prove by induction. As n to to get from possible a multiplication number, we may need n +1 using use the two cases n< related smaller than it, be written at look can apply inductive We should write a the hypothesis conclusion* i.e. k: It k is k is composite, k has a factor a,b<k, 2 is a a. Then get k written So the all true a and b can n k we be written n = can prove that it for all as we together of primes. = k. k; it is therefore true this call k; them Multiplying for n = k. for this means that a product as composite. k = ab. write can statement istrue for n < is true by definition so both statementis it is or prime, other than 1 and we all for of primes. statement prime, the of primes. products n = product of smaller than integer every is either If for 2, as is true a product as If k to two numbers* so we k, 2. E3ut have n = for the statement that factor We is true 1. ^ 4 as a written induction. strong kfor some Now \342\200\242 be number. k can strong separately by prime induction Consider Vroof The statement Assume a prime by to 1is eitherprime,or can Hencethe 2 and if it is true is alsotrue n > 2 by for strong induction. 2 Divisibility ^Sr.-v* +<*.. and prime numbers 27 ' ^ (\302\243 V \342\200\242 + <*ii+r second The * by contradic- Proof Hon was part of the little moredifficult introduced from in Section1A. point Key to Fundamental Theoremof Arithmetic is a and we need to use Euclid'slemma prove, by contradiction. with proof combined 2.12 orked example2.14 that Show have We proved already a product of written as what happens if were possible. If two be# can some common factors cancel we should don't they in get in the = N are we If one equal, any number that1 must also divide the other. side it's important and Euclid's lemma prime, is where This p} is a comes in that remaining reached a have now ^---%. conelder of the divide one qe by them and then none are pe pv As equal to are of the it divides the that rience E3y Euclid's lemma, all prime, the p, must so p, must be ec^ual to qe. we have pe and qe are a\\\\ different, it is impossible for N to different +a hand left of the qe. This is a contradiction, as contradiction4 of the any equation, it must also divide hand side. right factors on both qe. How E3ut We divide can side one eome common are there eldee we way are sides two <q2 Sopip2---Pk =Wz---% them remaining If prime q,qz...qm <...<pkandq^ ^p2 withpi the# = p,pz...pkandN of the divides different two hae N factorleatlone: using so Suppose that factorisations This means that factorisations, a as by contradiction. Froof see Now primes. such two N that proof by contradiction are there is: any given integer N > 2 canbewritten only one way. of primes in product is unique, that factorisation prime have assumed two prime factorleatlone. numbers are soimportant, be nice to have an the easy way finding Unfortunately, only way to check whethera numberis primeisto try dividing it by all primes smaller than it. (In fact, you only need to divide by all primes As prime < \\fn; f we Although cannot number prime is an will be, approximationto many given 28 there how primes there are up to a size. This result is called the Topic10 - Option: it limits of ^ q,vv,>f also that below). However, although numericalexperiments suggest there are infinitely many pairs of consecutiveodd primes, this result as the Twin prime conjecture) has not yet been (known proved. It is problems like this, with proofs, which have kept numbers for centuries. by prime but elusive Discrete rsM 3$) of The second long sequences of consecutivecompositenumbers. of these claims can be proved relatively 7 (see question easily next of understanding and integration. see why?) Primes have a very irregular distribution:thereare pairs odd numbers which are prime,and there are Prime Number Theorem,and requires functions you consecutive predict exactly how large the can it would them. of yy\\ + 0U mathematics relatively mathematicians simple statements fascinated * ^ (a v ^<+^ + ) 1<* We do that there know are infinitely prime many of this is attributed The first proof the to mathematician Greek is anotherexample ofproofby Euclid, and numbers. contradiction. orked example 2.15 are infinitely there that Prove would What if happen many prime were there numbers. Supposetherearefinitely only# assume finitely many prime number? We it leads that is the case and see whether to an impossible conclusion a prime How do we characterise numbers: \342\200\242 number? This means than 1 is that either of either we makea that number divisible by any of the N = not is obviously ec\\ual by so have we an incorrect made p-s? J\\ Also, N so pj3 remainder gives +G our Hence assumption many infinitely been larger than all of 1 when divided it is ^ pj3 as N each somewhere For many centuries mathematicians have it is not divisible science, cryptography and distribution is so unpredictableand is prime is very time-consuming, banking. whether checking primes are used in encryption. This encryption is vital to keeping secure when it is transmittedelectronically, for and so was Incorrect, many prime numbers. It is also there are a number numbers example over states which length like to see some examples of use of prime 4. result is the interesting prime remainder Another recently proved Green-Taotheorem, are would For example, which give arithmetic you numbers of many infinitely to prove infinitely types. 1 when divided by data data are many prime various their personal possible there that the Internet. If finitely there are in interested Because there are that assumption primes by of them. any by them. is impossible. prime numbers, mainly becauseof the challenges presented their But recently prime numbers have properties. by proving in many modern fieldssuchas become important extremely computer or values p,p2...pk+/l Clearly an impossiblesituation/ have reached p.x them. one of least at of the one to E3utthis situation We greater every integer Considerthe number which does not satisfy' the above conditions. How can a number to find prime P\\>P2\"-->Pk. it is divisible Try many numbers, such can find an of sequence any given that all of its terms that you prime. find out about public key cryptography. a2 2 Divisibility and prime numbers 29 VS. ^^VNOC, .ON\" * (a ' a- V 1+r + Exercise ) 2D > 1. (a) (i) (b) (i) (i) (c) (a) (b) 200 120 (ii) 172 (ii) 138 155 (ii) as a Write 846 What is the to of the following numbers: factorisation the prime Find of primes. product smallest 1- 235 number must be multipliedby that 846 get: a square (i) number? (ii) a cubenumber? that a Prove divided by Q prime number can only Show Showthat if and 51 a if 3|fcthen9|fc2. if n is an [7 marks] even number greater than 2 then 2n divisible -1 [4 marks] no prime number p 2p +1 which for is a [6marks] 10!+ 2 that Show 5 when only if 51a2 that Showthat there is square number. (a) marks] [5 marks] be prime. cannot 0 1 or remainder give 6. (a) Showthat (b) [6 is divisible by 2 and that 10!+ 3 is by 3. (b) Showthat 10!+ 2,10!+ numbers the 3,..., 10!+10 are all composite. +G (c) [8J This there that Show question leads are 100 you consecutive composite numbers. through one proof that v2 is an irrational number. (a) Any number rational gcd(p,q) = 1. can be Show that if yfl written in the form = \342\200\224 then P where \342\200\224 41 p2. q p = 4/c, show (c) Deduce thatp and q have (b) By writing V2 30 Topic10 - Option: Discrete cannot be written that 41 q2. a common factor, and as a ratio of two hence that coprime integers. mathematics rsM 3$) ?\302\243*\302\273. \342\200\242V^ + o .on\" ' ^ * (* 1^ ^1 ^ v vc+^ * J Summary If a divides b then The division algorithm such integer k. We for some b-ka states that for a | b. of numbers pair any write a and b find can we k and 0 < r <a + r. that b-ka is a /c-digit 1- If AT number with digits N = In For any integer For odd any If a | AT The n, an + power b and \\ N> if a and common greatest - n, an power bn has You - - q is any N. \\ a and both divides which both a number (ab) and b b. divide. (a gcd b\\ results: = 1 \342\200\224,\342\200\224 d) V^ then gcd(b, (a, b) \342\200\224 a \342\200\224 bq) | N. lcm(a,b) be found usingthe Euclideanalgorithm: \342\200\224 + a qb r a by b and b Replace Stop when r, and by repeat r =0 gcd(a,b)isthe done then h prove and usethe following then gcd integer and b \\ N if a | N Write It is 1), gcd(a,b) = gcd(a,a-b) gcd(a,b) can +G b). w if gcd(a,b) = d then - if - - b). smallest is the induction. ab how to to know need proof by is the largestnumberwhich divisor, gcd(a,b), 1cm (a, b) - b) x and factorising and b have no commonfactors(otherthan The least commonmultiple,lcm(a,b), gcd(a, use {a (a + a factor has bn we often a factor then: +... + 102a2+10^ + a0 10fc% +10*-^.! about divisibility theorems proving ...a2,a1,a0 ak,ak_x of r. value previous m and n, such that am + bmalways possibleto find two numbers, the Euclidean by reversing algorithm. Ifp is a and prime and p lip is prime If a and b are relatively The Fundamental p \\ \\ then mn c2 then p prime p \\ \\ m c and and or p \\ need This be p2\\c2. ab = c2, then both a and b to use strong every are square integer induction and numbers. has a proof by unique prime contradiction. 2 Divisibility \342\200\242 can n. Theorem of Arithmeticstatesthat factorisation.To prove it, you gcd(a,b). and prime numbers 31 rsM ^ VS. Q, VVj .on\" * (a ' a- examination Mixed o Q of digits pairs possible (4alb) is divisible by a and b Find Euclidean the four digit number [7 marks] 345m that + that gcd(l to show algorithm show to such that m and n integers that such 12. (a) Use the Euclideanalgorithm O Use 68 and 345 are relatively prime. 68n = 1. [7 marks] 1/c+ 7,5/c+ 3)= 1for all of k. values Q 2 practice all Find (b) [4 marks] (a) Write a4 (b) Show that, - b4 as a product of three factors. and b are both if a odd numbers, then a4 - b4 is divisible by 8. B that if d [5 (a) Show (b) Hence show that 312-1 \\ n then (3d -1) | (3n is divisible by Show that if gcd(a,b) = d then a If gcd(a,b) Q (a) Prove that the (b) Prove that the product of three consecutive (c) Showthat if n and = 1,prove b be that of two product is odd, two positive gcd(qa,qb) n3 - n gcd(a, b) x lcm(a, (b) gcd(a, a + that 26. [6 marks] -qd. [4 marks] [4 marks] gcd(a,c). consecutive integers is divisible integers is always is always 3$) Topic 10 - Option: Discrete mathematics ?\302\243*\302\273. \342\200\242V^ + o divisible by 24. by 6. [9marks] b) = ab b) = gcd(a, b) [13marks] IB (\302\251 32 by 2. divisible integers. (a) Showthat Show = gcd(a,bc) marks] -1). O Q Leta rsM V 1+r Organization 2005) * (a *~ K^ +/\302\273 In this will you chapter learn: Representation \342\200\242 how of \342\200\242 how \342\200\242 about that computer scientists use of numbers way writing using only know may is a This in those bases tests divisibility different You other bases in to perform arithmetic bases different represent integers than 10 in integers to in bases. binary numbers. two 0 and digits, 1. a with 16 digits. Throughout They also use hexadecimal, system different cultures have used different number systems. history In this chapterwe will learn how to write numbers and perform arithmetic bases. different in How many count? need to fingers do we write numbers: this meansthat when we write the number 635, the 5 representsfive the units, 3 represents three tens (30) and the 6 represents six hundreds So 635 means 5 + 30+ 600.This is an example of a (600). number system which usesplacevalue, so that the digits have different meanings dependingon their positionin the number. We use People the have not different +G because entire always written numbers in this way. numerals in roman example, value system to decimal symbols system we 50 and for V stands for 5 units, For and there 500. One advantage of the place arithmetic, easy to perform written can work with individual digits ratherthan is that are it is with numbers. number system,as we move from rightto left each is worth ten times more than the previous one. We say place that our number system has base 10and it has ten digits, 0 to 9. This system because we use our fingers developed probably for so onto the next counting, moving digit in the number to using another pair of hands to count. It is corresponds In our reasonableto imagine write their numbers base that in creatures with eight fingers would 8. system,we useten digits (0 to 9), in base n we need n digits, 0 to n - 1.This means that we can write numbers 1 to n 1using just one digit. The number n is written in as 10,becausethe T on the left is worth n units.Forexample base number 8 8, only eight digits are needed:0 to 7. The Just as in the decimal 3 Representation ^ Q,VVj of integers in different bases 33 VS. .Ok\" * ^ (a ^<+^ so on. Base8 number 63 corresponds to our number 51, because3+ (6 x 8)= 51. The highest is 63 in two-digit number in base 8 is 77,which = the decimal system (because7+ 7x8 63).To write numbers in than this base 8 we need three so 100 represents larger digits, number 64. As we move from right to left, each place is worth so the base eight one, eight times more than the previous number 254 representsournumber 172(4 units, 5 eights and 2 sixty-fours: 4 + 5 X 8 + 2 X 82 = 172). is then written cultures history have used systems with Throughout different system present 4fJ\302\245i different most decimal the purposes, duodecimal (base in Mf number bases, with bases 12, 20 and 60 being most common. we now use the Although for 12) system time: measuring is still 12 24 hours in a recently, bases 2, 8 and 16 have been used when working with Base 2, or binary computers. months day. in and a year 9 is 11, and So (63)8= (5l) , (77) = (63) When reading out them digit by not three', they are related to base 2 (for example, a group of four binary digits corresponds to one digit, the numbersin so for other then 10 we say would be readas 'sixexample (63) bases 'sixty-three'. numbers in bases greaterthan 10 we use letters to in the hexadecimal the extra represent digits.Forexample, system the letter B stands for 'digit' 11, so the hexadecimal number (3B) the decimal (as 11 + 3x16 = 59). represents number(59) we write When hexadecimal digit). orkedexample3.1 Write It in base (1632)7 to work is easiest 10. from to right start The The second placerepresents left, third +a (1632)7=2 as we# 2 units digit is + 3x7 + 6x72+1x73 = (660\\0 units with there sevens; 3 of are The them forty-nines ( 72); are 6 of them represents 73 = 343 represents place there The next Exercise place 3A 1. all the down Write (a) (i) base 6 (b) (i) base12 2. Write the (a) (i) W (i) (d) (i) (e) (i) (f) 34 3$) Topic 10 - Option: Discrete mathematics ^ cl \302\243%*.. (i) digits needed (23), to write numbersin: (ii) base 4 (ii) base followingnumbersin (b) (i) (471)8 rsM and (172)10=(254)8. because used number the subscript. the base in number system, uses only two digits to the (0 and 1), which correspond two states (on and off) of electronic switches. Bases 8 (octal)and 16 are it bases, 10, confusion when talking about numbersin different is conventional to write the numberin brackets with To avoid More (hexadecimal) v base 15 10: (\") (62), (ii) (266), (286)16 (ii) (591)16 (4A)lfi (ii) (C7)16 (DA6)16 (ii) (1B4L (B25)12 (ii) (1BB\\2 ' * ^ (* largest base is the What 1^ 10 number that ^ as a be written can three-digit number in base5? many numbers but 4 digits when written from convert To where base in 9? base marks] 12, [5 marks] example of see ^*M0 base to conversion ^py. 10 we just needto remember to base For an bases different ^^ Worked^** 3.1. example place values are powersofn. 10 to another base, n, we needto write form a1+a2xn + a3xn2 +a4xn3... are digits between 0 and n-\\. base from convert in the number the base any n the in base that in between Changing To [3 require 3 digits when written How v vC+^ ^1 a^, a2 > a^... The next example illustrates how Worked 1.5 this. to do in showed We that can example integer every be written <^[ base 2. We can in show integer can be converted into <^[ that any any base, using a similar proof. orked example 3.2 Write in base (862) 7. Write out powers of The largest are There power of two 343s 7 in that so the 862, is 343 862 into goes 7# of 7:1, Fowere \342\200\242 562 7, 49, 343, 2401 = \342\226\240*\342\226\240 343 2, remainder176 first digit is 2 There is 176 remaining +G are There three 49s in How 2nd digit is 3 \342\200\242 so the 196 many 7's go into next digit The There is 1 unit KEY a base To convert The the \342\200\242 Repeat largest left 1 is 4 units digits is 1 \342\200\242 down the digits, from remainder to right \342\200\242 1-5-1 = 1 (062)1O=(2541)7 the the 10 numberinto base power of n that first digit. n: goes into the number. is the quotient \342\200\242 Divide find 29-^7= 4, remainder29 3.1 POINT \342\200\242 Find just write now We so the left, \342\200\242 29? 176-^49 = 3, remainder next until digit. division by the previous power of n to by 1 has been done. 3 ^ q,vv, Representation of integers in different bases ' ^ * (* 1^ orked ^ from one To convert V vc+^ base to any other base,it is easiestto go 10. base via ^1 3.3 example Convert (9Al)n to base5. out Write with Start 10 \342\200\242 of 5 up to 1 200 \342\200\242 to base convert First powers (9Al)fl Fowere have we remainder and 0, we divide the -s- 25 = 3, 0-5-5 = 0, continue \342\200\242 0-5-1 = by 5 and 1 Read off 5, 25,125,625 575 +125 = 4, 75 Although of 5:1, = = 1, \342\226\240*\342\226\240 the largest 1200, x 11+ 9 1200 625 power of 5 below\342\200\242 and do the divisions x 112 = 1 +10 (1200)1( remainder 575 remainder 75 remainder 0 0 remainder 0 \342\200\242 digits .\342\226\240.(9^=04300)5 3B Exercise followingbase 10numbers (a) (i) 62 in base2 (ii) (b) (i) 183in base7 (ii) 186 in base 3 212 in base 5 (c) (i) 821in (ii) 601 in base (ii) 4632 in base 1. Write the base (d) (i) 1199in base 11 16 2. Convertthe following +a (a) (i) (I100l)2tobase3 (b) (i) (5Al)l6 to base 2 (c) (i) (d) Given (i) (31442l)5tobasel5 to base (A5A)l2 96 = that 531441, 16 (ii) 15 20 to base (210012)3 (ii) base: given given base: (DB3)15 to base 2 3 (ii) (30132)4to base16 (ii) (F0F)16to base 14 write 531440 in in Arithmetic As we have to the numbers the in different base 9. [3 marks] bases one big advantage of a place to arithmetic. system easy perform written However with large the numbers are, we are always working Think in individual how add base 10: add pairs digits. you you of digits, and if the answer exceeds9 you to the next 'carry' to add in any other base. position. We can use the sameprocess value already is that mentioned, it is For example, working in base7 36 Topic10 - Option: Discrete rsM 3$) ^ q,vv, \342\200\242V^ + o mathematics you 'carry' when the answer ' a- * (a V 1+r working in a baselargerthan to 'translate' letters into numberswhen calculating. 6. When exceeds orked the may need . +(C19) \\ ^16 Calculate (3A8) \\ /16 add we 3.4 example First 10, units this (Calculate digits in base 10) \342\200\242 9 = >+ = 15+ 2 #\302\253 answer Is the larger 15? than write pair of digits, plus the next Add represents number that A Remember above. 12 Add the next pair of in base C is \342\200\242 15 is F in base 2, 10 + 1+ carry 1 1= 12 10 16# 16 C write 3 + for number 1 2# C stands digits. from carried one the 17 \342\200\242 12 = write 15 F .\342\200\242.(3AS)16+(C19)16=(FC2)K You can also set out your orked answerin the traditional format. column 3.5 example Calculate (62) x(35) . X 2x5 = 10 = 7 + 3, so write 6x5 3, + l = 31 = 0 are multiplying as we by the * 'sevens' Add (433)7 + (2460)7 as in the = 5 3 3 2 4 6 0 digit =6 3x2 6x3 = 18 2 3 1 (43)7 +G Write 4 1.\342\200\242* carry 6 (24)7 previous \342\200\242 3 2 2 1 3 1 example .(62)7x(35)7=(3223)7 EXAM HINT idea to check your answer by converting to base in also be able to use calculator to work may your some common bases, but you must show your full working and only use the calculator to check your answer. It is a 10. good You 3 Representation \342\200\242 rsM ?\302\243*\302\273. of integers in different bases ' ^ * (* v c+^ which number about its factors. other bases.As can be askedto prove orked if a the digits Let ends in 0, 5 or A 15 number base be o]f a2, o3..., with the All terms number can For example,a base 10 these tests, as using well similar derive can you them. 3.6 example Show that of a is divisible by 10.We in 0 ends tests for divisibility at digits looking us something tell often saw that 2 we In chapter except for the units = \342\200\242* (...a5a2a^)15 a5 x 152+. x 15 + + a2 ay digit divisible are first o1 being by 5. divisible it is then = 15(a2+15xfl3+...)+^ by# 15 Look at first the the last and part digit\342\200\242 The was 9 by in the whole by 5. The next exampleshowsa resultwhich is analogous to the base 10 test for divisibility by 9. The proof follows the same test proved Worked which makes by 5, divisible number ^y* ^^ part If ^ is 0,5 is also divisible separately The divisibility is always divisible by 5. or A (which stands for 10), then it first ^y* ^^ example strategy. 2.2. orked 3.7 example Show that if a 7 number base is divisibleby 6, then the sum digits is alsodivisible of its 6. by +a Write If is divisible this take of out the number using a factor out its by 6, of 6. also We of -1) as(7 We want the (...), so they + a5 +... x72 +an x = (#! + the sum &2 + + % 7\"-1 )+ \342\200\242 \342\200\242 -an + a3(72-l) [a2(7-l) -1 can be factorised + ...+ an(7\"-1-l)] all have a factor ... + an x6(...)] \342\200\242 = of 6 that the sum + (fl1+fl2+fl3+...fln) [a2 x6 of the digits, \342\200\242 first bracket, is divisible by 6 to show is the which form 7k +a2 x7 the expression into on and the rest o}+o2+... The terms want =a, ...a^a^ (anan_^ \342\200\242 we should be able to# so separate digits, digits As the divisible + a5 terms by 6, in if x6(...) the the 6, then divisible by divisible by 6. + bracket square whole number the sum are all is also of the digits is i j 38 W Topic 10 - Option: Discrete mathematics ?\302\243*\302\273. The number is divisibleby of its digits is divisible You are n - by 3C 1. Do the following answersby (a) (i) (b)(i) 10. to base converting (324)6+(ll5)6 (ii) (152)6+(214)6 (6A2\\2+(BBl\\2 (ii) (A61)12+(13B)12 following calculationsin the given answers by converting to base 10. (i) (b)(i) (a) (ii) (2C)16x(4l)l6 (ii) (53)16x(A8)16 ends in 0, what 7 number (c) In base6,what divisible by (36) (3A5/c)14 divisible Find of digit k so that a base the number to be 14 number values of digits k and m (3Am/c)14 is divisibleby (91)10. the possible (a) Show that number, the last two digits divisible 9. by so if the last digit of a base 15number C, thenthe numberis Show that for a base 15 divisible t*J number to be divisible 13? number (b) for a by? is it by 7. (b) What is the criterionfor (c) numbers divisible ? values (a) Find the possible is it be must 0, which criterion is the your (5l)7x(35)7 (b) If a base 12numberendsin divisible by? by Check base. (22)yx(l6)7 base If a Check your given base. in the calculations Do the (a) Q and only if the sum test. Exercise +a 1 if n - 1. often askedto prove particularcasesofthis divisibility 3. applies 3.2 POINT A base n 2. illustrates a divisibilitytest that example bases. in all KEY V i+s* Worked last * a- * (a is divisible by that the [8 marks] is 0, if the ^ q,vv, \342\200\242V^ + o 9 or number formed by by 9, then the wholenumberis [8 marks] 3 ' 3, 6, 3. Representation of integers in different bases \\ Summary \342\200\242 To an integer represent in base n we use digits 0 to n - \342\200\242 To \342\200\242 We convert can from perform base 10 to base n, divide written addition and method as in base 10. \342\200\242 Divisibility For ) criteria the are similar to number is divisibleby number place by powers multiplicationin any of n look at by factors divisibility A base n in base n The are 1, n, values n2, n3, etc. ~ai +CL2n+ a3n2 + ... + aknk~l (akak-i\"M3a2ai) \\ 1. n - base, of n, starting with using the same the largest. column those for base 10: the last digit. 1 if and only if the sumof its digits is divisible by n -1. I r 1 40 t> Topic ^ 10 - Option: Discrete mathematics VS. > Q,VVj ^%o<, ^ . I^ .On * a- (a * ^ 1 Mixed examination o 10. in base (136)8 - to base16. (b) Convert (l439)10 Q Convert (a) (b) O B 8 digits is divisible by is also divisible by answers to parts (a)and not divisibleby 7. (a) Convert (b) Working (c) Convert (a) Show if a that its to show (b) that 41012 is [11 marks] your answerto part (a). to part (b) to a base 10number. 5, square answer your of 84 from base 10to base5. the number in base 7 thenthe sum number is divisibleby in its 3 then In (c) Q Given that values of a (a) Convert (b) Prove The positive base a base possible 9 number 8415 to a decimal number. 9 number is divisible is expressedin that N is divisible by b (b) Show that N is divisible Q The positiveintegerNis Show that when (b) Show that when the sum of its [8 marks] Show (a) 4 if by 4. by integer N by if and b2 expressed p = 2, N is even p = {akak_l.. .axa\302\247)y if a0 = 0. only if and in b as base only if a0=a1 base p as if and only 3, N is even if and only \\anan_x if its if the = 0. ..axaQ) ^ q,vv, \342\200\242V^ + o . sum digits is even. [11marks] 3 Representation \342\200\242 [10 marks] last digit is 0. IB (\302\251 rsM 5. [12 marks] (a) of its the by and b. digits is divisible Q is divisible by 15find (2al04b)6 the that i down a criterion for the numberto be divisible 6, write base [9 marks] representation in base 6 the last digit is 0 or 3. (b) marks] 7. Use your (c) [8 8. 41012 in base number if a that Prove base marks] (l 1000l)2to base7. the number Write (a) [7 to binary. [AB2F)l6 (b) Convert Q V i+s* \\ 3 practice Write (a) ^ 2008) Organization of integers in different bases ' *bL kh v ^ ^1 vc+^ 1 y> In this you chapter learn: will \342\200\242 how to Linear a tell whether linear equation has variables in 1- two Diophantine integer solutions \342\200\242 how to one find such an solution of equations equation \342\200\242 that 1H one given solution, to construct is it possible Many infinitely only many other solutions. equations which need Such equations are called Diophantine we will learn how to solvelinear involve problems practical solutions. integer equations.In this Diophantine equations results in two using some of the variables 2. in chapter met we chapter solving w h with of equations Examples integer solutions Can 2x + 3y = 5? the equation solve you and y are real numbers, then for every satisfiesthe equation.Sothereare infinitely / 5-2x^1 form of the Xy~ 3 V integers then of x. We can (1,1), (4,-1), pairs, but J 5-2* y = will several find if we However, only solutions be can only usethe values of x for which of experimenting shows that x has +a of therefore can (3/c +1,1 form the - 2k) for write some for values example solution many y an make integer; 5 - 2x is divisible A bit multiple of 3. We for some by inspection, still infinitely not all integer valuesof x will to be x and y an integer There are (-2,3). solutions many require which can find y x we If x we 3. by one more than a to be of the solutionsare that all k. integer is an exampleof a linearDiophantineequation; in several variables where we only seek equation The above a linear solutions. integer only linear Diophantineequations You will meet but there are other types. the solutions,but solutions it may and exist, It is often be possible if they in do, whether course, to find all impossible to prove this whether or not there are infinitely many of them. For example, we can show that the equation x2 - y2 = 122 has no integer solutions as follows.The expression on the left - y){x + y). The two is an even number, so they must be as (x factorises odd. 42 rsM Topic 10 - Option:Discrete As their product is even, factors either differ by 2y, both even they must both be even. which or both But mathematics VS. ^ Q,VVj * ^ (a v ^<+^ + of two even numbers is divisible the product is not. factors Hence suchnumbersx and;/cannot and remainders is very useful when by 4, which exist. Looking solving ) 122 at Diophantine equations. orked example 4.1 the that Show a \\5x factors is often of this terms \342\200\224 equation for Looking 1- the = 17 useful: equation are then number, 35y must 15and 35 Hence 15x be \\a\\\\ number by the same divisible two# divisibleby term third if integer solutions. has no x and V is known x2+ = z2. y2 Fermat famously his theorem. Many was only accomplished applications so far, for y. not divisible by 5, so 15x - 35y cannot extremely interesting and in a over a is of a book, that he centuries tried to find margin the a proof for but this proof, had a by Andrew Wiles, building on new theoriesdeveloped by decades. Although the result itself has not found any over preceding theories turned out to be developed during the search for the proof have in 1995 new the claimed, mathematicians mathematicians several useful. 4A Exercise Explainwhy +G by 5 example of a Diophantine equationis infinitely many solutions,known In 1637, jfjk^* 5. by This has as Pythagorean triples.On the otherhand, the equation This xn + yn - zn with n > 3 has no integersolutions. famous result called Fermat s Last Theorem. +}[ both divisible - 35y must be divisible 17. ec^ual A well are 1H the 6x + equation solutions. 9y = 137 has no integer [3 of the equation15.x -12y marks] (a) Find (b) Show solution one integer pair of numbers of the form x = solution of the above equation. that every = 1 + 5/c y is a = 2 + 18. 4/c, [4 marks] (a) x = that Show 1+ equation 1Ix+ 3y (b) Showthat only one 3/c and = 14 y = for all of those l-llk satisfy the integers k. solutions has both x and y positive. [5 marks] Darya has pieces and 15 piecesof paper.She cuts them into 10 pieces some of the new each. says she must She that small that pieces she now have counted selects each. several of those She then selects and cuts them into 10 pieces has 2007 pieces of paper.Show incorrectly. [6 marks] 4 Linear ^ Diophantine equations 43 vs. Q\342\200\236 \302\243*W ^ * -+ prime positive every pair of relatively m> n, the numbersx \342\200\224 m2-n2, m and n with integers \342\200\224 2mn y x2 + y2 z and \342\200\224 m2+n2 (This so do kc for any integer k. are there? How many solutions We triple, then a Pythagorean c form and and kb ka, generating infinitely triples). if a, b (b) Show that the equation satisfy method for is a \342\200\224 z2. Pythagorean many V *<l+r that for Show (a) [fT] * for solving linear Diophantine in Before we search for solutions, we to find out whether any exist. It turns out that there is a equations need at techniques two variables. look now this. very simple criterionfor deciding 4.1 POINT KEY \342\200\242 The \342\200\242 If gcd(a,b) I c, the c. has infinitely equation no has c by\342\200\224 does not divide if gcd(a,b) solutions ax + equation Diophantine many solutions. In Section4C we \302\253^. ^^ will the left has to that can be found starting really says two things: that we can find a solution; and that part gcd(a,b) I c there are in fact how to find one solution,and solution then \302\253^. one just from of this part second The all solutions see result is straightforward:If both termson hand side are divisible by a number, then that number divide the right hand sideaswell. first The ^^ particular solution. solutions many infinitely To find one solutionwe They the 7th were also studied n such and n are studied been is probably record known BCE. have equations Diophantine earliest and in that am solutions by Sun Tzu in history 3rd use the Euclidean there that century from question of algorithm from there are numbers m if c = gcd(a,b), then m all over the and is one We will first see c. world. The the 3rd century AD and Brahmagupta in *^ J^S^L * *?* + century. Ifc^d but dIc, then is equivalent to ax a (km) + b(kn) c-kd + by \342\200\224sox equation ax + by Topic 10 next section. saw Arithmetico the many. to the + bn \342\200\224 So gcd(a,b). of the equation ax+ by- throughout Diophantus' return if there in the can the previoussection.We infinitely will whenever - Option: Discrete mathematics kd, - c. for some \342\200\224 kd. Since = km integer k. So the equation am + bn and y \342\200\224 it \342\200\224 kn are d, follows solutions that of the orked ' ^ * (* 1^ whether Check 27.x + that such find one Hence V vc+^ 4.2 example (a) Find x andy (b) ^ ^1 15;/ \342\200\224 3. integer solution of the equation gcd (27, 21 x Euclidean algorithm \342\200\224 21. [a) gcd(27,15)= 3, sowe 15) divides the# RHS Apply + 15;/ by \342\200\242 27 = Euclidean can find a solution algorithm. 1x15 + 12 15= 1x12 3 + +0 12 = 4x3 the Reverse steps to write 3 = 27x + 3 = 15-1x12 15ym = 15-1x(27-1x15) = + 2x15 -1x27 So x = -1,y 21 = As from the 3 x 7, we can use the answer' the previous part and multiply whole equation by 7 next section In the linear we will see how 1. Which of these equationshave 7x + + 15(2) =3 by 7: 27(-7) Multiply So x = -7, y +15(14) = 21 = 14 solutionsof all the 4B Exercise (a) 27(-1) equations. Diophantine +a to find (b) = 2 8;/ = 29 (c) 15*+ 27;/= 3 (e) 15*+ 27;/= 35 2. Use the Euclidean algorithm solutions? integer + 6;/ (b) 3x (d) 15*+ (f) 2bc to find = 17 27;/= + 37;/ 30 = l one solution of the followingDiophantineequations: 45* + 20y = 5 (a) (i) (ii) 66*+ 42y = 6 (b) (i) 102*+ 72;/= 6 (ii) 165*+105;/=15 3. Q Find one solution (a) (i) 66*+ (b) (i) 81* 20;/= + 36y of the following Diophantine 12 = 27 (ii) 45*+ equations: 20;/= 25 (ii) 100*+ 35y = 15 (a) Findgcd(45,129). (b) Henceexplainwhy the equation has no integersolutions. 45.x +129y = 28 [5 marks] 4 l ^ ^SV^ + c, Linear Diophantine equations ' * ^ (* v c+^ Find (a) gcd(132,78). (b) For which valuesof c doesthe have one solutionfor g (a) Forwhich \342\200\224 c solutions? integer (c) Find + 78y 132.x equation c = of X values 6. [10 marks] does the equation Ajc + 5y = 7 have integer solutions? (b) for X = solution one Find 14. [8 marks] the general solution Finding how to find one solutionofthe divides c. For example, equation gcd(a,b) we found that the equation 27.x + \\5y - 3 has a solution x = -l,y = 2. This is called a particular solution. But there are other solutions, for example x = 4yy = \342\200\2247. How can we find all such solutions? In the + by ax In the above needs to be we saw section previous \342\200\224 c when if x equation, for the expressionon the left So let x = -1+P,y = 2 - Q. Then: decreased same value. to keep the 27(-l + P) + 15(2-Q)= 3 -27 + 27P + 30-15Q = 3 <=> <=> = 0 27P-15Q 27P = 15Q <=> = 5Q 9P <=> The last integer P = 5/c and Q-9k for equation is satisfied by any /c. Hence the original equation has solutionsofthe form +G x of a solutions + 5k, y = 2- 2k for k e Z. line of the abovederivationwe divided This gives us the generalform for all linear Diophantine equation. 4.2 POINT is one If (x1,y1) d -1 is gcd(27,15). 3 which KEY = the last on that Note by by a certain amount,y is increased \342\200\224 gcd(a,b) kb x-xx-\\ yy = d This is solution of the equation all the then called the ax other solutions + by-c and are given by: ka tor yx ke\302\243 d general solutionofthe Diophantine equation. We now equations. 46 rsM Topic10 - Option: ^ q,vv, Discrete mathematics have a complete method for solving linear Diophantine orked ' ^ * (* 1^ result from Worked To find solution already one found have to find 4.2 example 27*+15;/=21. We ^ V vc+^ 4.3 example Use the ^1 gcd(o, now can We \342\200\242 need# solution we the general the general solution of the equation One solution qcc\\ (27,15) \\e x = -7,y= 14 = 3 b) use the formula x= \342\200\242 = -7 + -7 + 5/c 3 *y = 14 27k 3 = 14- 9k Exercise 4C 1. Find the of the solution general following Diophantine equations: (a) (i) 45*+ (b) (i) 102*+ (c) (i) 66*+ (d) (i) 8bc (a) Use the 6 72;/= 12 20;/= + 36;/ (ii) 66*+ 42;/= 6 (ii) 165*+ 105;/= 15 = 5 20;/ (ii) (ii) 100x+ 35;/= = 27 of solution 162*-78;/= Show a general equation [11 marks] 38 are relatively prime. solution equation55.x- 38;/ 1. that 55m n such m, integers Find the 12. that 55 and (a) (b) Finda pairof (c) 15 Euclidean algorithm to find gcd(162,78). (b) Findthe general +G 45*+ 20;/= 25 of the - 38n= 1. Diophantine = Find all pairs of points with [11 plane which lieon theline 3x+ 5y 2\302\273J Solutions subject Sometimesa Diophantineequation there are somerestrictions on the One of the mostcommon constraints solutions to be positive. t*J ' in the coordinates integer to = 13. x-y [8 marks] constraints is set types marks] in a context where of solutions is requiring allowed. all the 4 ?3n Linear Diophantine equations orked ' ^ * (* 1^ the Notice by 15 to has only the whole divide can we that 45;/ = 300 75.x + equation equation ^ V vc+^ 4.4 example Show that ^1 both x with solution one 5x \342\200\242 + and y positive. 3y=20 make the numbers smaller of the general then look for solution find can We k and the in which x, y In this we can case, inspection. (If you find don't solution one see it, use solution: Particular terms\342\200\242 of k values x = 1,y=5 for >0 solution: General by the x = 1+ 3/c,y=3-5/c Euclidean algorithm) Use the condition x > =1 god (27,15) x>0=>3/c>-1=>/c>0 0, y > 0* y>0^>5>5/c^>/c<1 = 1, so .\\k is there only one solution positive (* = 1,y=5). Exercise 4D (a) one Find pair (b) Find all the solutions with x, y x, y such that of integers of the equation integers. positive 5x 5x + = 42. + 8y 8y = 42 [11 marks] (a) Find gcd(62,74). +a 2. equation 62.x- 74y \342\200\224 show that the above equation has infinitely many with both x and y positive. [13marks] the (b) Find (c) Hence solutions (a) Find the general solution of the general solution of the 132*+78;/=6. (b) [4~J (a) Find You all the a pair have with | x solutions of scales with 12 g and 9 g weights.What measure using these? (b) Could you are weights (c) If you the 48 Topic 10 - Option: Discrete mathematics ^ q,vv, are scales, measure how allowed does < 20. weights by 13 g [14 marks] an unlimited supply more different replaced only \\ Diophantine equation of objects of can you weights if all the 12g ones? to put the weights on one sideof that affect your answerto part (b)? ' ^ * (* 1^ ^ ^1 V vc+^ * J Summary \342\200\242 The \342\200\242 One m,n equation Diophantine solution by-c has integersolutions solution) (particular that such ax + am + bn can be = d; then one solution found by is x1 = if and reversing the c c solution general \342\200\242 Sometimes there is x = x1H are constraints , y on the = y1 if d Euclidean - gcd(a,b)divides algorithm c. to find 1- \342\200\224m>y1=\342\200\224n. d d \342\200\242 The only for k solution so that 1u e Z. only some values of k are allowed. +G 4 Linear Diophantineequations \342\200\242 rsM 49 vs. ^^N*. .on\" * (* ' ^ 1^ examination Mixed Find (b) integers Use the such that m and n + = 41 that 27 and 59 are relatively Diophantine [13 marks] to the of solutions and justify common divisor of 7854and the greatest find to diophantine equation your answer. [7marks] IB (\302\251 (a) Find the why (a) For of X (b) Find the generalsolution find 50 Topic10 - Option: that ^ q,vv, there 102p + Discrete rsM 3$) a general \342\200\22417 has no integer for solution solutions. equation equation Xx + 3y X = such = 5 have 4. that of the integer solutions? [9 marks] 5m + 3n = 17 equation 5x+ 3y = 17 x, y integers. (c) Find the two that 2008) [13 marks] does the (a) Find a pair of integersm, n (b) Hence the \\y x, y e Z. \342\200\224 15 with values which 45.x +11 equation of solution 45.x +111 y Show Organization gcd(45,lll). (b) Henceexplain (c) Find the general with prime. = 1. + 27n 20. number the 59m the of EuclideanAlgorithm state to show algorithm (c) Find the generalsolution 59.x + 27y = equation 3315.Hence 7854.x 3315y V vc+^ 4 practice (a) Usethe Euclidean ^ ^1 \342\200\242V^ + o 72<j solutions are no = 1800. mathematics which minimise positive integersp and |x |+1 y \\. [13 marks] q such [11 marks] *~ * (a K^ +/\302\273 In this Modular \342\200\242 rules for with working called remainders, arithmetic you chapter learn: will modular arithmetic \342\200\242 to how solve equations involving remainders, called linear congruences \342\200\242 to solve how simultaneous congruences Can find the number? little last digit you A thought \342\200\242 a shortcut of 333333without evaluating the leads us to realise that this is really powers for calculating modular in arithmetic. about divisibilityand remainders:What is the remainder when 333333 is divided by 10? In this section we will with remainders that enable us to investigate rules for working a question answer questionslikethis one. Introduction: Look after about how After clock the 7 hours? When you numbers time will it show after 12 hours?What After 19 hours? hours many answers: many infinitely what clock: the at working remainders with is concerned, clock show 5 o'clock? Thereare 14, 26,... We could say that, as far as will the 2, all these numbersarethe is 2.What other by 12 the remainder 2 when divided by 12? Again, there remainder give many answers:2, 14,26,50,...As is concerned, all thesenumbersarethe are congruent modulo 12. they by 12 If If divide 38 are infinitely +G same. far same. as division We say that are you VSB? Maths, you as an example in the classes equivalence meet also will congruence of Further studying Sets, Relations and Groups option. divided by 12,what give? Trying some examples that the remainder is suggests always 4. Similarly,threetimes the number remainder 6. In the next sectionwe will gives in general,but first let us look at that similar rules hold prove a few more resultsconcerning division by 12. We will need the a number remainder remainder gives does twice 2 when that number > following result: KEY POINT 5.1 number n gives remainder r when n-kd + r for some number k. If a divided by d then is This <^1 division met in just the algorithm we <^] Section 2A. A3 5 Modular \342\200\242 arithmetic 51 rsM VS. ^ Q,vv, orked ' ^ * (* 1^ (a) If x givesremainder6 and 7 gives when the following are divided by (ii) x +y -y (iii) 5.1 point and then do the remainders find 12, 12. xy \342\200\224 does 2. give remainder not y form in the numbers the Write divided by 3 when the remainder x an exampleto show that (b) Find ^ v vc+^ 5.1 example (i) x ^1 from x = /\\2k (a) Write Key# = 12m + + 6,y 3 calculations the Write the resulting expression the 12q + r and identify the in form# (j) y = x + (12k + 6) + = 12(/c+ m) remainder Hence x + 3) (12m + 9 + y gives remainder 9. = (12/c+ 6)-(12m + +3 12(k-m) (ii) x-y 3) = Hencex \342\200\224 y gives remainder = 6)(l2m + 3) (iii) We want the remainder to be even and when always a it is, we can + 36k + 3k = 12(12km + 3k Hencexy gives 12 whole number (l2k + = 144km = 12(12km smaller\342\200\242 than The result is not xy 3. +15 6m) + 13 + 72m + + 6m remainder 6 \342\200\242 find several (b) different remainders If x = which 436 and y = gives remainder 27, then examplesuggeststhat we can add, multiply remainders, but we needto be careful them. In the next sectionwe will prove these circumstances general, and investigate under what perform Exercise 5A In 1. (a) example 4 try 5.1. to produce and when dividing in assertions we can gives remainder 2 when If x 12, what divided by divided by 12, what remainder does3xgive? (i) subtract proofs similarto thosein (i) If x givesremainder5 when remainder does 2x give? (ii) If x (b) 16 division with remainders. 1 to questions Worked - = 6. The above +a +1) + 6 gives remainder 5 when divided by does 4x give? 13, what reminder 7 when (ii) If x gives remainder remainder does4x give? 52 Topic 10 - Option: Discrete mathematics rsM 3$) ^ q,vv, divided by 13, what * ^ o (c) (i) (ii) 2. (a) *Vt>. If y gives remainder remainder 4 when divided by if y gives remainder remainder 2 when divided by does (c) If a number givesremainder4 when what remainder does it give when divided (d) If a number givesremainder4 when what remainder does it give when divided divided (a) (b) for by 12, by 3? by 12, by 4? divided by 3, what by 5, what by 9? divided by 15? by 15 and b gives remainder what does divided by 13and n gives by 13, what remainder does 4 when remainder divided when gives remainder 2 when divided by 3 and y gives remainder 1 when divided by 3, what can you say about x + y\\ If x Describe which 2 both and 3. by all numbers start some new by introducing give 1 when remainder [4marks] arithmetic Rules of modular We 15, give? divided +a what by 5? divided (b) If a number givesremainder3 when remainders can it give when divided 4. (a) If a givesremainder4 when divided remainder 5 when divided by 15, a + b give? by divided 3. (a) If a number givesremainder1when remainders can it give when divided mn what by 3? divided remainder8 12, by 9, divided (b) If a number givesremainder3 when what remainder does it give when gives what give? yA If a number givesremainder1when remainder does it give when divided (b) If m 12, give? y3 does V +r +<*< notation and terminology arithmetic. modular We say that a is congruentto This is written as a = b b (modm). modulo m if m The definition \\ (a - b). has several implications. KEY 5.2 POINT If a = b (modm) \342\200\242 a and \342\200\242 we b give write can then: remainder when divided by m the same a \342\200\224 km + b 5 Modular It*' ^ <K vv, \342\200\242V^ + o arithmetic * (0- ^ ' vC^r^ V +r* -+\302\253<; + ) is usually used to checkwhether two numbers are congruent modulo m, and the secondfact is often used in if a < b, then k needs to be Note that proofs. negative,but this is first fact The not a problem. 1- orkedexample5.2 Show if a that = b(mod m) and c = d(modm) We need to write equations a and b, and c and d. Use We have + (b + Nm a + written d), so use the a+c=b+ then Write a connecting* the second Then point above a + c in \342\200\242 form the second point above again = km + b, c = b) + (\\m c = (km + = (k + l)m + (b a +c=b + d(mod d) + d) w h POINT \342\200\242 ka = other rules of modular 5.3 = b(modm) \342\200\242 a + + + t m) proofs can be producedfor arithmetic, summarised here. If a \\m Hence Similar KEY m). rf(mod kb(mod c = b c = and m) for m) then: d(mod all k e Z + d(modm) \342\200\242 a \342\200\224 c = b \342\200\224 d(modm) +G \342\200\242 ac = bd(mod \342\200\242 a\" = b\"(modm) With practice, m) for all n e doingnormal and arithmetic, becausewe areworking x = 5(mod6)then 3x In with calculations 'reduce' to the with = 15 multiple in some smaller is just as quickas sense even easier, numbers. For example, if = 3(mod6) so (3.x) =9 = like this, we should always steps 3(mod6). possible remainder smallest are never arithmetic modular doing N. after than each step, so we m. calculating larger It is sometimes convenientto use negative remainders, if this produces smaller numbers. For example: 98 = i U 54 Topic 10 - Option:Discrete - Q,vv^^ VVl + -2(mod with lOO), so 982 numbers = (-if = 4(mod100). mathematics vs. 01. I ^ .on\" ^ o 3 ' v,h +4, orked 5.3 example Find the remainder when 230 by 13. is divided \342\200\242 Start by evaluating small powers, then look at the smallest possible and V -f^ 23=3(mod13) remainder Square both To get power 30, raise to the 26=64 sides* power 5 \342\200\242 = 12 = (26)5= (-1)5= -1= .\". 2?\302\260 gives If you 41 = 4 42 = 43 look at find will -1(mod13) remainder 12(mod13) 12. a number is raised to a power you start to repeat. For example: they eventually when remainders that 10) (mod 6(modl0) = 4(modl0) 44 = 6(modl0) So all even powers of four give a remainderofsix when divided by ten and all odd powersoffour a remainder of four. If we were give askedto find the last digit of 4312(which is equivalentto finding the remainder when dividing by ten) we couldthen write immediately down the answer: six. +G 5B Exercise 1. Find the (a) (i) (b) (i) (c) (i) 2. Find following 513(mod7) (ii) 419(mod7) 615(modl2) (ii) 35131(modll) (ii) 29223(modll) the (a) (i) remainders: following 522(mod25) remainders: 316+ 7(mod5) (ii) 212+3(mod7) 47-22(mod7) (ii) 66-37(mod5) (b) (i) (c) (i) 532+323(mod6) (d) (i) 6x518(mod7) Findthelast Find the digit of (ii) 753-653(mod4) (ii) 8x321(mod5) 22223333. remainder when 5544 [4 marks] + 4455 is divided by 7. [7 marks] 5 Modular it*' ^ Q, VVj arithmetic * (a ' a- V +/\302\273 it number suchthat 4, find the last digit of 23x +1. x is that Given last digit 3 Given that a whole + b)5 = (a 2 (mod has 2X [4 marks] 5) show that b) = 2(mod5). {a + >> [4 marks] 1- Division and linear congruences So we have far used addition, powers to be ableto divide. wheredividing both subtraction, multiplication To be ableto solve in congruences. and we also equations need we have already seen examples the same number doesnot work.For by but 5 ^ l(mod 12). In this section we will example,15= 3(modl2) see that there are some situations where the division is possible. However, sides = b(modm) d. To start to be divisible with, both sides have by by d, as we can only work with whole numbers. For example, starting from 48 = 3(modl5)we cannot divide both sides by 2. However, 3 = 18(modl5), sowe can replace 3 by 18 on the righthand side to get 48 = 18(modl5). This can be divided by 2 to give 24 = 9(modl5), which is correct. Suppose to divide want between congruencesand POINT KEY both sides of a equations. 5.4 If a = b(modm) a = then m) b\302\261m(mod words, we can add or subtract one sideofthe just congruence. In other +G can We use this to make already.It turns out that coprime POINT both sides divisible can we d This rule 10 - they are not number which is both a and b and gcd(d,m) = 1, = \342\200\224 \342\200\224(modm). then Topic by any d if to 1 If a = b(modm),d divides 56 divide by of m 5.5 Division rule if 5x a multiple m. with KEY difference an important illustrates calculation above The we that d says that, = 15(mod24) for example: then x = 3(mod24)as When d and m have some common factors change the modulus when dividing. For 5 is coprime with 24. to example, we saw that we have Option: Discrete mathematics t*J W ^ Q,VVj vs. ^ o 11* >b. +4\302\253 l(mod 12),so by 3. However,5 = l(mod4),so 15 = but 5 ^ 3(modl2) sides if m is also divided by seems division the both divide just to work 3. 5.6 POINT KEY cannot we -f^ Division rule 2 If a = i a b, .m. d d d a, b and m, divides d and b(modm) then: = \342\200\224 \342\200\224 (mod\342\200\224) ' I a = If 3 rule Division I m) and b(mod d divides b, then: a and both I a _b m mod d d gcd(d,m) For example,if 6x= But gcd(6,15) we 6(modl5) so we = 3, also have can divide to both sides by 6. by 3. the modulus divide Hence x = l(mod5). see can We this works why if we rewritethe congruence as equations: this At we can stage = 5k 2x then 6x = 15k+ 6. = 6(modl5) If 6x only divide both sidesby 3: +2 As 2x and 2 areboth even k must also be even, so write k-2n to get: 2x = + 2 10n can divide by Now we x 2: - 5n +1 and hencex = We can x for linear KEY now solve linear ax = which equations, congruences; that is find the values The method is similarto solving b(modm). some of the rules are different. although 5.7 POINT If ax 5). l(mod = b(modm) then: \342\200\242 we divide can both sides by d if we alsodivide gcd(m,d) \342\200\242 we add can ^ Q,vv, a multiple \342\200\242V^ + o of m to only one side. m by of ' \"~ * (* V c+^ orked 5.4 example Find the valuesof x such 2x = (a) that: 7(mod5) divisible by 2. can We It is both sides by 2, add 5 to the right = 1, so gcd(2,5) = 8(mod9) not* 7 is but divide <=> 2 by 2x = (a) side hand we can now 7(mod 5) (mod 5) = 12 2x ^> x = 6 \342\200\242 smallest positive* to reduce to the customary + 5 (d) 25x = 10(mod30) to divide need We 6x (b) (c) llx = 5(mod8) x = <^ \\ (mod5) (mod5) remainder be any number which gives = l, 6,1 1,... divided by 5, i.e. x x can that means This remainder1 when or-4,-9,... Start We to divide need by 6, by so add 9 to so side sides both Divide by 6 x on isolating gcd(6,9) the one side* right keep adding to by 1 1. Alternatively, RHS the 5 = &(mod9) 6x + <^> 6x = Z)(mod9) <^=> 6x = \\2(mod3) divisible by 6 it is = 3, so divide until it by 3 is divisible* as 8x is always a multiple we can subtract 8x from = 2(modZ)) <^ x the* modulus We could \342\200\242 hand (b) of the 8, left (c) \\\\x = <^ Z>x = 5(mod&) <=> 3x ^> b{mod&) = 13 x = = 21 (mod &) 7(mod&) +G We don't have to are divisible by divide by 25 one in 5, and we must go. can by 5 divide now 5x to divide remember the modulus by We (d) 25x Both sides* = 10(mod30) = 2(mod6) 5 again \342\200\242 5x x = &= = ]4 = 20 (mode) 4(mod6) numbers x examples there are infinitely many the all the same However, satisfy congruence. they give In the first remainder when divided by the final modulus. modulo 5, and in the second example the solutionis unique In all of these which exampleit is uniquemodulo3.Note the solution is not unique modulo modulus): x couldgive remainder Linear congruences the next 58 Topic10 - Option: fsM 3$) ^ q,vv, Discrete mathematics example. do not that in the 9 (which 1, 4 always have second was the or 7 when a solution example, original divided by 9. as shown in * ^ o orked *V*>. 5.5 example Solve 3x = 5(mod 12). keep to the 12 adding divisible Solve the following linear 15x = 7(mod11) (c) (i) 5x = 30(modl5) = (d) (i) 12x + 2 4x+ 7(mod9) (e) (i) 2hc= l8(mod9) = 9(mod (ii) 4x (ii) 1 lx (a) be a multiple are no of of 3 3. solutions. (ii) 3x (ii) lbc-2 (ii) 15x 15) 9) = 18(mod9) = 3x + 5(mod9) = 60(mod24) [4 marks] 13). linear congruence 3x = 12(mod21) giving in the form x = a(modm). Solve the Q never because 5 is not a multiple So there = 7(mod linear congruence 5x = 7(mod Solve the answer 5 + 12/ccan \342\200\242 congruences: (i) 3x = 7(mod 11) (b) (i) 3. This by ...(mod12) 5C Exercise (a) it adding 12, which is a multiple of 3, to 5, which is not we are because is never make can we seems 41 = by 3 divisible It 3x = 5 = 17= 29= sides by 3 we needto* right hand side until it is to divide both In order v +^ +<*< the linear why Explain your [4marks] 6x = 4(mod9) has congruence no solutions. +G (b) Solve 6x (c) List all | x | < = 3(mod9). the equation in (b) which satisfy of the solutions 10. [8 marks] 6x = 3(modl5), (a) Solvethe linearcongruence answers in the form x = a(modl5). (b) How many 2 Q Given that modulo solutions have? = 147(mod63) be 3x + y = 21 (mod smallest positivevalue of the linearcongruence [7 marks] your answer. 63 does Justify 5) and x a such giving your \342\200\224 = that x y 7(mod5) = a(mod5). find the [8marks] 9 Chinese remainder theorem Consider remainder the following 2 when find all numbers which give 3 and remainder3 when divided by problem: divided the language of congruences from the previous to solve simultaneous congruences: by 5. In we are trying section, 5 Modular it*' ^ Q, VVj arithmetic ' a- * (a V ^<+^ fx = 2(mod3) |x can list We = 3(mod5) each congruenceseparately both lists.To keepthings see and simple, let us the positive solutions. just list x solutions for ones appear in which = x = 2(mod3): x = 3(mod5): x = 2,5,8,11,14,17,20,23,... 3,8,13,18,23,28,... found two solutions:8 and 23.We can see that in the first list we need to add a multiple number any of 3 and for any number in the second list a multiple of 5. Henceto get another number which is in both lists we needto adda multiple of 15. This means that every solution is of the form 8+ 15/c,in other words x = 8(modl5). Although there are infinitely numbers that satisfy this congruence, the many we have So far to get The remainder Chinese *jt theorem was first by the down written dpra^ Chinese mathematician Sun in the 3rd century CE and solutionis Tzu republishedby 1247. were Its in first Qin This is applications Diophantine also solving but it has equations, found uses in public in cryptography 20th in Jiushao an example of the followinggeneralresult: 5.8 POINT KEY the If century and ml theorem remainder Chinese key 15. modulo unique then the are coprime m2 simultaneous congruences x = x = a(modm1), b(modm2) have a unique solution(modm1m2). result The moduli the orked pairwise 5.6 example of linear the system Given are of congruences,as longas coprime (so any two are relatively prime) to any number generalises congruences: x = 2(mod5) +G x = 7) 3(mod x = 5(mod 13) (a) Find (b) Hence We down write can solve idea good x which number one the solution the first two to start satisfies all three congruences. with the of the system equations two first. smallest It is in a the x = form \342\200\242 x = {a) moduli x = 60 fsM W Topic 10 - modulo Option: Discrete mathematics ^ q,vv, \342\200\242V^ + o 35 x 13 17(mod35) 5,13,31,44,57,70,33,96,109,122 17(mod 35) is unique 3,10,17,... x = 1(mod13): We now make a list for the third equation* and compare to all the numbers which are answer 2,7,12,17,... 2(mod5): x = Z){mod7): So This a(modm). x * = 17(mod35): (b) .\\x = 122 (mod 17,52,37,122 455) ^ o ' 11* >b. +4\302\253 becomes finding a solution by inspection An alternative is to rewrite the congruence more time-consuming. as a Diophantine We will illustrate this method by an equation. numbers As get larger, method The <^[ of was given 32 are and modulo unique relatively prime, 31x32 = 992. We each is* just to need solution equation for x* as an congruence 32), x 12 (mod solution the find one Write 4B. = 21(mod 31). remainder theorem, I3y Chinese x = c(mod992) \\Ne can x = write 32a + 12 21 + Hence 32a <^=> is a so we know equation, Diophantine to find one how* solution + 12= 31b+ -311? 32a W (*). Both x from should give us the solution (we This is the solution same equations for xshould check!) god (32,31) = \\,and So 9 = 32 x 9 - 31 From (*), x = 21 = 9 1 = 32 - 31 x 9 :.a We can now find the is solution x = 31b This <^[ in 5.7 example Solve the simultaneouscongruences x = 31 equ- Diophantine ations Section As for finding a solution example. orked V +~ = 9,b =9 300. /. x = 300(mod992) mod(992) +G Exercise 5D 1. the Solve following (i) x = 3(mod5),x (a) = x = (ii) (i) (b) X = By first the (a) 2(modll), 0(mod2),x x = (ii) 2. simultaneous 0(mod3), solving 4(mod7) x = 4(mod5) = 2(mod5),x x = = 4(mod7) l(mod4), x = l(mod5) an appropriate simultaneous following congruences: Diophantine equation, solve congruences: (i) x = 6(modl9), x = 6(modll) (ii) x = (b) (i) x (ii) * = 6(modl3), 15(mod31),x x = 3(mod22) = 2(mod30) = 4(modl7),;c = 9(mod24) 5 ^ q, vv, Modular arithmetic * (* ' \"~ V C+r* ) of congruences: this system Solve (x = 2(mod3) [x = Solve this x = (a) [6 marks] 5(mod7) system of linear congruences: 3), 2(mod Find the smallest 5x = l(mod7). 1- 5), x = 6(mod x = 0(mod [8 7) positivevalue the of (b) Hence system 5x = l(mod7), x 3(mod5) solve of x such that linear congruences = Solve these 5) (mod [8 marks] 2(mod 3) Solvethe system x = 0 [7 marks] simultaneous linear congruences: 3.x= 2 5x = marks] of linear congruences: 31). 3(mod 17), x = 21(mod [10 marks] (a) Prove that the system of linear congruences: x = 2(mod6),x = 4(mod9) has no solutions. Find the generalsolution 6m-9n = 3. (b) (i) (ii) Hence the solve x = 2(mod6), Diophantine equation: of congruences: system x = 5(mod9). [10 marks] theorem little Fermat's the of We have already answeredquestions such as: find the remainder when 517 is divided by 7. We start by evaluatingsmallpowers if we can spot a pattern: and see +G 52=25= 4(mod7) 53=5x4 = We can 6 = get closeto the power17by 515 Hence 517 gives -l(mod7) raising this to the power of 5: 515=(-l)5= -l(mod7) = -4 = 3(mod7) = -1x4 x52 remainder 3 when divided by 7. in these Our strategy is to keep evaluating powers problems until we get remainder1or-1 and then 'jump to a multiple close to the requiredpower.But how do we know that this will ever happen? For example, lookingat powers of 3 modulo 12, we find that: 31= 3(mod 12),32 34=3x3 = ^ W 62 Topic 10 - = 9(mod 12), 33 = 27 = 3(mod 12), 9(modl2) Option: Discrete mathematics ^ Q,ri vs. %** + \342\200\236 .Ok\" ^ o ' 11* >b. +4\302\253 V -f^ * the remainders alternatebetween3 and It seems that will never get remainder 1.In this powers give In allthe examples to need we theorem little I Fermat's | lip is a prime and a is any the congruence littletheorem. by not a a is following special multiple both sides of can divide caseof Fermats The proof from of p then now a good have Group strategy for finding of Fermat's uses ideas Theory, a branch of Discrete Mathematics studied in Option Relations and ap-l=\\{modp). We theorem *SEG? little is a prime and a is not a multiple If p a). when we prime get the a to - p\\(ap a(modp). 5.10 POINT KEY that extract even moreinformation of p: as a andp arerelatively ap = then integer This is equivalentto saying We can 1- 5.9 POINT KEY When pattern. the following a prime, modulo the remainders of powers we are looking at remainders result tellsus how many powers find before they start to repeat. a periodic follow odd powers remainder 9. so far seen have we so we 9, that all it seems case, all even 3 and remainder / 8, Sets, Groups. remainders. orked example 5.8 Find when remainder the little Fermat's theorem jump 2828 is divided by 13. is useful because we to a high quite We can squarethis to get can* 24* =>2<324=12=1(mod13) +a We now just by 284# to multiply need 28 = 2(mod 13) When we are little Fermats same theorem little =>28>12=1(mod13) power power Fermat's looking at divisibility by a compositenumber, theorem may need to be usedseveraltimesin => 2&2&= .\\ 2&z&Q\\vee by 13. 2d4 = 24 remainder = 16 = 3(mod13) 3 when divided the question. orked Prove that We first example for 5.9 n,n7 all integers factorise 42 see to - n is divisible which primes by 42. we need to look \342\200\242 42 = 2x3x7 at 5 Modular arithmetic 63 vs. ^SV^ + c, .on\" * (a -V ' a- 1 ^ - ^ \\ v +^ continued... there is Because n7 Fermat'slittle in the theorem we can question, for divisibility by 7: Divisibility use* little theorem, I3y Format's by 7 = n7 n(mod7) -n). 5o7\\(n7 little* Now lookat divisibility by 3: Fermat's theorem can only be used to get to n3, but we can then apply other rules of congruences by 3: Divisibility little theorem, I3y Fermat's = ri5 =^> n6 ^ n7 n(modZ)) = n2 (mod3) (square both sides) = ri5 = =^> n7 Similar strategy works for \342\200\242 2 by divisibility - = = =^> n7 have We proved divisibility (mod2) n4 = (n2 )2 = n7 - m and hence by = n \302\253 ) (mod 2) is divisible by 2, 3 and 7 42. \\ worth noting alternative divisibility by 2 could have an even number to any any is odd; power odd,so their n7 +a = factorising: n(n3-l)(n3+l) l)(n2 +n + l)(n 1 are threeconsecutive of them is even and at least one of Exercise product Find the is divisible 41) n +1) integers, them is so at least one divisible by 3. Hence by 6. (b) 11) (i) 411 (mod (ii) Find Option:Discrete S^-V*1 the (mod 37) (ii) 518(mod7) 724(modl3) remainder 539 (ii) 517(modl7) (d) (i) 525(mod3) ? \342\200\224 \\)(n2 remainders: following (a) (i) 342(mod (c) (i) - + 5E 1. Topic 10 and an either both and n + their noting that -l) = n(n n,n-l the odd number to even or both proved Secondly, we could have n are 3 together by \342\200\224 \342\200\224n n(n6 First, by simply proved is even and n7 is even. difference here. approaches been power hence by 2 and divisibility 64 (multiply n2 sides) by -n). 2\\(n7 It is U (cube both L* I i little theorem, n4 (mod2) Therefore 3 and 7* by 2, line) n(mod2) =>n6 =n5 But first m). I3y Fermat's So (from the by 2: Divisibility n2 by n ) (multiply n(mod3) 31 (n7 So (modi) when (ii) 1231(modll) 3532 is divided by 11. [5 marks] mathematics f - * o Kx^, h* +(3. (a) Prove that x25 = x ' + ^ + ^ \" , , (mod 13). (b) Hence solvex25 = 5 (mod 13). x12 (c) Explain why the linearcongruence has no = 5(modl3) solution. Q Leta [8 marks] 17. Showthat a17 + b17 is number show that a prime p is that Given numbers such that a also divisible by 17. two whole b be and p that p | (x* + j^). \\ {abp - that all apb) for [6 Show by [3marks] number greater than 2 and let x and a prime be divisible + b is positive integersa, b. Letp v -f^ marks] such y be [7 marks] p2\\xp+yK Summary \342\200\242 a = that: means b(modm) m\\(a-b) a and b - we can add, \342\200\242 We can add are - subtract \342\200\242 The congruences= x \342\200\242 Fermat's and remainder Chinese a{modmx), ifp is theorem same power. congruence. division: a, b d divides d divides theorem x = and m, then both a a b m d d d = \342\200\224 \342\200\224(mod\342\200\224) f a _b = and b, then ~j mod - ~j m gcd(d,m) says that if m1 and m2 are coprime then the b(modm2)has a unique solution(modmlm2). either by inspectionor by little and raiseboth sidesto the a multiple of m from just one sideofa if a = b(modm) and be found that and multiply congruences, rules for if a = b(modm) by m + km. or subtract special when divided remainder same a-b write can \342\200\242 We \342\200\242 There the give solving says that ifp prime which doesnot divide a Diophantine is a prime then for a then ap~l = system of linear This ,t> ^ ^ q,vv, \342\200\242V^ + o can equation. all a, ap = a(modp). A consequence l(modp). 5 Modular l,sM solution arithmetic is * (* \"~ ' Kx* V C+^ examination Mixed 5 practice Use Fermats littletheoremto find 14112is when remainder the divided by 11. [5 [3 of 432. last digit the Find marks] Solvethe linearcongruence Show that (a) (b) Find [6 13. by 7. is divisible [6 marks] [6 marks] [4 marks] = congruence 12.x 36(mod32). the linear Considerthe 1= x12 + equation Fermat s little 7y, where theorem, show that x, y this D+. e has no equation IB (\302\251 the remainder when 45 (a) Find show that Find the last two 410w+2 = (c) digits in the Solve the the simultaneous Solve x = 0(mod2),x UseFermats Show that 536 gives (b) Find the remainder divided x = when that 7120-1 536 is divided is divisible by 143. [5marks] 17. by 13. simultaneous congruences,find the when remainder 536 is [8 marks] be a primeand gcd(a,p) show that x = ap~2b(modp) (b) [4 marks] = 3(mod5). 221. by = [7 marks] [7 marks] remainder 13when divided by = 1. (a) Letp ax expansion of 442. 14(modl7). to show theorem (a) (c) By solving base 5 congruences: = 2(mod5), little 2007) Organization 16(mod25). congruences x = 2(modl3),x of linear system solution. [9 marks] by 25. is divided (b) Hence marks] [6 marks] gcd(32,12). Solve Using 1). in base written when + 55552222 22225555 = 5(modl 3x last digit of 560 Find the marks] is a Use Fermat s little theorem to solution of the linearcongruence b(modp). Hence solve the systemoflinearcongruences 2x= 1 (mod 31J, 6x = 5(mod 11). [7marks] Find your (a) the solutions answers in the all State Fermat linear congruence 120.x= 110(mod65), giving = form x /c(mod65). [5marks] of the s little theorem. (b) Prove that, if p > 3isa primethen p- i^Jcp k=\\ 66 fsM W Topic 10 - Option: Discrete mathematics ?\302\243*\302\273. \342\200\242V^ + o = 0(modp). [4 marks] ^ (a +r \342\200\242+<*<; In this chapter theory Graph you will learn: \342\200\242 that different many of real-life types problems can be solved graphs using social do What of a the structures, traffic flow and common? One answer is that molecular networks, \342\200\242 about In this chapter we will at basic look graphs, and in the nextwe routes arounda network. will graph \342\200\242 how to \342\200\242 how some recognise types of graphs special properties of to finding optimal them and different ways of representinga mathematical apply of features main a graph syntax language mathematical structures they can all be studiedusing graphs, which are normally represented as a set of pointsjoinedby lines. seem an abstract mathematical concept but they Graphs in a wide variety have of unexpected applications places. many in have to prove important some theorems about the numberof verticesand edges in to Introduction In this sectionwe precise for and the the problems started different of moving ways around a graph. are intended the development the need for are introduced in this we develop in the next. understand and theorems that definitions chapter \342\200\242 about typical problems that can to find a solution, attempt some be solvedusinggraphs.You should if you but don'tbe disappointed can't; to illustrate the sortofdifficulties that of graph theory. They should help you the graph graphs introduce will a algorithms Thetable belowshows of direct cost the flights between ten cities. Beijing Cairo \\Dubai cost($) 213 +G Frankfurt 96 52 412 450 526 186 250 212 250 315 234 320 52 Frankfurt 450 186 250 36 526 250 315 325 212 234 Moscow 350 312 Sydney 225 524 1. Can from you find Athens 2. Canyou each To answer 428 216 combination cheapest once and the first question, approaches. in this caseis Athens-Dubai-Sydney whichthe initial flight is We 387 the at least city 215 combinationof flights can either it to of flights to return to the starting 312 350 225 312 524 387 216 428 243 243 get visit city? one of two fewest legs,which or we can try the one in expensive, which would be is tempting to try try the route with the least 6 ^^VNc*. Sydney 386 215 312 the cheapest to Sydney? find 325 36 386 486 Moscow 486 320 65 York York 65 412 Johannesburg New New Johannesburg Graph theory 67 * ^ (a TTzere ts ^<+^ this solving called problem, Dijkstras it in section 7C. Travelling in w///]^> its solution investigate 7E. Section testing possible It is not even obvious sometimes exactly the directroutebetweenthe two cities is not the cheapest one. Even all the routes in which each city appearsjust once checking doesnot seem to be an easy task. It turns out that usually the only routes, way to solve this type of problemis to checkallpossible and this is not feasible. However,therearesomeclever generally to estimate the cost of the cheapestroute. ways Salesman ]^> problemand we best is in fact The second problemis even moredifficult. that the bestroute shouldvisit each city the called is This more Athens-London-Johannesburg-Sydney. It is not clearthat this is the cheapest without checking lots of possibilities. You can that if we had 100citiesinstead of 10, the imagine in a reasonable time. problem would be impossibleto solve route e> Algorithm. meet will We Athens-Frankfurt-New York-Sydney. However, reveals that neither of theseis the cheapest. The an efficient method for fe> v The the table from information once, as represented as a can be cities) are joined by diagram which points (representing lines(representingdirect Such a diagram is called a of problems are used in practical graph. Where these the can consist o f of points or applications, graphs lines. An example similar to our problemis a satellite which tries to find the shortest routebetween places system, in routes). types hundreds navigation two and choice of many has a impossible for time,so we found the best Is this as proving to program roads and junctions. It is such a problem in a reasonable a computer to do this. \\ it mathematically? introduces a computer the computer to program possible solution? the same different to solve a new set of problems. We need to solveall problemsof this type, not just one particular one. This means that we need to have a method, calledan algorithm,which finds the best always possible solution. Suchan algorithmhas to have a well-defined based on guessing' sequence of steps, and cannottake shortcuts or experience'. It must also be efficient so that it can perform the task in a reasonabletime.Checking all possible routes is Using Would you say that if we a computer to try program all possible routes, we can be certain that we have need a human not practical, and the timeit takes size of the graph.A typical computer +G increases rapidly can perform with the around 3 billion operationspersecond;checking all possible routes for if our second problem would take arounda millisecond, but we increase the number of citiesto 15it would take around 5 minutes and with 20 citiesthis goesup to 500 years - not very practical if you are waiting at the travel agent! Here is a different This studied in by result first \342\231\246Jf Euler Leonhard and 1 836, regarded 68 was problem 4fjjfk is usually as the first of graph any lines published theory. Topic10 - Option: Discrete fsM 3$) without ^ cl \302\243%*.. mathematics lifting problem: your more than Is it pen off the once? possible to draw paper and without this shape going over ' ^ (* After I^C+/- for a while you trying is equivalent to saying, for may decidethat prove the that that example, out ofa singlepieceofwire. Can the shapewould need to change Later we will V of out cannot be made why? What feature of become possible? This problem is the one of the point. we will study in the rest of for this This is each that features to feature key numberoflinescoming of graphs important this chapter. it This impossible. the shape explain you for it is is problem to Eulerian related ]^> graphs, meet ]^> 6F of Section in will we which this chapter. sUfl Definitions In solve to order some new In this terminology. conceptsassociated with are called graphs. of vertices consists A graph with graphs it is usefulto introduce section we will define various problems called adjacent if they So adjacent. The the relevant; the may edges only So the AC, BC of the vertices graph are graphs above have and vertices edges are the shape that matters we draw of the edges is which verticesare diagrams below represent the samegraph. intersect at points other than vertices, soit is the The vertices thing edge. Two Two two importantto label +G and vertices edges. an vertex. When a common have a graph,the positionofthe arenot connected by adjacent if they arejoinedby clearly. usually vertices A, B, C and by capital letters. Sometimes we need to showa situation where we can only move in one directionbetweenvertices,for example when In a road network with roads. such cases we modelling one-way can put arrows on the edges to indicate the alloweddirection. In The is called a directed graph, or digraph. resulting graph to get from D to A but not from A to D, 1, it is possible Graph while both directions between A and B are allowed. 4fjjfk beginnings and many many century. Because were its findings of century developments important early 20th in the 1 8th the in its with mathematics, motivated by applications it has had contributions from many different communities: mathematicians, computer For these linguists. the terminology different slightly books. other reasons some is not so you standardised, even and chemists scientists, of Graph 1 relatively new branch of D and edgesAB, BD. is a theory Graph \342\231\246Jf labelled yet may definitions For example, and edges are alsocalled and firmly find in vertices nodes The terminology we use will be used in your what arcs. here is IB examination. 6 Graph ^ Q\342\200\236 t**W theory 69 ' * *- (* V -^^<+/- *%** a simple In is joinedto itself(no no vertex graph and loops) SoGraph 2 shown multiple edges betweenvertices. Some theoremsof simple. alongside, graph theory only when apply to simple graphs, so it is importantto note this them. A graph in which there are somemultiple learning edges are no there is not called a is sometimes a graph When 2 Graph to complicated multigraph. canbe convenient has many vertices and edges it In such cases it is more draw. to representit an adjacency numberof edgesjoining You pair A B C D thai a assume graph A 0 1 0 0 this unless is simple B 1 0 1 0 explicitly C 0 0 0 0 0 is stated. for Graph table the 0 1 1 D ^ and 2 is: v B c 2 1 2 0 0 1 0 0 A 6.1 POINT KEY the 1 is: Graph not should shows the For example, of vertices. each adjacencytable for This table table. by graph, all entries on the leadingdiagonal to bottom right) are zeros, and all other entries 0 or 1. a simple \342\200\242 For left (top either are \342\200\242 The adjacency table of an undirected graph is symmetricalabout the leadingdiagonal. +G I of edges number The of that coming out of a vertex is calledthe For example, in vertex. degree Graph 2: deg(C) = 1. Notethat when calculating the degree, we count the edge A to A twice, as each joining edge has to have two ends. in the adjacency table the numberin the (A, A) cell However, is 1, because thereis only one edge joining A to itself. The list deg(A) = 5, deg(B) = 2, of degreesofalltheverticesofthe graph is called its sequence. It is usuallygiven in descendingorder;for 2 has degree sequence 5, 2, 1. Graph example, 6.2 POINT KEY degree of a vertex is equalto the sumofthe numbers of the adjacencytable corresponding to that vertex. If there is an edge connecting a vertexto itselfthat edge needs to be added twice. The degree in X? 70 Topic 10 - Option: Discrete mathematics fsM vs. w ^ cl \302\243%*.. the row or column * ^ (a ^<+^ we will prove severaltheoremsabout the number of edges and vertices of different of graphs. types will show that there are restrictions on what the They degree of a graph can be. Herewe show just one interesting sequence result about the degreesequence ofa simple graph. In section next the v You to want may review the pigeonhole principlefrom Section <& <& IB before reading Worked next the example. orked 6.1 example Showthat This sounds like the type of principle. and be 'pigeons', can vertices The we* problem using the pigeonhole solved are always two vertices with graph there a simple in the possible values the of the same degree. Suppose the graph has graph is simple, the of a vertex is 0 and smallestpossible the n As the vertices. degree one is largest n -1. degree 'pigeonholes' There seem to be n pigeonholes! they all appear in the same is a graph? there are in only n fact the verticesmust group of each 4fjfi in a football same number +G be expressed can in people there are league, different various who two at each point in the have ways in the same season there graphs So there n different 1 n to principle, two same degree. pigeonhole have 2, or the the for - 1. of the For example, contexts. number of friends the in have that path betweenevery cannot be splitinto two two vertices. parts. that the graph results in this course This means Most of the the at look will We various of types paths in moredetail in 6F Section For ]^> chapter. moment of this we just the ]^> use mean a route between two graphs. vertices. Not are some or group; played the term to Connected There in situations is modelling need to move between vertices.It is therefore to know whether it is possible to get from onevertex important to another.A graph is called connected if every two vertices are in other words, there is a connected(directly or indirectly); connected to - are two teams where we with - 2. of games. Oneofthe main applicationsof deal is n the so -1 possiblevalues either 0 Hence,by result degree possible degree degrees: This with no 0, then If other vertex is connected to it, largest \342\231\246w vertex But can* special types of graphs which you connected need to know. 6 Graph ^^%\302\253. theory * \"~ * (\302\243 v +r ) graph is a graphwhere A complete \\ are joined by an edge.A vertices is K\342\200\236. for symbol pair every a complete of vertices graph with n 1- 1h KEY You may 6.3 POINT be asked fn\\ to give explanation8 and prooMor mod results of edges in K\342\200\236 is vh this m 0Hhe The number chapter. This is because there is an edgecorresponding to every vertices, and selectingtwo n can from vertices pair of fn\\ be done in v2y ways. vertices can be splitinto two X and Y, such that edges only join vertices in X to those groups, in there are no edges joining verticesin the same group. Y, and If every vertex in X is joinedto every in Y the graph is vertex calleda completebipartitegraph and denoted Kr s, where r and s arethe numberofverticesin groups X and Y, A graph bipartite is a graph whose respectively. +G orked example 6.2 * \342\226\240^ Show that the How many of edges in number edges How from start many each vertices Kr s is vertex are there rs. are e in X?* There in X?* There are r So there edges vertices are re each from in vertex in X. X. edqee in the graph. J. 72 Topic10 - Option: Discrete mathematics fsM 3$) v Brn**1 + 01. * ^ (a ^<+^ connected graph in which there areno closed paths i.e. it is not possible to find a sequence of distinctedges returns to the starting vertex. is a tree A (cycles), which Not a tree Tree KEY POINT 6.4 vertices has n A tree with n this that Note to is the with a graph make a tree - 1 edges. smallest possible number of edgesneeded n vertices connected, so if any one edge of is removed the graph You need is no longer to be ableto prove the above connected. induction is common theory becausewe can think of'building adding verticesand edgesoneat a time. orked example that the base up' the number and is given in graph any graph by 6.3 Use strong inductionto prove Prove about result of edges of a tree. The proofusesstrong in the next example.Proofby induction +a v case. n = 1 is the only We that will a tree check base case with n vertices later* needed has n - 1 edges. When n = 1: The tree with one has no vertex the statementistrue for Assume How let the statement n = k and look edqee, eo n = 1. is true for n< all at a tree with k. k vertices. 6 Graph ^SV^ + c, theory * ^ (a v ^<+^ ) continued... It is to tempting and one edge to get k - 1 verticesand k - 2 edges. tree, and of the tree the need We We can However, 'end' the from to easy to explain not have apply the why this is the removed any inductive edge. any This splits trees-. If the the connected there but of the a cycle, is which numbers of verticesof trees be a and b. case) vertices* =k Then a + b Both a and b Hence the . are less than of number edges + (b-1) +1= (fl + So the statementistrue that Note we only need case, as when graph into two n = n = 2 we graphs a conclusion.\342\200\242 1 as the for also can split the true true for vertex of the n < all for all k we n = n by b)-1 for istrue for The statement true the base with one k, so trees two original was (a-l) should always write 1h new two the inductive hypothesis applies: The have a -1 and b -1 edges. hypothesis* 1edge; impossible. Let the tree We removed edge back would removed the form separate graph was still would be another path remaining putting then two into graph betweenthe endpoints identify we can use strong can take out any edge to into two smaller trees (we we induction, split not is it with a tree out Take But since a vertex. such to be need would vertex this vertex* out one take and try n = = k-1 n = k. ], and if it is is statement is can prove that it k. Hence the strong Induction. each Another We will graph the in ]^>result this prove type of graph is a planar graph.This is any be drawn in the planesothat the edges do not important that can cross. Not every graph is planar;for example itis impossible K3 3 without any edges crossing. next\"^^> section. to draw +G A This ]^> is called a Hamiltonian cycle, and we w///]^> study it in more in Section 74 of path type Topic10 - by detail 6G. Option: Discrete planar graph its adjacency may edges crossing,or given redraw the graphin its planar form, be drawn with table. To strategy is to lookfora closedpath which includes of the graph, draw this first, and then fit other path around it. Note, however, that such a closed path does not edges exist. always one good all vertices mathematics fsM vs. 3$) ^ Q,VVj * (a ' a- V ^<+^ + example 6.4 orked Graph G is given by the adjacency following B o 1 0 1 1 1 in planar G G with alphabetical order and path 1 1 1 c 1 1 0 1 1 D E 1 1 1 1 1 1 0 0 0 0 1- form. draw First table. A 1 Draw ) vertices a find which includes all the in* closed vertices Dm Hamiltonian Redraw G so that this cycle: A5DCEA a* forms path C pentagon Then fit many and as you then in the other can inside edges. the Put as pentagon, the others round the outside +G theory Graph ^SV^ + c, / - 75 .ON * ^ (a ' K^ V +/^ ) Exercise 6B 1. For eachofthe shown graphs below state the number of vertices andthe numberof edges. 1- 1h Gl 2. For 3. Copy ticks and to the of each +a graphs complete mark G2 G3 G5 G6 above list the table correct the degrees of the vertices. to classify the graphsabove.Use options. G2 G3 G4 G5 G6 wrTTnTtfSfZril Simple Complete Tree Bipartite 4. 76 Topic10 - Option: Discrete Represent each of the graphs above in an adjacencytable. mathematics fsM vs. 3$) ^SV^ + c, a- * (a 5. represented by the following the graphs Draw (a) 1 ^ (i) A A (b) (i) A (c) (i) 1 a 0 0 0 1 0 0 1 1 0 1 1 1 1 1 0 0 2 1 0 the drawing vertexforthe 1 1 0 1 0 0 0 1 0 1 0 1 0 0 1 1 1 \\B 1 \\D \\C Bin 0 2 0 1> 0 1 1 0 9 o 1 2 0 1 0 0 2 E3 o 1 0 1 2 2 0 0 1 2 0 2 write down graphs, the 0 0 0 1 1 1 0 0 the degree of each B A C \\D i i 1 1> 0 0 1 a 0 0 1 a i 1 0 0 \302\243\342\226\240 1 0 0 tables: adjacency following 1 2 E +G (b) (i) A \\B \\C 1 1 0 1 2 0 0 0 1 0 0 2 0 2 0 3 o \\2 lfsM ^ \\E \\D o 1 Q, \302\243^% \\E 0 1 1 0 1 1 1 1 \\D \\C o A (a) (i) \342\226\240mraramn<\302\273> 0 1 1 1 0 1 0 2 0 2 1 1 0 with graphs (ii) D \\C 0 0 D \\E tables 0 2 \\B o BB \\D \\C 1 Without 1 1 0 6. 9 1 \\B A 0 1 A (ii) 1 1 0 0 1 D \\D \302\243 \\C \\B 0 0 2 1 2 0 1 0 0 1 2 0 0 2 i+s* \\ adjacency 1 0 2 0 1 (ii) D \\C \\B - ^ 2 2 0 3 0 (ii) A \\B 2 \\C D 1 1 3 1 2 0 1 2 0 0 D 3 0 0 0 1 * (a ^ ' K^ V +/^ Draw each 7. graph in planarform: 8. Showthat (b) Z^t A (a) of the each graphs by listingthe two is bipartite sets of vertices: B A (a) F tu\\ (b) V C 9. Draw an exampleof eachofthe (a) A simple, connected graph with 6 vertices,eachof degree2. (b) A non-connected simple, graph with 6 vertices, degree2. +G M following: A simple, (d) A multigraph (e) A simple, (a) Draw with bipartite the graph (b) Draw the graph (c) Prove graph with 6 vertices, connected (c) each of degree3. degrees 2, 2,4,4,4, 4. graph with 7 vertices and 11edges. 6 vertices with K5. K2 3. f\342\200\236\\ number of edgesin the graph Kn that the each of is K2J [7 marks] The graph (a) Write Kn has in (b) Showthat vertices the down a vertex 36 edges. Find the value smallest a simple in with and the connected a simple the same connected of largest possible degreeof graph with n vertices. graph there 78 Topic 10 - Option: Discrete mathematics 3$) ^ q,vv, \342\200\242V^ + o must be two degree. (c) Draw an exampleofa connected multigraph vertices with degrees 1, 2 and 3. fsM [3 marks] n. with three [8 marks] ' ^ V I^C+z- Some In this sectionwe will graphs. You so they are shown orked be will as Worked coming the exam, 6.5 of the degrees of all the verticesin number of vertex is the of a out of proofs for examples. of edges. degree important to learn these expected sum the properties of some prove example Prove that The theorems important it; of a vertex we are actually Every edge edges' the This result is known as TheHandshaking lemma, can be of as handshakes edges thought representing as people. It is used in proving many other theorems, the one in the next example. two so each edge vertlcee. two vertlcee, the because and ends, the number when adding up the degrees of all each edge is counted twice. Hence edges counting has corresponds to the degree in determining so to twice is equal a graph vertices as such orkedexample6.6 are {Below graph, the in any that Prove two proofs number of verticesof odd degreeis even. of this result; the first oneis shorter, one may second the but be more obvious.) > is the What or to y main better give of function intuitive proof: To establish understanding the the of truth of the result? Which of result, to be elegant, the two proofs do you prefer? vertices?The that the can to try we do What know about degrees oftells us lemma Handshaking of all degrees an expression write sum is even. So we of for the sum all degrees First Froof Let a be the number of vertices degree, and b the number odd degree. The sum of all degrees is the sum of even numbers and b odd numbers: ^degrees = (a evens) odd + odd = even but odd + even + odd + odd = even \342\226\240 = odd I3y the handsha the I3ut the even If king lemma, LHS is even. always even, be even. of odd numbers can only be is an even number of them. bracket must second sum there a + \\b odds) is of even numbers so the first bracketis even. The sum Hence with even even even of even of vertices Henceb is even, as required. 6 Graph theory ^^%0c. f - * ^ (a v ^<+^ + ) continued... Froof Second can We think edges, up a building vertex by adding a single from about how about think and graph \342\200\242 single vertex and of vertlcee of with a a graph In vertices and edgee, the number the degrees degree is zero, change as we do this build can \\Ne is even. which up any graph a sequence by types of operation: an edge between two existing of two add 1. no odd vertices 2. 1 only Operation the which vertices two need We of* are being connected. the degrees changes different to consider cases, depending on whether thosedegreeswere or odd before the extra edge was even added an add 1: The With extra of the two degrees vertices \\ncreaeed are connected being vertex by 1, and remain unchanged. were even, they are two degrees odd so the number of odd verticesis the rest If the now increasedby 2. two degrees even so the number If the wereodd, they vertices of odd now are is decreased by 2. If one of the degrees was even the and other one odd, the first one becomes the eecond becomee even. So odd and the number of odd degreee remains unchanged. Operation2 does not existing vertices. of* degrees change The new vertex has no edges that Remember we started vertices of the with yet of* number odd degreeequal to zero With 2: The degree of the zero, which is even. The other don't change. odd degreeremains number So the Hence number as we build of vertices new vertex is degrees of vertices of unchanged. up graph, the the of odd Increaseor decreaseby degree can 2, or remain as an even always remains even. unchanged. As it started number, The rest of the results in this it section concern planargraphs. the edges do not intersect, is divided into a certain number of regions.Counting the plane outside' as one region, the graph shown overleafdivides the into 6 regions. In what follows,we denoteby/the number plane of regions, v is the number of verticesand e isthe numberof edgesofthe graph. So for the graph overleaf, v = 5, e - 9,f= 6. The resultin the next example is called Euler's relation. When 80 Topic10 - Option: Discrete a graph is drawn so that the mathematics fsM 3$) ^ vs. cl \302\243%*.. .Ok\" ^ * (a ' K^ V +/^ ) 1- Euler's relation \342\200\242 \342\200\236 in the in me is \" Formula \342\200\242 given booklet. orked example 6.7 Prove (You sure that As we are can try to apply with working of the number edges and verticesof v a graph, we from the a strategy previousexample:build up the graph see by adding vertices and edges, and how the numbers +a e, To keep the graph connected, whenever we adda vertex join we it to e + f = 2. a connected In have graph.) with a a graph v=\\,e=0,f=\\,eo \\Ne we will proof up any connected build can single vertex and v-e + f = Z. of operatlone of two sequence add an edge betweentwo (i) no graph edges, by a types: existing vertices f change and v \342\200\224 is not true if the graph is not connected. In the always is about result this planar graph, this result that check can to make a connected for that have a vertex and (ii) add of the existing to an edge joining it to one vertices. something (i), v remains With and flncreaeee one of So now the we v -(e by regions unchanged, e 1 the because increases by new edge splits into two. have + \\) + (f + \\) = v - e+f theory Graph ^ Q,VVj 1, / - 81 * ^ (a v ^<+^ continued... a new vertexand an \342\200\242 edge 'sticks out', so it any of the regions into we add When new the edge, not does split With elncreaee (ii), v and by 1 f remains but unchanged, because none of the existing regions into two. are split two So now we have (v + /l)-(e In case either change, so a stretching Euler'sformula in the the value is always +f v-e v \342\200\224 + f e doee not ec\\ual to 2. first was In that faces). imagine = for polyhedra (three dimensionalshapeswith discovered polygons for the number of vertices, edges and faces.You can v, e and f stand polyhedron being turned into a planar graph by making a hole in one face and it out flat. The face with the hole becomes the 'outside' region. Euler's relation for it + i) + f case, was study objects EXAM HINT Both of these branch in the holes, There are two results are first The ^ booklet. +G other one simple, connected, example of vertices for planar graphs, and the numberof edges. example 6.8) appliesto any planar graph. The second one (provedin 6.9) applies only to certain planargraphs. (proved Worked results important number the only involving Formula the in given with platonic solids. It is now an important tool of mathematics called topology. to classify used originally of solid \342\231\246Jf 4fJ\302\245i in Worked orked example6.8 for a that Show (a) show that (b) Hence There is no simple, connected, the complete connection of verticesand edges of except that e>n-l if the graph is connected. So there is something special about planar graphs.We know one equation that could be relevant: the Euler'srelation fsM W 82 Topic 10 - Option: Discrete mathematics ^ q,vv, three or more vertices, not planar. in general, graph graph K5 is the number* between a planar graphwith (a) Euler's relation: v-e+f=2 e < 3v - 6. * ^ (a v ^<+^ continued... Each region has at and each edgebelongs Can we find athe number of regions need to eliminate f. We between connection and the of vertices number or edges? means to belongs regions, twice. So counted it is that two to two exactly \342\200\224 ,l.e.^ 5oe>\342\200\224 Then which in three edges, regions. Each region has at least three edges. Sothe total number of edges is at least 3f, except each edge least e=v+f-2 fact e<v + => e < ^> 3 + 2e 3<5 < 3i/ ^> 2e o2 -6 - 6 3i/ ae required the result to Apply k5 (b) k5 has So 3i/ v = 5 and = 9 < e, hence - 6 e - = 10 [\\) K5 is not planar. We saw in the previous sectionthat the complete graph bipartite = 6 and e = 9, so it K3 planar. However, this graph has v satisfies the e < 3v 6 for planar graphs. To show that inequality is not we need a second result,which applies only to K3 3 planar three planar graphs with no 'triangles'(cycleswith edges). 3 is not orked (a) Showthat +a if a then triangles (b) 6.9 example e < 2v - that show Hence simple, K3 3 planar graph with connected, 4. is not more than threeverticeshas no planar. than the one in the previous Worked example, because (Note that this is a strongerinequality - 4 < 3v - 6 \342\200\224 2v v > 3. For has v = 4 and e \342\200\224 6 so e>2v A, but the graph is still example, K4 for 3.) planar The result does not apply to this graph because it containsclosedpaths of length This looks example, cycles of very similar to region previous* for the condition except length the 3. This means has at that least 4 (a) relation: Euler's of no v-e+f=2 each edges. Each region has at least four edges (as the smallest closed path is of length 4), and each edge belongsto exactly So e> f < i.e. \342\200\224, two regions. \342\200\224 2 2 Hence, e<v+--2 2 <^2e<2v <=> + e-4 e<2v-A ae required. 6 ^SV^ + c, Graph theory * (* ' \"~ V C+^ + ) continued... need We contains Apply result from to make sure that no cycles of length (a) to this \342\226\240 k3 3 graph the for three (b) K55 has v = It has no triangles, 3x3 because group So 2v - 4 include two = <3 < e, = 9. = \302\243 vertices to each other. joined to have result to apply 6 and a triangle from hence k3i3 the would same 1- is not planar. 1h Exercise 6C 1 to Questions 3 concern the following A four graphs: _D A^ (a) (b) (c) (d) +G 1. Verify 2. Write 3. Q that down the the Handshaking number lemma of vertices holds for of odd degreein Draw each graph in planar form and verify holds for each graph. A planar graph has 5 vertices and each graph. that each Euler divides the planeinto graph. s relation 4 regions. 84 Topic10 - Option: Discrete have? edges does the graph an example of such a graph. (a) How many (b) Draw [4marks] mathematics fsM 3$) ?\302\243*\302\273. .ON\" ' \"~ * (* V C+r* * Draw a simpleconnectedgraph in or following degreesequences, which the vertices have the does not exist. one why explain ) (a) 3,3,2,2 (b) 3,3,2,2,1 A 10 vertices has graph (a) How (b) Show [9 marks] 2,1,1 2, 2, (c) many that and each vertex has degree5. does the graph have? the graph cannot be planar. edges and \302\247J Subgraphs Sometimes we want to in coloured G. and blue In the on the concentrate of both When we graph. Hence if the graphshave G' marks] vertices which The is the graph with the same each pair of verticeswhich are the diagram shown here, the edgesofG are edges of its complement G' are red. the edges take [7 complements are not joinedto each other, rather G complement of a simplegraph verticesas G, and an edge joining not adjacent 1- than those that are. G and G' we v vertices a complete get and G has e edges, \342\200\224 e has edges. K2J Sometimes subgraph A we are only interestedin certainedgesin a graph. of G is a graphwhich contains some of the only edges of G. In the diagramalongside, a subgraph red. Note that every complete graph with graph n vertices is highlighted in is a subgraph of the Kn. +G 6D Exercise 1. Draw the complements ofthe (a) . (i) following graphs: (ii) Graph theory 85 fsM ^ q, vv, \342\200\242V^ + o / - .ON * ^ ' K^ V i+s* (b) 2. (i) Find the adjacencytables for the complements of the following graphs: (a) B o 1 1 H |o 3. For of the each exactly (b) D 1 1 0 o 0 0 0 0 0 1 0 1 0 0 following C B e 1 0 1 1 0 0 0 0 1 1 graphs, draw all subgraphs with 4 edges: (a) 4. Show that each of the following graphs contains subgraph: (a) Topic 10 - Option: Discretemathematics m (b) K4 as a D 1 0 0 0 a- * (a * v -^<+\342\200\236 + Draw a graph G with that G such 5 vertices and its complementareboth connected. Show that a (a) marks] [3 bipartite graph cannotcontain K3 as a subgraph. show that (b) Hence 1- bipartite graph with more than is not bipartite. complement is a if G 4 vertices,then its ) [7 marks] Moving around a In on we problem, we whether which you to return to the starting All names must learn. of adjacent edges.A path and a trail isa walk with no vertices, is any walk be required ways of moving around a grapharegiven different these may every vertex, or there may be restrictionson are allowed to use each edge morethan once. visit vertex, A of getting ways the theory we are interestedin from one vertexto another.Depending of graph applications many different graph no repeated sequence is a walk with repeated edges. B c ABCDE: a path ABCBD: not a path, but ABACD: a trail not a trail +G ends at the same vertex and has it is a (so is a closed path).A circuit repeated walk that starts and ends at the same vertex and has no repeated edges(soitis a closed trail). Note that if there are no repeated vertices then there are also no repeated edges;henceevery cycle is a A cycle no walk that is also starts and vertices other a circuit, but not every circuit cycle. JO B_ D ABCDE is a A: cycle and circuit A ABCDBEA: circuit but not cycle Graph theory ^SV^ + c, / - 87 .ON ' * \"~ (* V C+^ + orked 6.10 example For the graphshown (a) List (b) in the diagram: all paths of length3 fromA List all to D. the cyclesof length4 starting (c) Find a trail that uses This can only be done A ) each of length 4 A cycle Some vertices will 1h Think where can go from different vertices has four different vertices* appear more than {a) A3CD, AE3D, we* four 3 has 1- at B. ending exactly once. edge by inspection. of length path and AECD A (b) 3CEA3, 3ECD3 (c) EA3EC3DC once* ^^ In the nextsectionwe will see that ^^ can only be solvedfor somegraphs. questions like part (c) ^^^ ^^ Exercise 6E +G 1. down Write all walks of length 3 from A to D in the following graphs: (a) 88 Topic 10 - Option: Discrete A b (b) mathematics vs. ^ q,vv, **+\302\253. .on\" a- * (a * 1 ^ - ^ v <+/* \\ + ) 1\302\253 (d) (c) 1- 2. Find all cyclesof length4 in the from graphs the previous question. Find the numberof different given verticesin K4 if n Find the (c) 4 number of different given verticesin K4 if n [5 marks] of length walks two n between is: (c) 4 (b) 3 (a) 2 J\\ two n between is: (b) 3 (a) 2 of length paths [5marks] Eulerian graphs The +G islands bridges is considered problem to be the first in graph theory. Two banks of the river are represented by verticesof a graphand the and problem published two bridges Konigsberg by its seven edges. The resulting graphis: Euler Leonhard > 1783) was a S who contributions to is responsible problem is to find a closed walk that each uses once. This corresponds to crossingeachbridge and returning to the starting point.It turns out impossible, and the searchfor developinggraph verticesofthe graph. theory. The an explanation reason lies in edge that exactly once exactly this is led Euler to start the degrees of the today: mathematics. of for much still notation mathematical The the base of natural in use a f[x) to represent function, X to represent as made mathematician immense many branches He (1707Swiss sums, e logarithms and i as the simplest imaginary number. Is new notation new mathematical knowledge? A3 6 Graph theory 89 VS. ^ Q, \302\243%*.. ' \"~ * (* V C+^ each edge exactly walk that uses A closed circuit. an Eulerian A circuit is called an Eulerian with graph is called once an Euleriangraph. 6.5 POINT KEY Eulerian graph every vertexhas even degreeand it is to find a closed walk which uses each edge exactly possible In an once. This result canbe explained vertexwe must go in out and to the also applies This follows. as which uses of it, starting vertex,as end. So the numberof edgesat time we Every edges. to it at the be even. must vertex each up two return we visit a orked example 6.11 In the that Show an in the graph Determine the Eulerian graph degrees Konigsberg bridges problemisnot Eulerian. of all vertices* all vertices have even* number of +G odd with ^u, ^^ must be (Key odd each bridge the and walk graph at the is there odd degree, and the walk degree. to the starting point, it exactlyonce,becauseofthe each edgeexactly once is called semistarting point) called an Eulerian trail. In a which uses to the semi-Eulerian end is graph Eulerian. a walk returning Eulerian, ^u, ^^ eo the 6.6 with graph (without degree even point 6.4)so we cant have just one vertex with A odd decree, to cross KEY POINT vertices have result: following that the vertices are not requiredto return is impossible Remember 3, 5, not if we Even vertices: All degree 3, 3 Degreesof are must exactly start two vertices with at one of them and other. trail is equivalentto drawing the graph without up your pen and without going over any edge picking more than once. This is a good practicalway to check that you have found an Eulerian trail. Finding The the end that can 90 3$) Topic 10 - Option: Discrete mathematics ^ cl \302\243%*.. is similar explanation difference fsM an Eulerian that the starting vertex only an 'in have odd degree. an Eulerian graph,with the vertex only needsan but' edge and to that for edge,so they are the only two vertices a- * (a * 1 ^ - ^ v <+/* \\ * ) orked 6.12 example Showthat the graph following is semi-Eulerian and find an Eulerian trail. C B the need We Degrees of the of all the vertices* degrees A are eothe vertices, starts trail and can start at so we odd ends at the A and end Route algorithm inspection exactly graph vertices: = 4JP=1IE=2 two vertlcee of odd degree, is semi-Eulerian. trail: A5CAECD Eulerian at D graphs <^^ Eulerian and semi-Eulerian ^^ \342\200\242 = 2,C = 3I0 There The Eulerian 1- in Section will be used 7D. in the <^^ ^^ Exercise 6F 1. For each graph shown (a) yJK below say whetherit is Eulerian, semi-Eulerian or neither. (b) +G theory Graph ^ Q, vv, / - 91 .ON * *~ (a * v \342\200\242+<*<;+'- + ) (d) (c) 1- 1h 2. the of Which graphs given by the following adjacencytables are Eulerian? LA (a) 0 1 o \342\226\240a 11 H 1 J* C\\D | 1 E 1 1 0 0 1 0 0 1 0 0 1 D (b) El 0 0 0 0 1 1 1 o o \342\226\240H K3 D o B 0 i 0 i i i 1 i D 0 0 0 0 Bt m A B lo 1 ll 1 0 Two graphs, G and H, areshown (c) 1 1 i 0 1 10 1 lo 0 lo 1 C D E F 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 0 0 0 0 0 1 0 0 1 * below: C D S\\ 'E if i +G (a) Explain why (b) i H G Find Explain Eulerian an G is not Eulerian. Eulerian why the graph circuit in H. shown below [5 marks] and is semi-Eulerian, find an trail. ^ 4 ^ [5 marks] i U 92 Topic 10 - Option:Discrete mathematics VS. I - .ON' * A Hamiltonian path in a graph visits each vertex exactly once and cycle visits eachvertexexactly starting vertex.Not every graph has if it does it is calleda Hamiltonian graph. Show that the following a a Hamiltonian the cycle; Hamiltonian graph is Hamiltonian: cycle by inspection* is a AC5DEA easy way to check that a graph is Hamiltonian, except by finding a Hamiltonian cycle.Thereis onecriterion that is sometimes useful: If in a connected, simplegraph Hamiltonian is Hamiltonian. graph There cycle, so once. returns 6.13 example Find \\ graphs to the orked V ^ ^1 c+^ 1^ Hamiltonian A Hamiltonian ' \"~ is no n vertices each vertex has degreeat least graph is Hamiltonian. This implies that is Hamiltonian (as each vertexhas degree there are many degrees.Two Hamiltonian examples graphs are shown with n \342\200\224 edges, complete every where here: a then the graph n - 1). However, vertices have smaller cycle and a cube. /I / / 6 ^S^Nn,. Graph theory * (a v i+s* + Problems is no good or not. will Hamiltonian about Exercise is Hamiltonian salesman Travelling 7E. in Section problem difficult as there a graph tackling the this when see can be whether decide to criterion We graphs 1- 6G 1. Find a Hamiltoniancyclein each of the following graphs: B (a) (b) F K E G7\\ i \\H V N C D (c) ( f \\A \\d \\g B T E I c (d) (^ 9 +G 2. (i) (b) (i) Find cycles, Topic10 - Option: Discrete 3$) ?\302\243*\302\273. \342\200\242V^ + o mathematics following graphs and find a Hamiltonian cycle: K4 (ii) K5 k44 (ii) the number one of identical.) fsM of the each Draw (a) 94 ) of distinct K3;3 Hamiltonian cyclesin K3 which is the reverseofthe other, are 3. (Two considered [4 marks] 1h ' \"~ * (* V C+^ * ) Summary A of all the verticesis equalto twice of edges. number the verticesof odd degreeis even. A In a simple no loops are there graph In a connected it is graph In a vertex is The number of 1- by its adjacency table. be represented can graph of each direction. edges have a digraph In out vertex. of degrees sum The joined by edges. The numberof edgescoming of vertices consists graph the degree of that or repeated to find possible edges. a path betweenany complete graph every pair of verticesis joinedby an two vertices. The complete edge. graph with fn\\ n has K\342\200\236, vertices, edges. V27 is a graph with A tree A A tree with n cycles. vertices has n groups of edges suchthat has two graph bipartite no -1 edges. from edges only different groups are adjacent. A The \342\200\224 e + drawn without \342\200\224 2 planar graphs: relation) (Euler's f edges crossing. for connected hold relations following v can be graph planar e<3v-6 e < 2v - 4 are no cyclesof length3 (e.g.for if there of a simple graphconsists ofall The complement the a bipartite edges which graph). are not present in the originalgraph. A contains subgraph Different +G only of walk types some of the edges of the originalgraph. around a graph Path: A walk with no repeated vertices. Trail: A walk with no repeated edges. Cycle: A closed path. trail. A closed Circuit: In an Euleriangraph eachvertex which each uses edge A semi-Eulerian trail between A Hamiltonian include: exactly once graph those two has even \342\200\242 possible to find an Eulerian circuit and returns to the starting point. has exactly two verticesof odd degree. Itis possible tofind verticeswhich useseachedge exactly once. graph has a Hamiltonian returns to the starting It is degree. cycle, which visits each vertex an exactly once ^ Q,vv, \342\200\242V^ + o and point. Graph fsM Eulerian theory / - 95 .ON * (* ' \"~ V C+^ * examination Mixed practice (a) Draw the (b) Show that the complete (Two cycles,onewhich (c) List all the graph is the Hamiltonian which of the two (a) Decide 6 graph with 4 complete vertices, K4. has Kn reverse \342\200\224 of the cycles in your graphs shown K4 Hamiltonian different (n-l)! (a) Construct (b) List (a) (b) [8 marks] graph. below is Eulerian, each - Option: walks in the this graph. of length 3 from B to D. Discrete ten matches. team plays and justify Eulerian graph from part (a). A teacher exactly five impossible. [5 marks] [7 marks] table for Prove that the sum of degrees of all theverticesin a graph the numberof edges. Eleven teams take part in a school football league,so each this is Topic10 circuit an adjacency all the to play 96 Eulerian an Find cycles. other, are consideredidentical.) your answer. (b) ) wants to produce matches in the first is equal team a schedule term. Show to twice has such that that [7 marks] mathematics fsM vs. 3$) ^ Q,VVj ' \"~ * (* V C+r* given in the G is Graph diagram A show that (b) Hence Q the Find (a) a planar that Prove (a) G graph cannot have be drawn cannot in planar form. [7 marks] of a complement,G', of graph of edges number 3. of length cycles G with n vertices and e edges. (b) Write (c) Hence show that of edges in number the down G and G'canboth be trees (d) Draw a graph G suchthat A graph (a) e edges G has the that Show a tree with sum G and G' are n vertices. if n- only 4. both trees. [8 marks] and n vertices. of the degrees of the verticesis twice the of number edges. (b) Deduce (c) (i) an even G has that number of verticesof odd degree. connected, planar and divides If three regions. (n -1) verticeshave degree G is Graph degreed, determine (ii) For eachpossible d), the (n, described in draw a graph exactly four one vertex has exactly plane and of (n, values possible the into d). which satisfies the conditions [9 marks] (c)(i). IB (\302\251 (a) Prove that a bipartite graphcannotcontain (b) Show that the (c) Is K4 4 Eulerian? bipartite complete Justify your graph K3 4 cycles of odd is not Hamiltonian. two connected length. answer. (a) State Eulers relationfora simple,connected, planar graph. resultfora simpleplanar (b) State and prove the corresponding with 2007) Organization components. [8 marks] graph [12 marks] 6 ^SV^ + c, Graph theory In this you chapter will learn: \342\200\242 how of Algorithms a tree find to minimum 1- on weight all the connects that graphs vertices of the graph algorithm) (Kruskal's \342\200\242 how to the shortest find path between two vertices (Dijkstra's in question are very large, it routes. It is thereforeimportant optimal to have algorithms which can be implemented on a computer and are guaranteed to find the best solution. In this chapterwe will meet several such algorithms. We will also see an example ofa problemfor which such an algorithm does not existand we can only estimate the length of the shortest possible route. algorithm) \342\200\242 how In to the shortest find route around the graph each uses which at least edge once (Chinese postman problem) \342\200\242 how to the shortest find to find difficult be the graphs where applications can route around the graph each which visits vertex at least graphs Weighted once (Travelling salesman In problem). it. a that is called number This time distance, edge has each graph weighted or cost a number associatedwith the weight, and can represent the of travel between the two Note vertices. not the actual lengthof the edge, and that there is no and draw the graph to scale. Also rememberthat not intersections of edges are verticesof the graph. this is need to try all For the example, A network the to between and travel ^7 B 17 \302\243L +c< travel between go either alongside could graph numbers different a road (in minutes) taken So it takes 17 minutes to junctions. B and E. To get from B to junctions via A (which could represent be times takes 19 minutes)or via D C, you (which can takes 12 minutes). When a graph is large,it may ]y^ D^ J V 5 to draw it be possible not it using instead, we can represent in the numbers weighted graph of the edges.The adjacency table above graph.Notethat all graphs 12 an table. adjacency table the represent the showing here represents the we consider in this chapter the the cost adjacency It is matrix. possible to perform algebraic operations on matrices to r^ *v various deduce of a 98 - 4fJ\302\245i called is also edges \342\231\246Jf of weights properties graph. Topic D B 10 - Option: Discrete mathematics :- 4, rnV + <*.. 7 7 - 12 - - 7 - 17 For a the weights shown simple. The adjacency table and, 12 - 7 - 5 5 - - 17 - - - - - are **\" ^ orked b..ir*i V ' v. / 7.1 example Graph G has the adjacencytable: B C D\\ E F - - 9 6 - 6 - - - 6 9 \302\273 - - \302\253 6 - 4 6 - 6 - 4 - 9 5 A I\302\253 (a) Write down the (b) Draw G in 4 - 4 7 5 7 - degree of vertex C. planar The degree of non-zeroentries in form. a is the vertex the (a) deg (C)=3 number of row or corresponding column We can start in order by To draw the Hamiltonian cycle edges. the graph drawing A,B,C,D,E,F, Finally, graph in planar first, and the write the vertices* with and then redraw fit (b) in planar form form, find a in the weights it * Hamiltonian cycle: ACDE3FA rest of the on the edges 7 ? ^k^ + 0[._ i- Algorithms on graphs 99 7A Exercise 1. Construct the adjacencytablefor eachweighted below: shown graph A 2. (a) (i) (ii) (b) (i) (ii) Draw a weighted graphwith in the following (a) the weights of the 1- edges given tables: (i) E 10 3 4 10 4 10 12 9 6 - - 6 +\302\243i C D ii A 10 3 - (ii) - 9 - - C D - 7 9 - 5 4 - 5 - - 4 4 - 9 - 7 9 - - A\\ B C D\\ E F - - 7 - - 9 - - 5 8 8 8 ? 5 - - 8 - - 8 - - 7 - - 8 8 7 - 3 1' 8 - - 3 - 1- 12 - B A 1' ^ l\302\273 (b) (i) A \342\226\240-JL \302\273 <- u H \342\226\240 H \342\226\240 \342\226\240 H H \342\226\240 I I H N4V - \342\226\240 \342\226\240 D H \342\226\240 B D 10 m \342\226\240 \342\226\240 \342\226\240 \342\226\240 \342\226\240 Topic (ii) H H \342\226\240 \342\226\240 \342\226\240 100 * D D D \342\226\240 \342\226\240 B \342\226\240 \342\226\240 7 Option: Discrete mathematics t ^k^ + Q[._ .ON **\" ^ 3. Draw in planar b..ir*i given by the costadjacency the graph form matrix: (a) R C A B 5 5 - 7 5 - - 10 9 12 E D (b) C - 9 7 10 12 5 4 4 - 9 - 9 - - 8 8 10 8 are G E 10 8 - - 8 15 8 15 8 8 10 - 8 10 of edges in a simplegraph The weights D\\ shown 1- 8 - in the following table: c A B B D B B \342\226\240 D B B B EI B BB B B BB B Rb (b) Draw Hence the and list graph find * B B B\302\253 \342\226\240 (a) \302\273 \342\200\242> all Hamiltonian cyclesstarting at A. cycle of the Hamiltonian least weight. Draw find the the [7 weighted graph corresponding to the given table and of an Eulerian path starting at vertex A. length H A B I - I 14 9 - - - 12 - 11. Consider weightedgraph G A B I E I F given by the - - 10 - [7 marks] following table: B c D * 4 6 ~ - ~ - 6 5 Q 4 - Q 6 5 5 - B - 6 - 5 B- - 5 5 - the its D 12 14 9 - - - 10 9 - 9 1- drawing I \302\261u - - cycleand find C 1Z 1\" +<i Without marks] graph, length, explain explaining why there is an Eulerian your calculation [5 marks] clearly. 7 Algorithms ? ^Ui)^ + Oi.. on graphs 101 graph G is: the weighted for table The B c D ~ 7 - 7 - - 8 - - - - 8 5 - A \342\226\240 D Q D 8 Q H 10 12 9 10 \342\226\241 Without (a) 8 - b - - 5 10 - 12 10 - 9 - - - explain why G is not the graph, drawing E Eulerian. (b) H is Graph that H is obtained from G by deletingoneedge.Given Eulerian: (i) State which edgeshould (ii) Find the deleted. be length of an Eulerian cyclein H. Minimum tree: spanning [6 marks] Kruskal's algorithm Six The shows graph where a direct length of the internet networkby distances (in kilometres) betweenvillages to be are villages to an connected is possible. connection What is the cables. minimum cable required? minimum connector problem.We only edges to createa connectedsubgraph. In particular, if A is connected there is no need for any cycles: to B via C, then the edge AB is not required.This means that we are trying to find a subgraph that is a tree and has minimum Such a is called the minimum possibleweight. subgraph This need of a example to include enough is an spanning tree. Thereisa simple for algorithm finding the minimum spanning one edge tree, called Kruskal'salgorithm.It works by adding at a time, starting with the and checking that we never shortest, create cycles.This is an example of a greedy algorithm, where at each we pick the best possible option(in this case, the stage shortest not possible edge). always work for In our example, the We other will see types of later that this strategy does problems. is AC, so we add it to the BCand CD.Therearethen graph three of length 6, but AB and CFarenotrequired, as they edges would create cycles, so we just add CE.All the vertices are now our spanning tree. connected, so we have completed first. Topic 10 - Option: Discrete mathematics Next shortest we add edge BF, then **\" ^ v. / 7.1 POINT algorithm \342\200\242 Start by marking each stage a time. vertices. shortest remaining edgeas long a cycle. create vertices until all edges adding Keep all the add the asit doesnot \342\200\242 the graphoneat adds edges to Kruskals \342\200\242 At ' V is summarised below: This algorithm KEY b..^ been have connected. minimum The The next example shows how to set out is clear.You your method your so that working which ones you edges, you skipped would create a and draw (because they cycle), your completed tree.It helps to list the edges in order of length first. Remember that a tree with n vertices has n-\\ edges,soyou know when have the tree. It is alsoa idea to draw the completed you good tree as note which you go along. orked List the there more may be than one tree,** the same v/e-g^Vou are required only to find one answer onlessexpliatlytold otherwise. 7.2 example minimum spanning tree for Find the not unique; necessarily the order in to show need the considered have is *ee spanning edges in the order they were edges in order* this graph: added to the tree, and state the weight of your tree. +c< We start by of first. length the listing If two have edges same length, we can list CD 2 EF2 the FG2 in any them order AG 2 3CA each edge Consider add We it skip to the graph after if and order it does \342\200\242 not create a cycle AE because we already have As there in EF, EG, GA AE 4 skip ED4etop AC 5 E3 6 AD 7 are 7 vertices,we can stop the 6th edge (ED) has been added 7 v ^k^ + G(._ i- Algorithms on graphs continued... We drew the tree so we edges, tree. The weight as we added the\" have the complete is the sum of the weights of the all edges Kruskal's algorithm is quick and it is difficult to check if you graph implemented on cycles, and called 1. Use this easy to are a computer,we would can be very on implement creating need time-consuming. a long an small cycle. Also, for additional So for graphs. algorithm large graphsthere However on an algorithm a large to be to check for is an alternative, Prim's algorithm. Exercise 7B Kruskals algorithm and state its (a) (i) Topic 10 to find spanning tree for the graphs below weight. 1 - a minimum Option: Discretemathematics (ii) A Draw each tree **\" ^ 26 B 13 j> io (b) (i) (c) Use Kruskals by (a) the (D following 12 Jv / D 5 8 5 - 7 4 7 7 10 4 9 7 10 - 8 10 9 10 8 10 - (i) E - 30 - 35 40 50 30 70 - 70 - 35 40 50 45 A - 4 - 6 - 10 10 - 50 - - 15 15 - - 20 B\\C D E 4 - 5 5 - 6 6 6 - 5 10 - 4 - 7 - - (ii) F 50 - - 20 - 15 - 15 - 10 12 of the 14 15 - 16 13 13 - 11 14 15 - 16 19 18 18 A B C D 50 45 40 40 - - \\A\\B\\C 5 O 5 - Q 7 6 Q O 8 F 8 - 5 - ^^ + 0[._ i- 18 18 - - 45 35 D 19 50 35 40 45 45 - 20 35 - 1- 16 35 40 25 25 35 40 - 10 - 11 7 6 - 20 35 30 D E\\F - 8 5 4 5 - 4 4 4 5 3 2 7 ? graphs represented 16 12 - 45 - * 10 5 4 7 - 2 2 - each m - D C (c) (i) \"M E C \342\226\240nnrann 10 8 (b) v. R 6 A_ tree for algorithm to find the minimumspanning tables. Draw each tree and state its weight. - +\302\243i ' V (i) Q~ 2. b..ir*i - 15 15 25 - 40 30 25 - - 8 3 2 - Algorithms on graphs 1 B 8 The diagram shows graphK. L> ^20 17 tree for K. spanning a spanning (b) It is requiredto which includesthe edgeCF. Kruskals algorithm to do this. Explain C 8 12 14 10 12 10 12 12 14 of a \342\200\242e D 11 14 13 15 11 10 can adapt you not need to find [6marks] is meant what briefly Explain tree 10 do You weight '15 (a) cr how the tree. 16^ l'n of least tree find 15 10 minimum the Draw (a) 10/ 12y graph. the minimumspanning the table alongside.Draw by (b) Find E 9 10 11 15 14 11 13 10 F by the minimumspanning of the tree tree your graph given state its and [7 marks] weight. (a) (b) In a 12 A can't this connected simple and 7 edgesof 20 and 22. Find the: has 5 vertices graph 13, 15,18, 10,11, lengths edge has weight 8. Sharon spanning tree has weight 139. be right. [6 marks] the minimum why Explain have different the shortest and that finds a tree with n vertices. all edges 12 vertices with graph weights 12 of edges in number the State (a) minimum possible weight (b) maximum possible weight of the minimum spanning tree of the minimum spanning tree. [5marks] minimum The tree of spanning diagram has weight Find 51. the the graph shownin the range of possible values of x. [5marks] Finding the shortest path: Dijkstra's algorithm We often two between a represents or need the There can be many so calculating the length of each oneisnot section we will meet an algorithm which can be routes, practical.In this on implemented two places. between route quickest possible jj graph theory to find the shortestpath An example might be when the graph vertices. road network and we want to find the shortest to use the computer. is that the shortest path doesnot necessarily start the shortest the graph alongside.The edge. Consider A is AB, but the shortest path from shortestedge to D is via C. So we needto look different of getting through ways The difficulty with A from at the network, but avoid to look having Dijkstra'salgorithm all considers but only keeps of the track the currentvertex. recover the shortest When path Topic 10 - Option: Discrete mathematics the at all possible paths. vertices shortest path from the from algorithm the start in the is completed, to any graph, the start to we can vertex. In order ^ 3u. V I this, we needto keepsome we go along.This each vertex as a box nextto each by drawing distance previous from start vertex of order for information done is usually / follows: as vertex v. ^C^e h-v**-! to do ' labelling temporary labels A far. in the labels The top row are called permanentlabels.They we know that to this vertex. possible path in once written only Orderof labels. permanent we The starting certain end vertex end that we Distancefrom startis shortest vertex to the currentvertex. last the This path. box allows us recover the the previous vertex in we write shortest the the final shortest to work backfromendto startvertexto path. on The algorithm is much clearerwhen illustrated show in red the information stage. an example. addedat each We orked +c< be only once the starting from distance the In the vertices are given vertex will always be labelled1, will not necessarily be last.We can have found the shortestpossible path vertex has a permanent label. the but are the shortest found have in which order is the labelling distance from start found whenever we find a shorter is updated information This the shortest shows label temporary so path. (a) example 7.3 Find the shortestpath from S to T in this graph: A C4 down (b) Write (c) If we are not the length allowed WD of the shortestpath to use the edge from S to D. BD, what is now the shortestpath 7 v ^k^ + G(._ i- from Algorithms S to T? on graphs continued. Start S and by labelling vertices\" the to it. adjacent least distance from Vertex A has the a permanent label, in the top row it gets so S, write we which B adjacent For 8, to lis A. 4 = 7, but label 6, so this 3 + The vertex labelled with 3 + 11 = 14. has 8 already is not updated. the with label is C, temporary which are* at vertices look now We so this smallest is made permanent Vertices adjacent to C 8: 4 + 1 = 5 < 6, so this are 8 and Vertex label, now that noting the in \342\200\242 is updated. D: 4 8 D. +4 =8 gets a permanent the previous vertex of length path 5 was C 3 Vertices D: T: 5 to 8 adjacent 5 + + 8 are D and 2 = 7 < 8, so it = 13 < 14, so it D now Vertex label, noting is updated is updated T. 4 \342\200\242 gets a permanent that it was reached from 8 3I4|S r^ ,v 108 Topic 10 - Option: Discrete mathematics S ^ *~ ' V k^h ^ / continued... 12< 13,so T:7 + 5 = is T \342\226\240 updated again It is remaining vertex, so it the last gets labels, permanent can stop so we The of the length shortest path is the* middle number We can label a permanent have vertices All work back from find Tto actual the* back Working use the back to go (b) diagram* completed D to from Working If back can't this not changed stay at 13. 8 from notice got in to 7, T: path is from back 5-C-3-D-T. D: shortest path from 5 to D is 5~C~3~D,of 7. without 3D\\ 5-C-D-Tboth 5-C-3-T'and have length 13. so T would 13 that can be different two (c) then D is be done, But added we when to 12. D-3-C-S S length We look from shortest So the BD: path is shortest T-P-3-C-S path So the We can of the length T's box the in The ways. +c< EXAM HINT for each list to the a graph shortest is given Dijkstra'salgorithm vertex a diagram contain vertex, like the final its a in part diagram state path and with box completed (a). Don't forget length. HINT EXAM If must solution Your in as cost a you and all the edges labels before moving on adjacency draw the matrix you can graph. Begin from starting to more edges it. Then with follow the start add temporary and vertices. 7 Algorithms v ^k^ + G(._ 1- on graphs 7C Exercise 1. For each of the following - fill in the - find - boxes to carry out Dijkstrasalgorithm the shortest down write networks: the path (or paths) from S to F of the shortest paths from Sto lengths D,\302\243andF. For versions larger filled in, of the see the endof this diagrams chapter that (pages can be photocopied and 131-133). XT (ii) (a) (i) -D 10 10y r H 12 Hsj 5 -\302\243 VF TT r3 c- (b)(i) (ii) (c) (i) (ii) +c< -6 E I\342\200\224Fpx 2. Use Dijkstras (a) (i) A x 110 Topic 10 algorithm - to find 2\342\200\224D. the shortestpath 12 y Option: Discrete mathematics from S to T: ^ **\" b..ir*i ' V v. / (ii) *- 3. Use algorithm Dijkstras to find shortest path from Sto F in the weighted given by graphs the following tables: (a) (i) IB s 6 D O O Q 6 - 8 4 8 - D 7 Q - D D B C 8 8 4 - 6 6 - A 7 7 - - 6 (ii) H - - - - 12 9 5 11 - G 6 - - \342\226\241 \342\226\241 F 5 - 8 8 7 5 - 12 * 8 - 12 11 12 6 9 6 - 3 5 - 8 5 3 5 - S\\A\\B\\C\\D 6 4 5 - +\302\243i 4 5 5 - 6 6 2 - B (b) (i) A 5 6 6 4 B 2 5 6 4 3 3 6 5 5 2 C 6 5 4 5 2 D 4 3 5 - 1 - - - 2 3 2 1 - G H I J E 7 4 \302\273 8 Note an unusal 3 format 15 12 18 18 of the v/hich has 7 8 22 21 exam \342\200\242in appeared in questions the past. 30 16 56 31 table 24 40 50 42 26 39 33 23 7 Algorithms ? ^Ui)^ + <*.. on graphs 111 (ii) 17 31 H 41 32 D 38 25 28 7 H D X 17 A V yP 8 H. 8/ ' Q*. 6 \\ 2 V3 5/ 7\\ 3/ ^0 / The C B 6, J^ 6s 29 31 23 29 16 46 41 22 42 M / the cost represents graph 21 of train journeys between towns. different (a) Use Dijkstras algorithm S to M. State your route (b) Write /5 \\l 16 of the the cost down to find the cheapestroutefrom and its cost. cheapest routefromS to /. [8 marks] L F <R>16X^\\J AK \\ 13 ^7 9 22 31 19 12 \\3 yw 4\\ 24 H 2/ 10 V/ Bt D B showsa networkof roadsand their lengths. A to G. from (a) Find the length of the shortestpath Find the new shortest (b) The road BEis closedfor repairs. The diagram \\2 8 ^^Cr y^i?. D C path from A to G, making your method clear. [8 marks] The diagramshows a weighted graph. The unknown shortest length x is a positive integer.Ifthe unique A from to G is show that there is only one ABCFG, path [6 marks] possiblevalue of x. +\302\243i |\302\273j Chinese The This problem was originally posed and studied by the Chinesemathematician jTlki **++* which uses eachedgeat vertex. about Think travel every along even which useseachedge they sum met We <^[ graphs in Section <^[ Eulerian, your postman 112 *\\? Topic 10 - the weights If there aresome Eulerian there 6E of Option: Discrete mathematics so some find least a route once all of all vertices edges the length to the starting letters: He needs to returns Eulerian circuit If there is more than one once. same length, which is equalto the degree, exactly have the Route of minimum and a postman delivering street at least once. If all the verticeshave suchcircuit also called problem, postman edges: problem postman inspectionproblem,isto +^ 1962. Mei-KuKuanin Chinese the all along Travelling there is an the edges. of odd need to degree the graph is not be repeated. We know that be an even number of verticesof odddegree. For need to know how to solve the Chinese exam, you only for graphs with two or four verticesof odd problem can only **\342\226\240* * of odd vertices degree you v / can use the algorithm: following KEY are two If there degree. ' V POINT 7.2 Chinese postman \342\200\242 of odd vertices the Identify algorithm degree. path between those two vertices, eitherby inspection or using Dijkstras algorithm. \342\200\242 The in this shortest need to be usedtwice, path edges and all the other edges are used only once. \342\200\242 Find shortest the \342\200\242 The edges the plus orked route is the total weight of all the of the above shortest path. length of the length 7.4 example (a) Find the length of the shortestChinese postman (b) State which edgesneedtobe used (c) Find 2 A_ Check +c< the of all degrees Find the In this shortest path case, 8 to* from do we can \342\200\242 A. B 3 (a)There are C two odd vertices: 5 and F vertices the F. graph. twice. route starting and finishing at one such this for route this &toF:&-l-F{\\er\\Qth=7) by inspection The length is the weight edges of all the* Total length =42+7=49 plus 7 (b)Theedqee31and Find one inspection, remembering IF can be used twice. way to achieve include route possible this, if 8/and The easiest possible, BIFIBat by* that (c) A possible route: IF are weed twice. A3IFI3CPIPEFGHIHA is to some point 7 Algorithms v 3*1,** + Q[._ on graphs 113 If there arefour of the lengths combination. B, C of odd vertices degree we AB and in three up best A, ways: possible CD BD and AC the paths between all possiblepairsand pick the For example, if the four oddverticesarecalled then they canbe paired and D need to look at AD and BC To calculatethe length of the repeated edges for the first pairing A to B and need to add the length of the shortest from path the length of the shortestpath from C to D. When we have done we lengths of for one that gives the length of repeatededges. the Chinese To solve obvious seems 7.3 POINT KEY even combinations, one is the which we then choosethe roirtes all possible tfit three pairings shortest total the Wr\\te down for all this to need You shortest. postman problemfor four vertices of odd degree: \342\200\242 consider all three possible a graph with ways of pairing up the four vertices \342\200\242 find the up those \342\200\242 pick the shortest lengths length of the optimalChinese for the graph shown in the diagramand edges need to be used twice. Identify the Write down all and find Remember odd vertices* three pairings* shortest that the shortest do not need to be paths. paths Topic 10 - with the repeated. route postman state which Odd vertices: 3, C, D, E 3Cand DE:10 + b 3D and CE: 10 + 9 = 19 3E and CD: 18 + 17 = 35 = lb Option: Discrete mathematics add lowest total; those edges (using 3AC) (using direct Select the lowest total; those* need to be repeated edges 114 combination 7.5 example Find the +c< each pair of verticesand for each combination needtobe orked path for Repeat edges 3A, AC and DE. The length of the route is: + lb = 73 + lb = 91 (all edges) 3DE and CED) ^ **\" b..ir*i V v. / 7D Exercise 1. For eachgraph G below: (ii) (i) (a) Showthat G is Eulerian. (b) Write down the lengthofa Chinese postman (c) 2. ' a Chinese Find For each route. postman route starting and finishing C. at graph: (ii) (i) +c< (a) it is why Explain and finishing at (b) Use the impossible to Chinese postman finishing your route. at A, walk alongeachedge of the graph exactly once, and using algorithm to find the route of every edge of the graphat least minimum once. State length, starting the weight of 7 v ^k^ starting A. + Gl._ Algorithms on and graphs 1 3. For each of the ^F (i) graphs below: (ii) ^* 4 (a) List Find (b) and (a) (b) Write State vertices the verticesof odd degree. the length of the state which edges the down the optimal Chinese postmanroute need to be repeated. two vertices length of the of odd degree. of odd degree. shortest path between the two the lengthofthe shortestroutewhich starts at C and uses every of the edge graph at least once. [6 marks] (c) Hence find and finishes The graphrepresents the in a small town, the weights edges representing lengthsofthe roads.A salesman wants to visit all the houses in the town, so he must walk along each road once.Hewants to start and finish at his shop, which is locatedat junction C. with Topic 10 - Option:Discrete mathematics the of the network of roads *v ^ V h^A*1- B 0.2 A \342\226\240^5-iJc +^ ^ D 0.3 / \302\260-5 o.<N 0.2 ' W /% E l 06 \\0.6 0.5 X 0.4 J7|' >J 0.5 F C 0.4 0.8/^ \\^ 0.4 A A 0.4 Usethe Chinese route for the shortest to find algorithm postman G 0.6 if salesman. the possible [8 marks] (a) The diagram shows the town of The islands and sevenbridges. with Konigsberg bridge bank (NB) and the secondisland (I2) corresponding graph, the weights time, in minutes, to walk between between the North is closed. In the the of its two represent edges different the places. NB around the town A tour every bridge +u (b) returnsto the North taken by a tour. The bank, crosses closed one), and (except bank. Find the shortest possible time You must make your methodclear. such minutes between for time at least once, for the NB and I2 reopens, and it takes the two places. Find the between bridge 16 to walk shortestpossible North at the starts once least at a route starting crosses every bridge at the North bank. which and finishing [9 (a) For the graph starts and which ^1 shown in the graph at of length least finishesat once. Make diagram, find shortest the marks] route, uses each edge of the method clear and state the your A and route. your F D /n 12\\ /U 12s 15 E 16 21 21 G\\ X14 12y i >\342\200\224\342\200\224 18 A B 16 c 7 ? 3,ry\\k Algorithms on graphs 117 Kn + Oi. .OS (b) The edge GHof weight once, and finishing at A. starting uses eachedgeat [9 marks] in the table. following B A 21 D C 18 21 14 42 8 18 8 14 42 K is why Explain 16 6 4 21 4 21 11 6 4 4 16 (a) graph. Find the of the edgesshown the weights K has graph Weighted route which shortest new the of length least to the is added 16 11 not Eulerian. vertices C and F in K. (b) Findthe shortestpath between and at D, which (c) Findthe shortestroute,starting finishing uses each edgeof K at least once. Make your method clear and state the length of your route. uses each (d) It is required to find the shortestroutewhich edge of K at least once,but does not need to return to the starting vertex. Find (ii) What this least the (i) possible and start length of such a route. should be usedto achieve finish vertices route? shortest [10 marks] all the vertices: Visiting salesman problem find the shortestroute around a graph which visits each vertex at least once and returns to the starting point.Think about a salesman who wants to visit versions of this problem, every town in a region. Thereareseveral on whether the is and whether we are complete depending graph allowed to repeat vertices.If the graph is not it may not complete have a Hamiltonian so each vertex once cycle, visiting exactly may The Hamiltonian <^[ were introduced cycles in Section6G. <^[ Travelling salesman travelling problem is to be impossible. The version in weight we will find a Hamiltonian cycleof least In other words, we want to find the graph. solve a complete is to route around a completegraphwhich once and returns to the starting point. exactly shortest One and find Hamiltonian.) inefficient, Topic 10 - Option:Discrete mathematics solve this way to their weights. This is or even visits each vertex problem is to list all Hamiltoniancycles (We know that a complete graphis always to find the shortestcycle,but is guaranteed not feasible, for large graphs. V il^x h-v**- a complete is because This Hamiltonian +^ graph with n verticeshas -{n -1)! becomes very number this and cycles, ' W large,very quickly. 1- difficult than it seems. In fact, there is no known algorithm (other than listing all possiblecycles) which the shortest Hamiltonian cycle.The bestwe guarantees finding can do is find upper and lower boundsfor the problem. These are two numbers such that we can guarantee that the shortest This is more problem possible Hamiltoniancyclehas between somewhere length them. For example, in the graphshown is ABCDA with length 19.We bound the for salesman travelling bestpossible bound. length16so know that For upper cannot possible say that 19 is an upper This is not the problem. the cycle L < 16.It turns ABDCA has out that 16 is bound), possible length (so the bestpossible upper know this without checkingall possiblecycles. the shortest but we cannot On the other we can hand, be certain cycle shorter than 12. This Hamiltonian every cyclein a K4 graph Hamiltonian the shortestedgein our has graph that is no there we know is because that edges, and weight 3. Therefore L > 12; consists of 4 bound for the travelling salesman say problem. So in conclusion, we can say that the length of the 12 < L < 16. shortest possible Hamiltoniancycle,L, satisfies if they are quite are Upper and lowerbounds only useful closeto eachother. Knowing for example, 3 < L < 97is that, not very useful. However if, in a large graph, we can say that 21 < L < 24, then we have a lot of information about the quite In this level of problems graph. many practical accuracy is a lower 12 is that we +<l shortest 19. We cycle there is a one shortest the example, in fact we that know Hamiltonian cycleof length19,sothe be longer than this. In otherwords, Hamiltonian cycle has length L < Hamiltonian one here, therefore sufficient. The of L. We to give now will but complicated, KEY above for used method is unlikely 7.4 POINT Nearest neighbour \342\200\242 a starting pick \342\200\242 go to the \342\200\242 one algorithm for finding an upper bound: vertex closest vertex until repeat \342\200\242 add finding upper and lowerbounds us a sufficiently narrow for the value range look at some methods which are more in much better upper and lowerbounds. result all the more not yet visited vertices have been used edge to return to the starting vertex. 7 :- * r*k hn + ft Algorithms on graphs 119 clearly gives a Hamiltonian cycle,soit provides the shortest possible Hamiltonian cyclewill bound; This In the graphbelow, this value. givesthe cycleADBCA of choosing be upper vertex the starting A as than less 17. length B 4 A_ 7.5 POINT KEY an can be found upper bound An improved starting by a from different vertex. In the want We this 16 (ABDCA), so this illustrates cycle length neighbour algorithm will not always find the has Hamiltonian nearest the that we get the same the shortest possible We know that of 17. bound as smallas possible. we pick vertex whichever example, upper to be bound upper bestpossiblesolution. at finding look now We bound. 7.6 POINT KEY a lower bound for the travellingsalesmanproblem can by using the following algorithm: A lower found \342\200\242 remove the \342\200\242 find (and all vertex one be the associatededges)from graph the length minimum spanning treeforthe of the remaining graph \342\200\242 add shortest two the edges connecting vertex. We For want shown subgraph A are BD and AD and we may not the conclude can be immediately as 10 - Option: Discrete mathematics A from Its minimum travelling this that with salesman the upper 15 < L < 17.We problem bound we found saw earlier that the Hamiltonian cyclehas length16. bound,especially the Topic as largeas possible. our graph leavesthe spanning tree consistsof CD and has weight 8. The two shortest edgesfrom either AB or AC, with the total 7. Hence length actual minimal It to be vertex in red. the lower bound for is 8 + 7 = 15.Combining earlier, bound removing example, edges lower the the removed clear why this method givesa lower selected above do not even form a edges ^ **\" b..ir*i ' V v. / have selectedthe correctnumber of edges (if there are n vertices, any Hamiltonian cyclewill have n edges), including the two shortest edgesfromA and two shortest edges that connecting the remaining vertices.Soit seemslikely any Hamiltonian cannot be shorter than this.Ifthe cycle edges in this selected found way happen to form a cycle,then we have the solution to the travelling salesman problem. cycle. We If 1-* the graph we get a different lower bound. vertices B, C and D fromthe Removing above lower bounds of 14, 13and 14,respectively. graph gives Remember that we want to make the lowerbound as large as because that it closerto the actual solution. So possible, brings in this case the best lowerbound we can find is 15. vertex from a different remove we orked example 7.6 For the in the shown graph diagram: at A (a) Usethe nearestneighbour algorithms starting and going to D first, to find an upper bound for the travellingsalesmanproblem. vertex A find a lower bound for the (b) By removing salesman travelling Write down an (c) problem. inequality satisfied by the shortest Hamiltoniancyclein By removing (d) vertex C find Explain why we have (e) this an improved found actually the the L, of length, graph. lower bound. of the travelling the solution salesman problemfor graph. from A Start closest and always go to the# vertex not yet visited (a) AD (2) D&{2) +c< 3C(Z>) CE(4) We visited have all the vertices, so# to return EA(4) upperbound A - = 15 A Find a the graph minimum spanning tree for# with A removed, then add two the shortest (b) remove A: from A edges 3D {2) 3C{3) CE(4) Add edges lower bound AD and = (2 + A3: 3 + 4) + (2+ 7 v ^k^ + G(._ i- 2) Algorithms = 13 on graphs 121 continued... L the and minimum a Find the between is somewhere spanning the graph tree for# (d) C: remove C vertex without (c) 13<L<15 upper\342\200\242 bound lower 3D {2) AD {2) AE(4) \\ Add the two shortest edges from Add C* CE and edges lower bound The upper and lower have found are = CI3: (2 + 2 + 4) + (3 + 4) = 15 bounds we0 the (e) Upper and same are bounds lower the eame: 15<L<15 so +<i Note that in a cycle. creates a -^/ 15. The improved lowerbound in This is the bestpossible because cycle. cycle POINT one we have The lower bound and We have found lowerbound. r^ *V 122 Topic 10 - Option: Discrete mathematics exact the found travelling salesman problemin (2) (d) L > the solution either of these upper bound a cycle with the same also 15, so 15. than shorter part 77 We know that (1) (a), we created one, becauseit L< we cannot find KEY solution. bound in part necessarily the best is not cycle be that could is the an upper finding This = 15 L to the two cases: are equal. length as the * *- tv. 1 fc ' \\J ^ / 7E Exercise 1 to 2 refer to the travelling Questions the following graphs: salesman *A (a)(i) on problem A (ii) \342\200\242B (b)(i) (c) (i) a m D O +<i 1. 2. Use By E 32 28 26 19 14 21 26 22 . 18 18 21 22 22 17 23 22 31 31 14 Q 26 21 18 26 18 deleting 22 starting at vertex A, find a lower bound for each of edges of graph G are given in the neighbour algorithm I B 16 16 12 \\\302\273 List (b) Hence all Hamiltonian solve the cycles I A A (a) A D 28 The weights (ii) C Q the nearest 22 b 32 O (ii) starting I C to find C 22 21 . 22 an upper E D 17 22 , 23 . 31 18 31 18 26 26 bound. graph. table: \\d 12 8 18 8 9 18 8 A B 9 and finishing travelling salesman problemfor at A. G. [5 marks] 7 ? ^k^ + 0[._ i- Algorithms on graphs 1 The edges of a simple graphG aregiven of the weights table: this DIE A\\B\\C 4 3 3 3 9 8 7 5 4 3 7 6 (a) the why Explain vertex in turn, to find an A | B , 5 G. marks] [11 | F 10 11 8 7 6 7 7 8 7 10 6 11 7 7 1\" 8 10 1' 7 12 10 an upper bound for vertex deleting minimum the | E | 10 9 lower Explain 6 6 spanning how from starting salesman travelling B and 10 find A to on G. problem using Kruskals algorithm to find tree for the resulting graph,find a travelling salesman problem. know that you have found a solutionto the and write down the weight of problem, for the bound you salesman travelling the 12 9 the nearest neighbouralgorithm (a) Use (c) for bound a lower D C | 5 A By the graph find the graph given by this table: Consider (b) each with starting salesman problemfor the travelling salesman improved upperbound. D from vertex deleting By for the travelling algorithm, neighbour (c) 7 6 9 7 8 5 9 9 upper bound is at most 29. problem G (b) Use the nearest for in the optimal route. [9 marks] Summary \342\200\242 In a weighted \342\200\242 A minimum graph edges have spanning tree of which is also a tree. \342\200\242 KruskaPs for finding algorithm weight and skipping edgeswhich \342\200\242 To - Dijkstra's perform algorithm associatednumbers,calledweights. a weighted graphis a subgraph weight possible adding edges of in order a cycle. form for finding Start by labellingeachvertex connected from the start vertex. smallest spanning tree involves a minimum would of the shortestpath to the between start vertex with two vertices: a temporary label which its distance - At each then give and Topic 10 stage - find the vertex with to it. temporary labelsto all verticesconnected Option: Discrete mathematics ji^ the smallesttemporary label,makeit a permanent label, is ^ *~ - - If a vertex already The labelsfor has a it is updated in a if the only permanent label,we canwork are recorded vertex each label, a temporary has vertex end the Once V ' k^h ^ / new one would be smaller. the shortest to find backwards box, with permanent labelsin the path. row. top distance from previous vertex start order of labelling 1- temporary labels The Chinese edge at - If - If problem postman and once least returns the graph is Eulerian, the graph is not \342\200\242 find \342\200\242 the \342\200\242 the of the weight shortestpath. The salesman travelling path need to - The can only solution exact be usedtwice,allthe otheredges is to problem uses each the Routeinspectionalgorithm route is the sumofallthe edgesin graph (i.e. the shortest routewhich which pairs of verticesof odd degree path between in this edges we use a graph is any Eulerian path. the solution Eulerian, shortest the is to find the shortestroutearound to the starting vertex. visits the graph used are once the weight plus of the in a complete find the Hamiltoniancycleof leastweight vertex and returns to the every starting point). be found by checkingall Hamiltonian cycles, which is inefficient. - - An can be bound upper An improved found by using the nearestneighbour upper bound canbe found by starting from algorithm. vertex. a different can be found by removing onevertex,finding the of the minimum weight tree for the and the of the two shortest edges spanning remaininggraph, adding weights A lower bound fromthe removedvertex. +c< - The required and the least upper In orderto possible and a more get the of a Hamiltonian LB<L<UB. weight bound, upper accurate bound estimate as small cycleis somewherebetweenthelowerbound for L we aim to makethelowerboundas largeas as possible. 7 v ^k^ + G(._ 1- Algorithms on graphs 125 examination Mixed 7 practice (a) Explainwhat by a is meant (b) Use Kruskals to find algorithm the order List edges in spanning tree. minimum spanning tree for the minimum you addedthemto the tree,draw your this graph. (a) Outline (b) Use [7 marks] Kruskals briefly Kruskals algorithm by the represented state and tree its weight. to find the minimum spanningtree. for finding algorithm the minimum spanningtreefor following table.Draw the treeand state 14 15 15.5 8.5 8.5 12 10 22.5 22.5 13 16 8 20.5 8 20.5 16 25 16.5 25 21 21 15.5 graph its weight. D B 14 the 19 16.5 12 13 18 19 11.5 18 11.5 15 [9 marks] The weights the following of the edges of a graph with vertices A B H 10 15 10 12 15 12 Use any for this 126 Topic 10 - C, D and E are given in table. \342\204\242\" (a) A, B, method to find an graph. Option: Discrete mathematics 11 19 18 16 13 14 D E 11 16 19 13 18 14 17 17 upper bound for the travelling salesman problem ^ **\" b..ir*i Use Kruskals algorithmto find (b) (i) the ' V obtained subgraph by removing the vertex E the from the total weight of this minimumspanning lower bound for the travelling salesman problem (ii) State / spanning tree a minimum draw and v. graph. find a hence and tree for this for graph. [11marks] IB (\302\251 to solvethe travelling We want (a) nearest the Use bound for neighbour the (b) By removing vertexB find Hamiltoniancycle has edges with 34 34 - 22 - 20 1- 11 1 H - 1- - 1- 1- 1- 1(a) Use Dijkstras (b) It is by L, the upper shortest of the length marks] [10 given in this table: J 24 - - 26 - - - 34 21 - 16 - 26 - 10 - - 26 - 25 - 26 10 - - 12 25 - 18 - 12 - 18 - algorithm to find the shortestpath the lengthofyour find an 11 - 16 21 - - - B to bound. I - 24 34 - vertex problem. a lower weights C D 22 - 20 - at graph K shown here. K. in 1 algorithm starting salesman travelling for the problem down an inequality satisfied (c) Write A graph salesman 2006) Organization from A to /. Write down path. required that the path includesedgeFI.Find the length of the new shortest path. (c) The path does not need to include from the graph.Findthe new shortest FI any path more, and but the edge its length. 7 ? ^k^ + 0[._ i- GJ is removed Algorithms [12 marks] on graphs By salesman problem for the travelling Consider each deleting in turn, vertex this graph: find a lower bound for the salesman travelling [10 marks] problem. The diagram showsa plan of a house,with the plan on a graph, representing doors. (a) Represent (b) why Explain the starting it is with doors vertices connecting adjacent representing rooms walk througheachdooronce not possible to rooms. and edges and to return room. The table shows distancesbetweenthe centresofadjacent 2 3 J_ 4 6 4 6 5 rooms. 7 8 5 5 3 m 4 ] 4 2 I 7 4 2 3 S 5 m \\3 to find the shortestroutebetweenrooms1and (c) Use (d) Hence find the at least once and returnsto the starting Dijkstras algorithm shortest tour of thehousewhich passes through each Topic 10 - Option: Discrete mathematics door point. [13 128 8. marks] * *- tv. 1 fc ' \\J ^ Q For the (a) List of odd vertices the the list clearly, the optimal The / /> graph shown in the diagram: degree. (b) Solvethe Chinesepostman Q ^ below graph edges for problem this graph. Show your to be usedtwice,and which need state the method represents of length route. [9marks] a network of paths connectingseven in fountains a park: A (a) Explain why it is not possible to start from path exactly once and returnto A. Find the length of the shortest routewhich (b) fountain uses walk A, each path along at least each once and returnsto A. (c) A new path path is exactly fountains to be built once should and that so return this new it becomes to the possible to starting point.Between path be built? walk alongeach two which [11 marks] 7 Algorithms on - * v>,Ar Vh + ft graphs ft The table showsthe lengths (in km) 10 12 7 12 8 8 8 11 10 10 9 12 11 10 9 12 8 12 8 5 12 8 A (i) Explain why to exactly twice, and each road Find the distance G has can start from village A, travel the snowplough the following \302\273 l> (a) By deleting eachvertexin for Option: Discrete mathematics needs to cover. turn, JEM E 6 10 9 7 - 8 8 9 9 - 8 6 8 10 find 6 - travel along along [9 marks] 5 a lower 10 5 - bound for the travelling G. why this lower bound is in fact salesman problem. Explain to the cost adjacencytable: I. salesmanproblem return return backto A. the snowplough \302\253 ji^ have using answer. your - - without dothis,it (ii) 10 does not if he it. A snowplough needs to clearall the roads.To must each road twice (not necessarilyin oppositedirections). (i) Topic once exactly starting village? Justify (b) 8 6 needs to inspector road Graph 8 11 drive along eachroadto inspect Explain why he cannot return to the starting village some roads more than once. road (ii) Canhe use each (b) 5 7 11 6 7 (a) eight villages. 9 9 7 roads between of main the solution to the travelling ^ Fill-in - (a) (i) shortest the down write D, boxes the the find for and, in fill ' v. / E and for Exercise 7C diagrams Photocopy - V b..ir*i A Appendix 1. **\" of the each following networks: out Dijkstras algorithm (or paths) from S to F to carry path of the lengths shortest paths from Sto F. ) J_ A\342\200\224 \342\200\224D y X y rrrir/ \\ 4 \342\200\224rf ^\\ V \\ E3N \\ V \\\342\200\224 ~ v yA V +\302\243i 7 Algorithms ? ^Ui)^ + <*.. on graphs 1 (b)(i) 1- (ii) +\302\243i 132 Topic10 - Option: Discrete mathematics * (c) \"- K \\\\ ^k^a^t- --i^n, (i) 1H* \302\243 +\302\243\302\253 oL 7 ? 5^>C^ + 0i. Algorithms on graphs 133 In this you chapter will learn: \342\200\242 about different define a \342\200\242 how to for the some ways sequence find term nth relations the formula for by recurrence relations how to sequences defined \342\200\242 Recurrence to relations use recurrence to model various situations. often Sequences or more for example, terms; previous which link rules, satisfy ux each term to one \342\200\224 2, un+1 = 2un. By we can sometimes spot looking at the numbersin the sequence 2n. But a pattern; in this casethe sequence is2,4,8,...soun \342\200\224 sometimes the pattern in the numbers is not so easy to spot. In this chapter we will learn a systematic to find a formula for way some specialtypes of sequences recursively from the core course that there (\302\24323Defining main ways not of rule define fully un+l - for example sequence, 2un could generate = un+l is alsocalleda a sequence. - n2. un new terms link definitions This type two value of the termto its position link the for example sequence, \342\200\242 Recursive the that rules the are we can definea sequence: \342\200\242 Deductive in seen have should You sequences. to previous termsin 2un. recurrence relation, For example, and does the recurrence relation the sequences: 1,2,4,8,... or 3,6,12,24,...or 0.7,1.4,2.8,5.6,... define the sequence fully, we need a starting value.For To example, +c< if we also know relation generatesthe third Recurrence relations that ux - 0.7 then the recurrence sequence. are classified by how many previous terms to find the newterm.In a first order recurrence of each term dependsonly on one previous term; = If a new term order recurrence. un+1 2un is an example of a first this is called a second order terms, depends on two previous recurrenceand an example of this is the Fibonaccisequence, \342\200\224 + values to fully un+2 un+1 un. In this case we needtwo starting are needed the value in are defined sequence. Higher orderrecurrences but in this coursewe will only consider first and second order recurrence relations. define the the same way, r^ *V 134 Topic 10 - Option: Discrete mathematics ^ **\" orked b..ir*i = un+2 3un+1 -2un with u1 relation the recurrence Apply third* from u1=lyu2=2 =1 u2 =2 u5 - u4 onwards term first five terms suggestthat sequence which lookslikeun guarantee that continues pattern relations recurrence about Results this induction. orked A Prove by the is defined by induction As each There =4 = 3u5 -2u2 =e \342\200\224 =16 2u* pattern in the is, of course, no See <^[ can prove it. are often best proved using unless we 1C Section more for of <^[ examples proof by induction. 8.2 example sequence is a there = 2n_1. -2uy \" 3^2 = 3l/a uR These / relation: by the recurrence sequence, defined of the terms five v. 8.1 example Find the first ' V that term on terms, two previous two base need we un+2 = - 3un+1 with 2un 2. \342\200\224\\,u2\342\200\224 ux - 2n~l. un depends recurrence relation \342\200\242 cases n = 1 : u, When = Whenn = 1= 21~1 = 22-1 2:u2=2 So the statementis true for n = 1 and n = 2. +c< As each one previous term on depends need we term The expressionun n than* to use strong induction = 2n_1 = /c-1 more and Suppose the statement Then for n = k: \"k 2uk-z = 2(V2) = conclusion* all n<k. = 3(2k-2)-2k-2 k-2 So the Always write a - 3tVi for = 3(2k-z)-2(2k-z) for is valid for* n = = is true The n= 2k~' is true statement statement 2, and un if it for = 2\"~1 is is true for all n \342\226\240 true n < for n = 1 and k then we can prove that it is alsotrue for n = k. Hence it is true for all n by strong Induction. 8 Recurrencerelations - * v>,Ar Vh + Gl._ 8A Exercise the 1. Find (a) un+1=4un+l, (b) = 4-un_ly un (c) un+2 (d) u\342\200\236=nun_19 \302\253!=2 that Given 2. = A un a2 Q3 In a first the is fully order order recurrence if we Although we can find is an recurrence relation recurrence example a of logistic can be used to model growth. population first do In defined by Sequences on the starting (depending value). These range from a few where periodic, values repeat again and again, to chaotic, where repeats. In a chaotic a small change value can have sequence, the in starting a large effect To analyse terms. subsequent never the pattern these sequences we need a range of mathematical from quadratic techniques, equations 136 r^ *V to differentiation. Topic10 - Option: Discrete by induction -1. that un term any in the times, a 2an \342\200\224 2n + 3. that an - n2 for all n - an_x relation recurrence the Show - > 1. relations the sequence dependsonly The sequence sequence by applyingthe solution for un in terms of n using your calculator, you will find to follow appear any recognisablepattern. this course the we that they only linear recurrence relations, involves only multiples of un and no will study function f(un) powers, roots, or any other functions.We will only higher learn a general method for solving recurrences with constant coefficients and so we will not consider recurrence relations = such as un+1 where the coefficient of un depends on (n +1)un, behaviours of recurrence relation an+l we can write un+l - f(un). know the first term. terms twenty not where the logistic map exhibita range by can only be found in somespecial cases.For example, even for a = \342\200\224 0.6 4un(l un) with ux simple-looking recurrence like un+1 there is no known expression for un in terms of n. If you plot the 4fJf^ mop, which ux many sufficiently ^f by the each term in term; so determined 2un prove linear recurrence First previous 3un+1 +1. \342\200\224 7. Prove with -un+2n-\\ un+\\ This - 2n - \342\200\224 un+2 The terms of a sequence satisfy 4. on =2 = l,u2 3, u2 \342\200\224 5 and ax ux is defined sequence with Ui=3 \342\200\224 \342\200\224 5 and induction that 3. \302\253!=1 un+1un, ux by the relations: recurrence following sequences defined of the terms five first on n. form of a first order recurrence relation with constant coefficients is un+l - aun + g(n) (so although the coefficient of an does); un does not depend on n, another part of the equation will is We look at cases where un+l -un+n. example mainly g(n) a constant, to deal with although the method can be extended The general many other functions g(n). So the most generalfirst order recurrence relation we will learn how to solve in this sectionis un+l aun + b. We have alreadymet two cases of this recurrence: When a \342\200\224 1, un+l \342\200\224un+b special mathematics is ' W V/ *\302\253~ ^l*^* ^ sequence, so ww an arithmetic produces we get ux + (n - l)b; if b = 0 a geometric uYan~l. sequence,un \342\200\224 solution for other valuesof a and b, let us the To find a particular ' +1' was no If there with start example: - un+l 3un +1 with the in whose a constant be would value 1- - 2 ux the sequence of the form equation, geometric and the solution c is = /> term. When need to equation way we can modify the and this works if we selectthe a constant, adding by were the first on depends we checkthis, it doesnotsatisfy our The simplest try something different. solutionis would be c x 3n so we constant: right Ifun=cx3n+dthen: = cx3n+1+d +l 3(cx3n+d) application +l =^cx3n+1+d= cx3n+l+3d \\ d = 3d + => dA = \342\200\224 a philosophical razor, that principle that states the simplest solution is often the correct one. role can this What l =^> an of example of Occam's is an This *' 1 2 of principle sort in play mathematics? We can check that - c un x 3n \342\200\224 relation for all valuesof c. We ux You +<l which makes of c value the first X*f9% can 1 = 2^>c = 5 sequence is for our with 1 \\3n complicated relations recurrence To solve \342\200\242 set the recurrence - cx un model l^>to 8.1 POINT an relation un+1 aun + b: but relation to find the recurrence into \342\200\242 substitute in the counting, you need to + d \342\200\242 substitute value of the first situations ]^> involving = term to find 8D Section we will use more linear + b. aun the on point the In = the using \342\200\224. into order gives '+c which curve. relation. first by of one coordinates to equation of a constant arbitrary can be found (5) - - un We can use this methodto solve any recurrence relation of the form un+1 KEY analogies integration using find the an works by substituting that this check recurrence some has This \342\231\246^f curve.Integration formula the the \342\200\224 2: cx3l-- So the general solution of formula for our particular this call the recurrencerelation.Tofind sequence we needto choosethe term recurrence the satisfies 2 know not will how to solve them. d c. ,We can extendthis This method works whenevera ^ know how to find given by un - the uY + [n solution, \\)b = bn 1. When as it is an + {ux - b). a = method 1 we already arithmetic sequence form functions to deal linear g. 8 Recurrence - * v>,Ar with recurrence relations of the = un+] oun + g(n) for various relations 137 w Vh + d.. .o orkedexample 8.3 Find Un+\\ the for the formula \342\200\224~Un~^ Follow the With Ul general the into of the term defined by the recurrencerelation sequence - 6- down the# Write above: method Substitute nth form of \342\200\224 I + d solution the to find recurrence = c I u\342\200\236 Let Then: dm \\\" +<<=!L1 cii + d -3 \\/1+1 + --3 2 2 d = -6 \\\" =c u\342\200\236 Use the first term to find -6 u, =6 c\302\253# 6 =c c = - U. -6 24 -6 = 24 u\342\200\236 /. -i*\342\200\224>_+~ ,_!*->_f Exercise 8B +<l 1. Find (a) the formula for un+1 (i) (b) (i) (c) f2J Apply = -3un -1, the by = \302\253! 3 + 2, ux method ww+1 is sequence with ux 8. (a) Write = rww and first term down the first 10 - Option: Discrete mathematics wM+1 = = 2un sequencesbelow: +39u1=l + 5, mx -3w\342\200\236 = -2 (ii) un+1=-un-2,1^=8 this section given by for the wM+1 (ii) from to a geometric sequence uv arithmetic sequenceun+l the recurrence relationun+1 three (b) Find an expressionfor Topic (ii) = 1 the method to an Try applying where d ^ 0. Where does it fail? A 138 of n terms un+1=-un +1,^=3 (i) defined [3.J un+1 = 2un in un terms un in terms of the of n. = -un+d, 5un + 8 sequence. [9 marks] / (a) Find the generalsolution relation recurrence the of u\342\200\236+i=2un-l. with first term the sequence Find (b) ux = the above 1 satisfying recurrence relation. [8marks] order recurrence Second relations look at second depends on two now will We where un+2 This means that order recurrence relations, previous terms: un+2 - f(un+1,un). we need to know the first to terms two fully define the sequence. As before, a solutionis only easy to find for linear recurrences with constant coefficients, = un+2 aun+1 + bun case Moreover,we will + g(n). when g(n) = 0; are called relations recurrence such at the look only homogeneous. \\ To develop a methodfor solving us look at a particular example: un+2 - - 5un+1 with 6un by the method for if to see thereisa solution try Motivated constant k. Substituting -1 and ux of form the u2 - -1 un-cxkn the recurrence into let relations, recurrence order first the this recurrence these we can for some gives: cxkn+2 =5cxkn+l -6cxkn -6xkn =5xkn+1 ^>kn+2 =>A;2=5A;-6 + 6=0 ^k2-5k ^> like there aretwo It looks un-c2x it is not -1. 3n. can You possible However, cx substituting 3 2 or solutions: possible check to find k = 2n and un-cxx solution by itself works,as or c2 to make the first two terms 1 and into the recurrenceshows that the sum that neither two possiblesolutions,un-cxx2n +c2x3n satisfies recurrence as well. It is now possible to usethe values of to find the constants: of the -1 ux u2 - => 2q -1 => the ux and u2 + 3c2 = 1 4q + 9c2 i = -1 i of the We two these Solving sequence can apply form un+2 - - 2,c2 = \342\200\224 2 x 2n \342\200\224 method to any recurrence equations is given by un the same aun+l + bun. Trying gives cx a solution -1, so the nth term 3n. of the relation of the form un-cxkn 8 Recurrence -iaVNoi. relations 139 in a will result quadratic equation k2 auxiliaryequation. KEY + b. -ak This is calledthe below. is summarised method full The 8.2 POINT order recurrencerelation: a second To solve un+2=aun+l+bun the \342\200\242 Find \342\200\242 The the of values above example real roots. We will see In the rootsor complex formula for the is solution general \342\200\242 Use kx and k2, of = ak + b k2 solutions, - cYk\" + u2 to and ux the auxiliary c2k2\342\200\242 values of cx find the had equation two and c2. distinct deal with the caseof repeated us apply the method to find the how to later let First roots. nth un the auxiliaryequation: term of the - -1. Fibonacci sequence. orked example 8.4 the Solve relation recurrence down the Write un+2 = un+l + auxiliary equation solve and un with \342\200\242 un ux u2 = cxkn where it kz=k + \\ ,k2-k-/\\=0 >k = Y '\\+S + c9 u\342\200\236 =d \\ Use u} and u2* u1 = 1: cy + - \\-S v S 1-V5 + c9 = 1 [1] +c< u9 = 1: d '\\ + S 3 If we subtract the two can equations we\302\253# \"'\"IS Option: Discrete mathematics \342\226\240-c. = 1 1_ 1 a s\302\260 - 1-Vs \\+S ^5=1 1 10 A lZ]-ir]=>Ci+c2=0=>c2=-Ci <=>a Topic 3-V5 V5 =1 eliminate D] =>q 140 + '\\-S + c9 Y /, /^V^ 1--s/5 [2] ^ **\" V ' v. / also workswhen the rootsofthe auxiliary complex. The constants cx and c2 will be such that This method are equation b..ir*i the imaginaryparts canceland real. un are all orked example 8.5 relation recurrence the Solve = 0 with -Qyu2-1. ux equation and* down the auxiliary Write + 4un un+2 + 4 k2 solve it => k = 0 = \302\2612i un=c,(2\\)n+c2(-2\\)n of values the Use and u} U) u2* = 0 =0=>2cj-2c2\\ u2 =1=>-4d [1] D] -4c2 = 1 [2] =^=^2 1 [2] -((20\"+(-2i)\ a complex number easier if it is written Raising to a in polar -i( form 2\" 5 = cis(-#) = 2cos# 2\" ^ H7I ^ 2 = -2n If the last answer seems complicated, to see that few terms confirms all However, won't that cases you un the + look at what a repeated root. We now Consider ux 9. The \342\200\2246,u2\342\200\224 the 2 J H7I \342\200\224 2 z coe \342\200\224 first The final answer are real numbers. sequences in most have to simplify fully, when happens relation the auxiliary un+2 = equation auxiliary an acceptable be I would (\342\200\2242i)\" recurrence the out -nn^ is correct. sequence always \342\200\224((2i)\" you can write )1 of the terms = ^ x2cos & +c< 2c\\e 2j l \" cis#+ + 2cis- is# power is 6un+1 k2 - 6k answer. equation has 9un with + 9= 0 and has - c x 3W, - 6 If we try to set un then ux the solution 2, but then u2 ^ 9. Sowe needto modify implies c \342\200\224 slightly. If we try the next simplestform,un=(c+ dn) x 3W, we can use the values of ux and u2 to find constants c and d: only one root, k = 3. 8 - * v>,Ar Vh + Gl._ Recurrence relations + d)x3 ux =6^>(c =6 u2=9^>(c + 2d)x9 = 9 this Solving un-(3- n)3n orked example down set has a homogeneous recurrence equation has a repeated root k, the auxiliary when + un \342\200\224(c dn)kn. 8.6 Solve the recurrencerelationun+2 Write relation I equation of form order linear a second solve I This whenever the auxiliary 8.3 POINT To You root. repeated I -1. can check that satisfies the recurrencerelation. will work the solution KEY 3,d = c = gives the auxiliary \342\200\224 2un+1 - un that given equation and# \342\200\224 \342\200\224 2. ux \\,u2 0=>k = 1 -2k + 1 = solve it Let Use the values of u} and = un (c + dn) x 1\" Then u2* u1 = 1 => c +d =1 u2 =2^>c + 2d =2 :.c = 0,d = \\ il = 5o n +c< Exercise 8C 1. Solvethe following (a) un+2 = 5un+l (b) un+2=4un, (c) un+2 = -6un, 142 Topic 10 - - (b) un+2 Option: Discrete mathematics 5,u2 = 13 for u2=13 ux=9, ?>un+l -2un, the nth terms of the relation: recurrence un+2 = uY = 4un+l + 2un+1 relations: Ul=4,u2=0 2. Find the formula (a) recurrence order second 4un -un,ux = 0, uY = 4,u2 = 5,u2=7 = 12 sequencegiven by the ^ 3u. *\302\253~ V I ^ h^A*1 3. the Solve recurrence following relations, the complex ' W -^5*\302\273c+^ answerin leaving your form. (a) un+2 (b) un+2 = 2(un+1 -un\\ - = ux = -6, ux = -10, 13un, 4un+1 4. Solvethe following u2 = 0 = -40 u2 and relations recurrence solutions write the explicitlyin realform. (a) un+2 (b) un+2 = = -un\\ 2(un+1 ux = -6,\302\2532 = -12 is defined by the recurrence relation = 3. By 1, u2 \342\200\224 2un for n>ly and uY A sequence un+2 -1 un+1 -un9u1=l9u2= \342\200\224 4un+1 recurrence relation find an expression for the solving of n. un in terms [11 marks] Two an and sequences, bn, satisfy the recurrence relations an+l=3an+K with (a) ax Find the value of a2. (b) Showthat (c) Solve (d) an+2 \342\200\224 2an+1 Hence find an expressionbn we will section terms an. of n. [18 marks] examplesof the application look at some of recurrence be used to model involve that situations increases, for examplesavings relations recurrence order First relations. +c< in for using recurrence relations this + 8an. the second orderrecurrence relation [SJD Modelling In K+l=5<*n-K \342\200\224 \342\200\2246,bx -6. repeated or debt accounts can percentage repayment schemes. orked example 8.7 0.3% monthly interest added to the accountat the endof eachmonth. month $100 is paid into the account. Let of money in the un be the amount accountat the end of month n (after the interest has beenpaid).Find an expression for un in in the account after two years. terms of n and hence calculatethe amount of money A At account savings can We to pays of each start the find a recurrence n + un. In month then relating 1, add increase * un+] :1.003(u\342\200\236+100) 100 and by 0.3% 8 Recurrence - * v>,Ar Vh + Gl._ relations continued... a linear This is recurrence relation, so we* of solution form what know to un =cx/\\.OOZ)n Set 1.003\"+1 + c x try +d\\ d = 1.003cx 1.003\" + 100.3 1.003^ + = 100.3 =>-0.003d =>d = -33433- 3 and use first term the Find it to c# find of first month = 100.3 end the At =100x1.003 Ul 33433- = 100.3 cx1.0031- => c = 3 33433- 1 3 .\\u\342\200\236=33433-(1.003\"-1) 3 'After 2 years' is the of month end \342\200\242 24 2 years: After u24 = 2492 There will be in the $2492 account. k ^^ ,T^^^^'*^^^^^*^^l&^**^^*M**.^****tM*-\302\243^\342\200\224l^r use recurrence relationsto solvesomecounting In fact the Fibonacci sequence was first written down problems. to model the size of a rabbit population.We look at this in the We can also next example. +c< orked example 8.8 with starts farmer A the second a pair onwards year of rabbits. Assume each (a) Find a secondorderrecurrence (b) Hence find how many produces pair relation pairs of rabbits do rabbits one pair for not breed per year, a male year, but from a female. and of pairs of rabbits, un the number the farmer will in their first have after ten years in n. year (assuming all survive). In the year n, there previous year are all the rabbits plus all the new born that from# (a) The number ones all year PLUS the rabbits 144 Topic 10 - Option:Discrete mathematics year from the n is: previous year (tv-i) (un_z, because they only born which are two or more yeare old) new rabbits pairs of pairs in to **\" ^ b..ir*i V ' v. / '(: continued. We need the starting (b) Year 1:1^=1 values\342\200\242 Year2:u2=1 1We for sequence Fibonacci this as the recognise \342\200\242 Fibonacci we already know which the formula u\" sequence: ] + y/E = s u,0 = Hence are There other recurrence relations that such as death rate and competition many factors various interacting species give particularly model. equations for the predator-prey interest model population resources. for Find out results. interesting is invested at the taking into account that involve two about the Lotka-Volterra bank account, which pays compound rate of 4% per annum.By first writing a in a amount of money in year n + 1 to the amount of money in year n, find how much the investment will be worth at the end of the 15th year (after account savings 5% interest pays year $2000 is paid into in year per year. At the start of each and the interest is added amount of money in the the money for that year is paid in but the at the endofthe year. account the [8 marks] is added). +c< A growth, Models relating the recurrence interest 55 8D Exercise \302\2431000 v\302\253\\ 1-S n, after account un be the Let before the interestis added.By solving an expressionfor un in terms of n. a recurrence relation find [10 marks] paid off in monthly instalmentsof \342\202\254350. The interest on the loan is 1%permonth, and is charged added before the payment for that month is made. Let un be the A loan amount (a) (b) of to be \342\202\25416000is owed at the Explain why un+l Solve the above (c) Hence paid find how start of month n (so ux = 1.0\\un = > 16000). \342\200\224 350. recurrence relation. many off. months it will take for the debt to be [11 marks] 8 Recurrence - * v*,>r Un + Oi.. relations 145 /', climbs Chung un (a) number the be up Explain why Write down either one or two steps at in of ways which she can reachthe the stairs - un (c) un_Y each that that spent previous two days. Omar spent on his day n. on homework (a) Write down a recurrence relationfor oftn spent 15 minuteson his that Omar 27 minutes on day 1 and day terms tn + 2in 1<mdtn. + Given (b) the average he spends day on the in minutes, of time, amount 2, on homework an expression find time he spendson his homework (c) Describe the long-termbehaviour for the day n. on the of \\ sequence tn. [11 the planesothat are drawn in n lines no three passthrough intersection points. (a) Explainwhy Pn+1 down the (c) Prove by induction be not (a) contain of n, length be Pn \342\200\224 Pn+n. that the considering By point. explain Pn n2 \342\200\224n \342\200\224 for all for the possibilities why un \342\200\224 un_x Write down (c) Hence find n > 2. [10 marks] of Osand Is, last digit of a string + un_2. the valuesof ux and u2. the number of 16-digitstrings and Is which do not contain two consecutive (b) marks] are parallel and the number of two Let of sequences consisting two consecutive Os. number the do no % value of P2. Write Let un same the (b) which a on his he spends of time amount the mathematicshomeworkso of the amountof time he be can climb Chung ways [10 marks] Omar decidesto vary Let tn step. u2. 12 stairs. of flight nth Let + un_2. the valuesof ux and Hence find the number of different (b) a time. consisting Os. of Os [10 marks] of Towers of Hanoi there aren rings of different in three pins. The ringsstartonthe first pin, arranged order of size so that the largest one is at the bottom. The object of the gameisto end up with all rings on a different pin, stillin In the game sizes and decreasingorderofsize. At ontopof a Let the Hn be the game smaller with (a) Topic10 - Option: Discrete mathematics Find no point larger ring be placed , / ring. minimum number of moves n rings. the values can a of H1 and H2. needed to complete ** ^ The - for the strategy all Move rings, secondpin. /> game is as follows: other than the largest one, to the third pin. Move all the other rings from the secondto the third pin. = (b) 2Hn_x +1. Explain why, if this strategy is followed, Hn (c) Find an expressionfor Hn in terms of n, and hence find the the Move to the ring largest minimumnumberof the game to complete needed moves with 10 rings. Q A bank [13marks] interest on a loan. At 5% annual charges year, the interest is addedand (a) (b) If the amount owed at the (c) For start of year n is (1000- the end of each R, is paid off. amount + 207?. 20#)(l.05)w_1 to the nearest dollar, after 10 years. repaid what is the total amount repaid(to the R, correct of value of R, value this the amount, is completely loan the that a fixed borrowed is $1000,show that minimum Find the so then nearest dollar)? (d) loan the minimum is the What is eventually annual repayment requiredsothat [12 marks] paid off? Summary In this \342\200\242 A first \342\200\242 To we chapter order solve linear recurrence a second solvethe auxiliary \342\200\242 The un+1 order linear equation k2 for solvinglinearrecurrencerelations. = aun distinct roots /q, If the equation has a repeatedrootthen need financial can be has solution of the form = aun+1 un \342\200\224 can + + bun d. we first need to + b. \342\200\224ak equation has two constants + b homogeneous recurrenceun+2 If the values of \342\200\242 You at methods looked k2 then the the solution solution is un=(c is un \342\200\224 cYk\" + c2^2- + dn)kn. found by substituting into the recurrence relation and using starting un. to be able to write down recurrencerelationsto modelcounting problems and situations. 8 Recurrencerelations examination Mixed Find an expressionfor = - 0,un+1 ux 8 practice The value of 5un a car n> 1. [8 marks] by 8% each year. decreases an equation for the value the previous year. Given that the value of the car after will take for it to fall below $4000. down Write (a) the sequence defined by of n for terms un in for +1 of the car after n year was $8500 years, un, of terms in its value in (b) relation recurrence the Solve - un+2 one find how long it [9marks] 5un+1 - that given 6un -1 ux and u2 - 3. [10 marks] relation Q Solvethe recurrence + 4un+1 un+2 + = 0 4un with ux - and -4 u2 - 4. [10 marks] Given that un in -36 and ux \342\200\2246,u2\342\200\224 for n > =0 + 9un un+2 1, find an of n. terms for expression [10 marks] Solvethe recurrence relation - -(an_1 an+l + an) given that 4. ax -\\,a2- [10 marks] A several new produces crystal magic crystals every day. The crystalsthat were the previous day produce only one new but the older ones crystal, 9 new each. produce crystals If is the number of crystals on day n: (a) cn Write down the numbers of crystals on days n - 1 and n - 2. (i) one (ii) Write down the number of crystals which are exactly day old on day n. produced (iii) Find an expressionfor Hence (iv) (b) explain (i) How many A = 0\302\253+l crystals an expression of term. has sequence the first expressionfor Topic10 - through (a) Explain (b) Prove Option: 8un_2. of term, first day has on the nth day [16 marks] term an in n straight linesaredrawn 148 n. ax - \342\200\224 and the recurrence satisfies relation ~ b. 3an Find an pass 2un_x + on the magic crystals does he have on the second day? for the number of crystals Harry Find (ii) un crystals createdon day two newly-formed was given Harry why - of new number total the Discrete in the same why un+1 by induction mathematics of n and terms the un+n that + [6 marks] so that no plane point. They \342\200\224 b. divide the two are paralleland plane into un no three regions, \\. un--n2 + !. +\342\200\224\302\253 [8 marks] mixed and Summary examination a large supply of 20 can you make up $5 postage? ) Suppose I ways Letx revisited problem Introductory you have the number y be and equation 20.x+ 30y = 500 gcd(20,30) one Hence The cent stamps. In how x and different many We the to solve want integers. This is a linearDiophantine y non-negative method from chapter 4. = 10, we write 10 = 20(-l) + 30(1). 50. solution of the equation is x \342\200\224 -50, y \342\200\224 = \342\200\224 solution is x -50 + 3/c, y 50 2A. so we equation, and 30 cent of 20 cent and 30cent stamps,respectively with As practice general use the We need x,y > 0 and, rememberingthat are 9 pairs (x,y) satisfying these conditions, x, y are integers, so there are this gives k > 17 and 9 different k < 25. There up the to make ways required postage. number Although theory and graph theory have a surprising numberof realworld applications, of the proofs which are associated with these significance is due to the beauty areas.In this option we focussed on three new types of proofwhich allowed us to justify the methods we use:proofby contradiction, the pigeonhole principle and strong induction. their mathematical The mainthrust of the number To do this, the Euclideanalgorithm theory was section was working towards Diophantine solving needed which arose based upon the study of equations. greatest divisors. common remainders when a number is divided, provides another Easier modular arithmeticproblems can be solved using linear is in the solution of hard problems in congruences. One application of Diophantineequations modulararithmetic, the Chinese remainder theorem. Also, Fermats little theorem particularly a tool for the remainder when we are with provides powers very powerful determining working Modular arithmetic, to look tool useful the study of at divisibility. of numbers. Graphs are a way of representing informationabout connections between several can be asked about such as: it, questions objects. has been drawn \342\200\242 Can a walk around the graph go throughevery \342\200\242 Can a walk around the graph go alongevery There are alsooptimisationproblems which \342\200\242 the minimum \342\200\242 the shortest Finding Finding spanning be once exactly solved ^3^%. _. (Hamiltonian path)7. trail)7 (Eulerian such as: two vertices (solvedusing Dijkstras 9 Summary \342\200\242 ^ edge once exactly graph tree (solved using Kruskalsalgorithm) path between n*' v? can vertex Once a algorithm) and mixed examination practice - . 149 .O the \342\200\242 Finding problem,solvedusingthe Route the \342\200\242 Finding travelling find shortest salesman upper and a graph usingeachedge route around shortest inspection at least once (the Chinese postman algorithm) visits every vertex and returnsto the starting (the point in This cannot be but we can solved, problem problem). general efficiently lower route which bounds. based upon previous terms in the sequences Finally, recurrence relationsarea way of defining can be solved the constants. sequence. They by applying standard trial functions and fixing in applied fields defined recurrence relations ariseboth within mathematics and Sequences using such as financeand biology. r 1 150 t> ^ Topic 10 - Option: Discrete mathematics - Q, VVj VS. ^%o<, ^ . I^ .On * ^ (* Mixed ' 1^ examination 1. @) S3 242 Show that if d A \\ n then connected simple, -1) | (2n (2d -1). is divisible 63. by values of possible d7. [8 marks] each with has 5 vertices, graph the are What the d > degree, 0. answer. your Justify same possible value of d: For each (i) divisible by 43. show that 242 -1 Hence 2. -1 is that ^ V vc+^ 9 practice Show ^1 an Draw of such example a graph, (ii) Statewhetherornotyour and if it is Eulerian, graph is find an Eulerian circuit. For the A ak + N has State + ax + +... ak_x +... + \\Qax + a0. a0 is also divisible result if AT a similar so that: digits {akak_x.. .a^), Prove by divisible that a digits is divisible Use ^H number is divisible Show show the that 6. so the number that and only is not algorithm divisible by to find (199 lab) is if the sumof its base 6 366.x 5. [21marks] gcd(610,366). = 732(mod610). Define the complementofa graph. If H is a simple graph with 20 edgesand 16 edges, how many vertices doesH have? Define the 3 then by by 5. (223412)6 Eulidean 5 if by RSI Solvethe linearcongruence 1DJ is divisible 33. by Hence that if N 3. by 11. is divisible Find all possiblevaluesof digits a and b 4. a [12 marks] + ak_x\\Qk~l 10* ak possible value of d find cycle. number N= the largest with graph Hamiltonian its [13 marks] has complement [6 marks] following terms: (i) bipartite graph (ii) degree of a vertex. 9 Summary ^SV^ + c, and mixed examination practice * *~ (a The ' K^ two graphs, shows diagram V +/\302\273 K K and L. L D 3J trail Eulerian an Find UseFermats the linear in L. ax congruence [6 marks] that x to prove theorem little = = ap~2b(modp)is a solutionof is a prime which doesnot where p b(modp), a. divide 3] K is bipartite. or not whether Determine or otherwise, Hence, the Solve solve 2x = ll(modl7). of linear system congruences: 5x 2x = ll(modl7), Show that if a base 12numberis divisible its last two digits is divisible by 9. = by [10 marks] l(modll) the number 9 then formed by when 350 is divided by 13. 2J (i) Find the remainder (ii) Find thelast digit in the base 13 expansion of 350. Show that if a base 13 numberis divisible the sum of its (i) by 12 then digits is divisible (ii) by Hence show that Show that the 12. (3114CC)l3 is not divisible number of distinctHamiltonian with n vertices by cycles 12. in a [16 marks] graph complete is \342\200\224In -1)! } 2V List all the Hamiltonian cyclesfor the shown graph in the diagram. A Hence 152 Topic10 - Option: Discrete solve the travelling mathematics salesman problem for this graph. [9 marks] (\302\243 **~ ' *>*** V +^ * 10. J Graph K is shown in the diagram P K is that Show Which that is planar. of K subgraph every from K so that be removed should edge but not planar, the is graph resulting Eulerian? Find a spanning tree for K. Show that K has a Hamiltonian cycle. 11. Find two the Find (i) m and integers of the solution general 90m + 48n = gcd(90,48). n such that Diophantine equation 90.x+ 48;/=624. that Show (ii) the linear Solve solutions there are no solutions with both x and List congruence 48.x= 54(mod90). y positive. all the non-congruent (mod 90). 12. The weightedgraph vertex A from G is shown Use Kruskals algorithmto find and state its weight. 2J the find Hence G is producedby above. Graph deleting G. weight of a the minimum lower bound for tree of spanning Hamiltonian the graph G cycle in G beginning at vertex A. a complete for Prove (n-\\)\\ Hamiltonian graph with n vertices (with n cycles have to be examined > 3), that to find no than more the Hamiltonian cycleof leastweight. gg How many least weight? cycles in G would have to be examined to find the one with the [12 marks] IB (\302\251 9 Summary and mixed Organization examination 2007) practice 153 vs. ^f*!*!** + 01. I ^ .Ok\" * (a 13. a- * 1 ^ - ^ For the V i+s* \\ graph shown below: C 6 4 E Explain why it is not possibleto find which uses eachedgeexactly once. Use to find algorithm Dijkstras G a route, starting and finishing at A, the lengthofthe shortestpath from S to T. starts at A, goes over each length of theshortestroutewhich edge at least once, and returns to A. Give an exampleof sucha route. Show that the number of vertices of odd degreein a graph must be even. [17 marks] Hence find the 14. ^H fig) the Draw show that Usethe resultof part not K5. graph cannot containcyclesof oddlength. K5 is not bipartite. why a bipartite Explain Hence with 5 vertices, graph complete the complete that (b) to n is the graph prove bipartite graph K4 3 is Hamiltonian. For what values of m, Kmn Hamiltonian? Justify your answer. [12 marks] 15. Forthe graph shown in the diagram: 4 B Explainwhy this graph 2) Find the minimumlength 16. (gj and returns Use the Euclidean Ba) Explainwhy For to the which the values Eulerian. is not of a route starting point. which uses each edge exactly once [6marks] to find gcd(66,42). 66.x + 42y = 9 has no integersolutions. equation = m have of m does the equation 66.x+ 42y integer algorithm solutions? Solve the equationfor 154 Topic 10 - Option: Discrete mathematics ^ q,vv, \342\200\242V^ + o m - 18. [12 marks] (* * 17. ' ^ 1^ ^ to BS) UseEuclid'salgorithm Use the resultof part (b) to find b, x gcd(a,b) = ab. are always coprime. lcm(a,b) 2 and 4n In + that show +1 [12 marks] lcm(702,401). 18. (Qj Prove that in a planar graph, e < 3v - 6. n > 3 vertices and e edges suchthat fi51 G is a simple graphwith its complement, G', are connectedand planar, (i) Write down the (ii) Show that V vc+^ two positive integersa and Prove that for ^H ^1 G and both number of edges in G'. n<10. [10 marks] 19. Consider this graph: .14 9. / B v 13 k12 y 5.5/ 12 11 n.2 15 V 21 irs. G ^S. r 16.5 *H Find a minimum spanningtreefor this Draw graph. your tree and state its weight. How found in part 20. Solve ^H da) x = 7(modl Explain 21. A sequence ux --\\yu2 ^ 1). How your the as 3x = 6(mod5), 4x = 6(mod2). congruences 3x = congruences 6(mod5), 4x = 6(mod2), solutions (mod550)arethere? many non-congruent [7 marks] reasoning. is given by the recurrence relation un+2 = un+1 + 6un with =17. Write down the first terms five of the sequence. relation. S) Solvethe recurrence 22. The weighted Use Kruskal's added, to find [10 4 c Algorithm, indicating and draw the minimum the orderin which the tree for spanning 9 Summary + c, marks] graph H is shown below. B ^SV^ tree you [8marks] simultaneous the Consider of the samelength (a)? simultaneous the are there trees spanning many and mixed edges are H. examination practice * a- (a * ^ 1 ai (i) - v <+/* \\ number of edgesin State the v vertices. has tree A ^ the tree, justifying your answer. (ii) call will We of which each components a 'forest'if it consistsofc is a tree. with v vertices a graph Here is an exampleofa 4 components. with forest r yYy How A graph one of forest with will a edges many and vertices v has an odd number of vertices.Prove that the verticesmust be even. the OJ The distances shows table vertices has n a tree with n that Prove (in metres) 3 I I (i) Find (ii) State the the 6 3 3 8 5 5 minimum betweenfive 6 [17marks] 2008) Organization tree for in an workstations 3 I 4 6 spanning least - 1 edges. 3 3 of at degree IB (\302\251 23. have? c components office. 8 I 5 5 4 6 3 3 the graph represented by minimum length of cablerequiredto connect all table. this the workstations. you cantellthat the graph is Eulerian. (ii) Find an Eulerian cycleand state its length. (i) 24. Explain how Consider the weighted following table: graph with the weights of the edgesshown MSM Use Forthe Kruskal's 156 rsM Topic10 ^ Option: Q,vv, 36 36 - 41 38 44 42 35 - 50 48 41 44 - 52 40 52 50 48 travelling salesman Remove vertex A (ii) Remove vertexB to find (iii) State which of the two Discrete \342\200\242V^ + o mathematics to find 41 52 44 50 38 - on this problem (i) 40 35 44 graph: a lower bound. another lower lower bounds 52 48 - spanning tree. the minimum to find algorithm 42 50 48 41 bound. is better. [18 marks] in the (a * ' a- V -^<+^ + (q) By considering an inequality the cycleABCDEFA by the satisfied find solution an upper bound, of the travelling and hence ) write salesman problem. [15 marks] 25. borrowed Julie 5%. At Let un Pj end the be the Explain Find an which \302\2431050 of each amount why un+1 be paid back with the annual interestrateof year, Julie pays back\302\243100before n. Julie owes at the start of year = 1.05un expressionfor un BHj Find how longit will take Sal is to the interest is added. -105. in terms for of n. Julie to pay off the debt. 9 Summary [12 marks] and mixed examination practice 157 vs. ^^VNc*. .0 +1. 9. the Divide Answers 10. HINT ANSWER prove answers supplied; been provided. in any hints have Express Fn+l in 6. You can go from 7. 1 Assume terms of Assume the 9. that n2 is even that there are such odd, and n is but In the L is that considerL + 2. 5. If 6. was not this can what you inductive step, 2. +b=c that C ^ Assume 7. the largest even integer and be under c are 8. (a) -0.682 (b) x = \342\200\224 and show Write that p and q must 4,11 (ii) 3 (c) (i) 3,4 (d) (i) 4,11 of regions (ii) (a) (8,6) (3,2), (i) (0,8),(4,4),(8,0) (ii) (2,8),(6,4) = (4,0), (7,3) (0,7), (\302\253,&) 5. Write 6. Factorise the expression 9. 525, 10. (a) = q 585 555, n of 9 a multiple (b) (a) (i) 4,612 (ii) 7,210 (b) (i) (ii) 45,1080 (c) (i) 1,4536 (ii) 1,4165 45,900 i. n (e) (i) 8,576 (ii) 2. (f) about 6. What when a number and 8), (2 and 7), when happens last have the same (b) How many you add 10 numbers then numbers Cut a great along of friends circle passing through are triangle equilateral Answers - *,v>,Ar i>i + d\\a, Gl._ b 2C i. (a) 1 two of the points. 8. Consideran q-nd of side 1 cm. 2. and show a + b = md, a-b-nd Exercise different = md, which digit? 9,54 3pqy18p2q Write p 4. Write possible? 7. (i) (3 (4 and 5). even (ii) 75pq2 3. be (1 'pigeonholes' and 6) and 5. remainders possible by 7. is divided n 2B Exercise IB kp (ii) 35,105 3. Let the increases 4,11 (d) (i) 28,56 Think contradiction (i) (fl,b) = (0,0),(9,0),(5,4),(l,8) (ii) both be even. Exercise (ii) (ii) 4 3. triangle. resulting (i) 3 rational two possible C > 90\302\260. In each case draw a from C and apply Pythagoras perpendicularline (i) (b) (b) \342\200\224 a. 3,4 (a) 18; consider and 90\302\260, cases: C < 90\302\260 and to the and a where irrational, and consider c b is and use proof by 2 Chapter 1. this true, all of them would say about the average? a that Assume digit. base cases Exercise 2A that log2 5 = \342\200\224 and rearrange Suppose n. How many about how the number another line is added. Think numbers and factorise expression to get even = odd. 4. at the last needed? when consider expression. Assume 3. look and Fn 4 to n \342\200\224 nxn. 2. Then of those lines and the colour. and double angle identity. Exercise 1A 1. from five lines same three 4. are Chapter squares and find the one of the squares. 1C Exercise be cases some the the at must be the endpoints lines connecting them. three asked Option, when you are or show, there will not For this to consider covers and look of them Three it: circlewhich vertex one Pick into 25 equal square of the radius (b) 1 (c) 21 (d) 80 (e) 2 (a) m = 3,n = -l (b) m = -25, n = and that d < 1 show that \\fd>2 h (c) ra = 1 -l,n=l 2. m = 1, (e) ra = 4. p 2, = -3 g 4. 2D Exercise 1. (a) (i) 23X3X5 2,3,4,6,12 (c) ends in 00 (a) 0,7 5X47 (ii) (b) (i) 94 1. 26508 (ii) 94 (a) 1. (2,2),(5,2), 2. (b) m (8,2), = -27, practice (4,6), (7,6) (1,6), is one possibility n-137 4. (a) (a-b)(a + (b) (ii) 0, 1, 2, 3 (i) 0,1,2,3,4,5,6,7, 2. (a) (i) 19 (b) (i) 313 (c) (i) 646 (i) 74 3494 1613 (ii) 50 (ii) 182 (ii) 1425 (ii) 199 (ii) 436 (ii) 287 (b) The sum (c) (\302\253,&) = 111110 (i) (b) (i) 351 (c) (i) 687 (d) (i) B, C, D, E 4 Exercise 4A 1. 6 9 are and both divisible by 137 is not 3, but 2. (a) x = 2,7= 1 3. (b) 4. Equation 4AF 20220 (ii) (ii) (ii) (ii) 1321 2A1 BBC (i) 221 k = 0 15 + 9x + 9y = 2007 has no solution 4B (b) 3. (a) (b) (i) 1000111100 ) (ii) 1102012C (i) (d) (i) 5E6 4. (a) (b) 5. (a) 3. 888888 (b) 3C Exercise (i) (b) (i) 1693 410 (ii) (ii) 443 (a) (ii) (i) (ii) x = x = (i) x = 2,y = \342\200\2246 (ii) x = (ii) 31E 170B (ii) (ii) 3226 BAO = -2 x = 2,y = -3 5,y = -7 29y = \342\200\2243 l,y = -l (b) (i) x = 3,y (ii) 1000111100 1. by 5 is divisible (0,3), (5,3) 6170 2. (a) (i) x = l,y 3B (a) (c) of the digits (3,0), 1. a,c,d,f Exercise (a) 7056 Exercise 124 4. 999 2. (c) Chapter 8, 9, A, B 1, 2, 3,4, 5,6, 7, 8,9, A, (f) (a) 314 5. (ii) 0, (e) (i) 4. 120064 0,1,2,3,4,5 (i) (i) (a) 6. (a) (a) (d) 3. (b) 211211 3 Chapter 59F (b) (b) 100 2 b)(a2+b2) Exercise 3A 1. practice 1010101100101111 2. (a) 3. divisible by 13 (0,D), (7,6) examination Mixed examination Mixed 1. (0,0), (k,m) 2x3x3x47 (a) 0 of digits = sum (ii) 2x3x23 (c) (i) 5X31 2. (b) (b) (c) 23x52 (ii) (i) 22x43 (b) 3678 (ii) 3. (a) 7 3. (b) x = ll,y = -21 = (ii) 2505 (i) 1065 (a) (b) (i) B2C n=0 67, n = -29 (d) +1. = -6 x = -3,y 3 3 28 6 Multiples of 6 (c) x = 3,y = -5 6. (a) gcd(?t,5)= l (b) =9 x = 3,y = (other answers are possible) -7 (other answersare possible) Answers - *,v>,Ar i>i + Gl._ 3 o h 4^,7 = 1. (a) (i) jc = 1 + (ii)x = 2+ jc = 3 (i) = 7^,7 + (u)jc= 2 + (b) -2-9fc 5. \342\200\2243 \342\200\224llfc 12k,y = -7 -17fc = 3 jc (i) + 4k,y = -6-9k 7k,y = 9-20k (ii)x = -3 + 2. 2. (there are = 84 4. (a) Yes, All ll,n (c) x = 220 51; no 3. (a) 3 4. (a) (a) ( 5. 5 gcd(^,3)= l 2 + 3k,y x = (a) m = (b) jc = 4 = -480 4 (ii) divide 41 4. (b) = -10-15k = -l-4k (a) 5. x = 0(mod3) x = 4(mod8) 6x = 9k + 4 is impossiblebecause3 and 9 but not 4. x = 2(mod3) (a) * = 3,8,orl3(modl5) (b) 7 6. a = 2 Exercise 5D 5 (a) (i) x = 18 (mod 35) (ii) (mod 55) (b) (i) x = 32 (mod70) (ii) x = 21 (mod60) (ii) 6 (a) (i) (b) (i) 7 (ii) 2 (c) (i) 4 (ii) 4 2. (a) (i) x = 215(mod209) (ii) x = 201(mod286) (b) (i) x = 542(mod630) (ii) x = 225(mod408) (b) 3 3. x = 5(mod21) (c) 1 4. x = 20(modl05) 3. (a) (b) ^ (mod 9) x = 24 (d) 0 ^ x = 8 (c) -7,-4,-1,2,5,8 2. (a) 1 \\ 5C (e) (i) x = 0(mod3) Exercise 5A 10 3 (ii) 4 3. x = 4(mod7) + 59fc 4, n = -1 (there are others) + 3^,7 = -l-5fc 4 and x = 4,jy = -1 Chapter 4 (ii) 2. x = 4(modl3) y + 37k,y (ii) (d) (i) x = 4(mod9) x = 2 (mod 9) (ii) 1. 160 (ii) 4 (c) (i) x = 0(mod3) practice (c) x = 1,7= 1. 2 3 59 others (investigate!) solutions as 51 doesnot (b) B (ii) (ii) = -24 +27k, (c) x = 25 5. weights > 117 and weights ra = 2. ( (ii) examination (b) (c) 4. all integer Mixed 1. 0 of 3 Multiples (b) (c) (ii) 2 1. (a) (i) x = 6 (mod 11) (ii) x = 6 (mod15) x = 10 (mod 11) (b) (i) < 0 (a) jc = 3 + 13^,7 = -5-22fc (b) (-10,17),(3,-5),(16,-27) 3. 0 Exercise (b) x = 6-37fc,;/ = 5-31fc x and 7 are positive for all k (c) +<l others) 2 (a) ( ) (c) ( (d) ( 3. 2 4D 1. (a) x- -126,y (b) x = 2,;/= 4 1(ii) 4 (b) ( + 5^,-13-3^) Exercise 3 5 (b) (c) x = 9-3Sk,y= U-55k (26 by 5B i. (a) ( ) 6 = 4-27fc (b) x = 2-13fc,;/ (b) m = 9,n = 13 4. (a) Divisible (b) 6fc+l Exercise 2. (a) 3. 6 = -3-llfc 7fc,^ (c) (i) x = 2 + 10k,y = -6-33k (ii)x = l + 4k,y = -l-9k (d) +<J- 4. (a) 9 4C Exercise (b) 1 5. 1,4,7 3 6. x = 4(modl5) 3,8,13 Answers C ****** (a) + <*.. (b) x = 3(mod35) divides 6x ' V +<J x = 7. 3. 207(mod527) 8. (a) Show that x = 6a + 2 = 9a (b) (i) ra = 5 + 3a, n = 3 + 2a (ii) x = 4(modl8) + 4 Simple 9 (i) (b) (i) 4 (ii) 5 (c) (i) 1 (ii) 1 (ii) 1 (ii) 0 (mod 13)by FLT examination 5 practice 2. 6 0 0 1 1 IR o i 0 Qo i 2 2 0 G2 4. 1 6. (a) 4 7. Apply 8. (a) 24 = 9(modll) H little 28 to theorem find x12(mod 0 0 0 0 1 0 1 0 0 1 1 0 1 0 0 0 1 0 0 o 1 o o o o 7) 65) (mod 10. x = 82 (mod170) 12. (b) 1 (c) 183 (b) x = 16(mod341) 14. fc 0 1 0 1 0 El o 1 G6 Q \302\260 0 |R o 0 iga a B c ' 1 2 1 1 PR G2 G3 4 5 7 7 3 5 5 5 8 6 6 6 D 1 B B 3 3 3 3 1 2 1 1 4 2 3 2 3 1 1 3 1 1 3 1 2 5 2 5 2 3 2 3 2 D ' o 6B G4 G5 1 \342\226\240filo 6 Chapter o 0 1 0 0 0 0 0 ^9 D Gl 1 HT>9B \342\226\240uH = 2,15,28,41,54 Exercise 0 \302\253 13. 2. 1 D D 3 C G6 E9 D ' 0 2 1 A B 0 0 1 0 1 0 0 0 1 0 0 0 1 0 1 1 0 0 0 0 1 0 1 0 0 1 0 1 1 0 0 0 1 0 0 0 0 0 D D 0 0 0 1 0 0 0 1 1 0 0 0 0 1 D G 0 0 0 0 1 1 0 o 1 0 ' 0 1 Rl o 1 0 D ' 0 1 o 1 0 |R D 1 0 1 0 1 0 0 0 0 0 0 1 E 0 1 0 1 0 Answers - * v>,Ar i>i + Gl._ / / A \302\253 (c) 31 1. / (b) x = 3(mod8) Fermats 9. x = o 1 1 o o B x / / / 0 1. 9 3. / / B = 5(modl3) Mixed / / i ER (c) x12 = 1 or / 4. 4 JC G5 G6 S Bipartite H (a) 3. (b) G4 ^^^^^H (d) (i) 2 2. G3 Complete Exercise 5E 1. / Connected is impossible G2 Gl o +<t. 7. There are many 5. (a) (i) possible answers, (a) 8. (a) (b) 9. (a) +c< oL 6. 162 A-2, B-3, C-2, D-2, E-2 (ii) A-3, B-2, C-2, D-3 (b) (i) A-4,B-7,C-3,D-7,E-7 (ii) A-9, B-5, C-3, D-3 (a) (i) Answers C ^i-V^ + 0i. A,D,E,G and A,B,D,H and B,C,F C,E,F,G for example: o (e) (There are 10. other possibleanswers) (a) % n= 11. 9 12. (a) l,n-l (c) (b) Doesn't exist (odd number of odd vertices) (c) +c< 6. (a) 25 (b) e>3v-6 oL Exercise 6D 1. (b) (a) (i) A. C Answers C ^i-V** + Oi. 163 * a b\302\273*V^T7 ^r, 1(i) (b) 2. (a) I A HI I | | C | D 0 n n 0 0 l 0 1 1 0 0 1 l 0 1 0 (b) 9 A BCD o i 0 0 0 0 0 \302\2601 1 ] 3 o 3 +\302\243i B 0 1 1 0 3. (a) 164 A? Answers t ****** + 0[._ i- a h 1 +1. 3. 2 2 (c) 0 (a) 2 (b) 4 (c) 20 (a) (b) 4. 6F Exercise i. (a) (b) (c) (d) Eulerian Semi-Eulerian Semi-Eulerian Neither 2. (b) and (c) 3. (a) have vertices Four odd degree (b) SMNPQNRQMRS 4. are There two vertices of odd degree; YWXVYZWUVZ 6G Exercise 4. (a) 1. (a) (c) 2. ADBFCEA AFGHEDCBA (b) ABCFEHGDA (d) ABCDEFGHA (a) (i) ABCDA A (ii) ABCDEA +1, 5. are There 6. (b) At one group least (b) answers possible many (i) AEBFCGDHA ABCD of vertices must least 3 vertices, so in the complement will be cycles of length 3. have at there E 6E Exercise 1. (a) (b) AECD, ADAD, ACAD (c) ADAD, (d) 2. (a) (b) H ADCD, ADAD ADCD, ABCD, ABAD, AEAD AABD,AAAD ABCDA ABCDA, ABCEA, ADCEA (c) None (d) G (ii) ADBECFA ADBC, ABCD, F 3. 6 None Answers A? - * v*,>r n-, + Oi.. a h examination Mixed 1. (a) practice 1 6 A, +1'i' 8. (c) Yes; have degree 4, which all vertices is even. 9. (b) v-e +f =3 7 Chapter Exercise 7A 1. (a) (i) (c) ABCDA, ABDCA, 2. (a) G2;degreesare ACBDA all even: 2,4,2,4,2 - 7 8 - 12 7 - - - 13 8 - - - 8 - - - - 4 12 13 8 4 - (b) ABCDEBDA 3. (a) (b) A a c 0 A \302\253 B o 0 0 C o l 0 D 1 l 1 E 1 l 0 BCBD, BCBC, 1 D a 1 1 1 1 0 0 0 1 0 0 -5-75 5-5-7 -5-57 7-5-5 BEBD, BEAD 5 7 7 5- - 3 3 4 - 4 - - - 6. (a) (b) (i) (n \342\200\224 = \342\200\224 l n l) 1 - - 6 6 7 4 - 6 2 7 4 2 - - 4 5 4 - - 4 - - - - - 5 - - - 4 3 4 - - - - 3 - - 4 - - - - - 3 3 - - - 1 - 6 - (ii) +1, 7. (c) (i) (n, d) = (1,6),(2,5),(3,4),(5,2) or (6,1) Note: (ii) (n9d) n = l9d = (4, 3) not possible =6 n = 2,d = 5 ^P n = 3,d = 4 n = 5,d = 2 2. n (a) (i) = 6,d=l CN 10 166 ^ ^ ^ Answers C ****** + Oi.. WC 4. (a) 5. ABCDEA = 76 Length are even;31 6. All vertices 7. (a) odd degree, F have B and (b) (i) BF 59 (ii) 7B Exercise 1. (a) (i) (b) (i) AD, BE BC, AB, = 41 (or CE); weight AC, BC,AE; (ii) AD, weight = 28 BG,EH,CD,ED,BH,AB, FG; = 141 weight (c) C 4 B (b) AEBCDA,AEDCBA ABCDEA, ADCBEA, = 30 (ii) AG, BC, ED, BG, GD, AF; weight (i) RS,RP (or PS),SK, SL, LM, RQ, PN; weight = 47 PU, PY, (ii) PW, weight 2. (a) (i) BD,BC,AD, (ii) AD, AB, BC, (b) (i) ED,FG, weight 3. (a) BD, (b) 4. (a) Add CD, ED, AB, ED; weight = 24 FC, CE,AB, CE, AB, least BE AF (or EF) then weight start Kruskals algorithm. which includes every vertex, (b) BD,AC, AF, BE; AE, weight = 45 5. (a) n-1 (b) 6. (a) (b) 7. It has YZ; weight = 155 = 21 BE), AD; weight = 19 (or DE); weight AC, BD; EG, CF, BC (or CF first, Treeof (or WS), TX, AE; weight = 52 (or EF), CG, AC, BD; DG EF,AB, (ii) DF, PV, PS = 120 (ii) EF, (c) (i) PT, = 91 to be at least 8 + 9+- + 18 = 143 49 58 x>18 Answers a 1. (c) (0 7C Exercise 2|4| 5 6 115 | S 4 (a) ^ (i) 15 |K)7 -D A- X5 3/ MB mrj H V *E 5 -E c- 3 |7 | /7 \\ X3 4\\ / 4 8 |A/S V 8 3|4|5 S 5 12 7 C 12 6\\8\\B\\ or SBDF 7, 8, SCEF; SC\302\243F;15,12,19 11 (ii) (ii) 2|4|g V 4X m c V^L2 |5|15|5/C| >615 7 un 8 V 7 JD uss \\ 4\\7\\S 7 \302\243/ 15 3|6|S 6ll9|D 2419 6 S5DFF;14,19,22 (b) 3. (b) (i) SVQT (a) (i) SCF (b) (i) 4. (a) 7 |12|D| (b) 5. SBGJF (ii) u 1. SCQRHKM cost = 21 17 (a) 21 (A5FFG) (b) ACDEFG (b) (i) (ii) 50 (ii) 32 e.g. CDFFAFCA5C 2. (a) (i) Vertices D and F IP 3. (a) (i) (ii) (b) SBDEF; 4, 8, 10 ^ C ****** + <*.. odd degrees odd degrees e.g. ABCEHGFDFGEBDA; A,B,E,G B, D,F,G (i) 78, repeat AB and FG (ii) 107, repeat BE, EF and 4. (a) 0,C Answers F have (ii) Vertices D and G have (b) (i) e.g.ABDEFBEGCDEFGA;70 (ii) ^ or SBPRHKM; or SBQRHKM (c) (i) e.g.CDEFABDAEBC \\5\\6\\S 6 A; (ii) SQ5FF or SBCDGJF Exercise 7D SC5DF; 8, 8, 12 168 S5DFT (ii) SBDTor SABDT (ii) SCF 6. jc=1 2|4|S +1, SCDF; 15,19,22 2. (a) (i) SCFT (i) /4 \\/ c- SBDF or / A V <^9 \\ -F (b) 9 (c) 87 DG 40 7|22|D 22 h 5. e.g. 6. CBDFDBAJIHGFHJCFEDC(length 1 (b) 84 (ACFIJ) 9.1) 6. 7. (a) e.g.AFGAEGBHEDHDCBA, 8. (a) C and F have (b) CEF(15) 7. (a) odd degrees (c) e.g. CEFECDEBACFDBC, (d) (i) 156 (ii) F (ii) 85 36 (a) (i) (b) (i) 63 (c) (i) 103 2. (a) (i) 32 (ii) 99 (ii) 110 (b) 1 and 8 have (c) 1-3-5-8 (length (d) 66 8. (a) A, B, C, D (ii) 77 56 (c) (i) 95 3. (a) = 180 length C and 7E Exercise (i) (ii) 82 (ii) 104 9. ACDBA, ADBCA, ACBDA, ABDCA, ABCDA, ADCBA (b) L = 45 4. (a) (b) The cycle AC&EDA has 28 40 (b) 40 2. examination of minimum length every vertex BH,NF, HN, HA, BE, CN equal. 7 which (weight = one edge add We vertices, 1. than degree. of two vertices between each pair of so now all vertices have A At km (a) 1,5,21,85,341 (b) 3,1,3,1,3 bound form a 8 weight of the 10 _ edgesgives 95. 1. tB (a) (i) (b) (i) 2\"+l (ii) 2\" ~(-3T+\\ 12 2 2l3 J (ii) = 33; 2. (b) 89 (c) 89<L<114 33| - | -3 LB = 60 4. (a) 114 ACGJ, lower Exercise 8B Ad weight the (d) 2,4,12,48,240 maximum X the 306 (c) 1,2,2,4,8 =117.5) 11 5. (a) of odd Exercise 8A BJ, AB, EG, CH,DE tree gives 92; (ii) degree. ED) AE, Chapter answers: the length (a) There are severalpossible of any cycle, e.g. ABCDEA 73; gives of the minimum doubling the weight spanning (i) of odd vertices 11.(a) 33 (b) The edges includedin cycle. 48) order CG, I], (weight (b) EB, CG,GD contains of increasing length, would create a cycle.Stop any the vertices are connected, all BC, EF, (ii) that skipping 5 are odd degree, practice A tree when 3. (b) 890 (repeat repeat AE, even degrees, (a) Add edges in (b) There (b) (i) Mixed (b) (a) adjacent (a) (a) length =12) 10. (a) (i) There are vertices (ii) No; there are more 29. length (c) Upper and lower bounds are 1. = 92, (b) odd degrees (c) AandD (c) 26 5. 276 = 208 length (b) 230 (b) ACFJ/(84) (c) (a) 99 (b) 131 1. +<J- 3. length Un -I It gives 4. (a) = 55 HL \\*.n-urn-l d=0 8,48,248 Answers - *, v>,Ar i>i + Gl._ a h 5. (b) w\342\200\236=2x5\"-2 (a) w\342\200\236=cx2\"+ (b) W\342\200\236=l 1 (b) 3. 4. 1 8C Exercise 1. (a) w\342\200\236=2\"+3\" (b) +1'i' 3. un=(3-n)(-2)\" w\342\200\236=(2-i)(3i)\"+(2 6. + ,\342\200\236=3 (c) + 2\"+1 m\342\200\236=5 (a) l)2\" u\342\200\236=(\302\253 (b) = 3 2\302\253 u\342\200\236 (a) h, (b) + =(l u\342\200\236 + i)(-3i)\" 4(-lJ \302\253\342\200\236=2\"-(-2)\" (a) (i) un_lyun_2 (ii) un_x-un_2 (iii) 9un_2+(un_1-un_2) + + 4. (a) + i)\"-3(l-i)\" =-3(l = (b) (i) 4 2i)(l + 3i)\" (ii) +(l-2i)(l-3i) 8. cos 2 u\342\200\236 (b) =-6, \302\253! h2 I(4--(-2)-) an=-(l-3\"\"2) =\342\200\22412 9 Chapter w\342\200\236=-6^) 2. u\342\200\236-- 6. (a) 12 (c) fl,=4--(-2)- (d) 6B=4-+(-2)- examination Mixed Sin(^j 5. \342\226\240$+tf+$-*r (a) 9 practice 4 2 and (b) (i) 8D Exercise i- un=3\"~l 5. 7. 2. 11 years = \302\253\342\200\236+i 1.04^,^=1000, = 1800 \302\25315 2. =40 000(1.05\"-1) \302\253\342\200\236 3. (b) un (c) 62 months =35000-18812(1.01\ 4. (b) ux = 1, u2 (c) 233 5. (a) +1, =2 \302\243n+2=-(tn+1+0 + 16 \342\200\224 (b) tn =23 (c) tn approaches below that 23, being alternately above and value. (c) (b) ul=2yu2=3 (c) 2584 8. (a) Hx = 1, 3. H2 = 3 (b) 130 (c) 1288 (d) \302\243>50 1. un = 2. (a) \342\200\224 + (b) ak (c) 22,55,88 ak_x (a) It is a graph the not in (b) ^ ^ ^ is divisible \342\200\224 +... ak_3 11 by practice 8 all the containing edges which graph, original 6. (a) (i) A graph that with two sets the vertices of verticessuch from the same set are adjacent, (ii) The number vertex, \\&~l-\\) 4 nn=0.92ivi Answers C ****** + <*.. are 9 (b) K is bipartite 170 ak_2 122 (b) x = 2(mod5) 5. examination Mixed ABCDE 4. (a) (c) Hn=2\"-1, 1023 9. ABCDEA, ABCDEACEBDA 6. (b) 1 7. are Eulerian; Both (ii) of edgesstarting from that not o h 1 + o (c) EDCABC (b) Vertices from 7. (b) x = 14(modl7) (c) x = 9. (b) A5CDA,A5DCA,AC5DA (c) L = 37 11. (a) (b) (i) 15. (c) e.g.PQflSl/V m= between or AC5DA) (A5DCA (b) RS 10. 9 (ii) = 2 n \342\200\2241, jc = -104 + 8^,7 = 208-15k 16. (c) x = 3,18,33,48,63,78 (mod90) 12. (a) Choice 1 Total Edge b) a) 6 b) 66 and 42 are Weight 17. c) 18. b) (i) 19. a) 1 =2 KQ 2 = 2 QF 2 = 4 FE 3 b) =4 PB 3 20. a) 6 ER 4 =7 =7 9 PQ 5 BC CD 5 6 281502 BC, AB, b) 48 (a) S and = -9 + llk AI, DE, =100) DG, DF, (or EFor EG),BD, = 84 x = 2(mod5) is a unique 10; there solution (mod 55) 22. a) CF,EF,BC,CD,AB b) (i) v-1 b) (use v+/=e + 2with/=l) v \342\200\224 c (i) AB,AD,DE,BC (ii) 12m T have odd (b) 13(SBEGT) (c) not 6 -1,17,11,113,179 b) un=3n+2(-2)n 23. Vertices 9 is degree 21. a) (d) 1814400 13. even, odd 3 (ii) (b) by (taken IH;weight 31 = of vertices. sets). vertices have All four 34 a) HP weight two the c) m divisible d) x = 6-7k,y so 9 choices) (10 vertices even number 3 and 5. c) It has cycles of length d) A Hamiltonian cycle would have 7 vertices, which is odd. e) m = n (because the vertices in a cycle alternate 31 (modi87) 8. (b) (i) 9 alternate, so any two sets the have an must cycle c) degree. 24. 61; ASBSCEBEGTG Each vertex has (i) degree 4, which 46 is even, (ii) ABCDEACEBDA, EDTFDBA a) CD,AB,BC,BF,CE b) (i) 213 14. c) +c< 25. (ii) 239 (iii) 239 239<L<253 b) un c) 16 years =2100-1000x1.05\" Answers A? K ^V**** + Ql.. \302\253- * ^ (a v +r* \342\200\242+<*<; ) Glossary that Words appear in bold in the definitions of other termsarealsodefined abstract nature of this optionmeansthat terms more simple of other, Term terms defined some adjacency 1- concepts. Example vertices in a A table showing which are graph by edges. joined (ofverticesor edgesin adjacent The glossary only be explainedin can realistically Definition table this in to each joined a graph) other. The following edges of the are AB graph A B A 0 1 B 1 C 0 0 1 c 0 1 0 if they are adjacent vertices Two that the and BC: shows table are joined by an edge; two edges are adjacent if they are joinedby a vertex. algorithm A specified sequence of guaranteed to answer Kruskals steps a certain equation auxiliary A used in equation quadratic solving a secondorderlinear recurrence relation. base 10 for writing numbers using system ten digits, 0 to 9, where moving a digit a place value to the left A increasesits value base cases A graph two into un+l +2un has A:2 = k + 2. equation un+2 the a graph. relation recurrence The sequence find = auxiliary '3' in 438has value In base ten, the = 30. 3X10 times. need to be tested in a proof by induction. whose vertices can be split such that only groups to start order bipartitegraph that cases Initial ten to spanning tree of minimum question. is a algorithm of steps guaranteed vertices from different groups are joined. Chinese postman problem To find the route of shortest length which includes every edgeof a and returns to the starting graph In an Eulerian graph, every Euleriancircuitisa solution Chinese of the postman problem. point. Chinese remainder A theorem solutions of result the existence about a system of of linear complement (of a graph) A closed trail. A graph were consisting not in bipartite graph that complete bipartite graph A graph A graph vertices 172 in which is joined remainder Chinese of congruence 1 (mod 9) has a unique solutionmodulo 63. of all the edges the original graph. where every vertex in one group is joinedto every vertex from the other group. complete the theorem, the system 3x = 5 (mod7),2x= congruences. circuit Accordingto every pair of by an edge. If a graph its complement The not A has 4 vertices bipartite complete and 2 edges, 4 edges. has graph K3 3 is planar. complete graph with 4 vertices has 6 edges. Glossary rsM ^ Q,VVj VS. .Ok\" | Definition Term composite An | Example is not that integer 15 is a composite prime. = i 15 \342\226\240 modulo 12 congruent When the same give 5 and congruent modulo 12. 29 are remainder when divided by 12. A in which it is possible to graph connectedgraph in which coefficients An equation do not with) degree (of a vertex) un+l =nun path. coming out of of edges number The relation recurrence The does not have constant coefficients. on n. depend A closed cycle any vertex. other constantcoefficients from any vertex to a path find (equation numbers two because number 3x5. the vertex. degree of all the vertices of degrees list The sequence in a graph. The is important sequence degree in determining whether is a graph Eulerian. algorithm Dijkstra's An the for finding algorithm shortest path between two in a Diophantine equation An vertices graph. Some Diophantine equations can by looking at factors we are only where equation looking for integer solutions. be solved and divisibility. For equation solutions because even and the direct proof A by directed graph (or digraph) fact is derived a new where proof or calculation test A test b2 edge has a that is odd. - b) (a (a+b) = by expanding directly A directed side simplifying. graph could be used to of one-way a network represent roads. whether for determining one integer is divisible We becausethe another by divisible by 5 475 is that know units digit is 5. carrying out the division. without division algorithm - brackets and facts. specifieddirection. divisibility directly reasoning from previously known A graph in which each a2 has no integer the left side is right We can prove the example, = 5 + 4n 2n2 The processof the finding and remainder when dividing quotient We can write 23 We often use Euclid'slemma = 4 X 5 + 3. two integers. edges 'Lines' Euclid'slemma A connecting vertices in a graph. numbers, divides a prime it must divide both about statement saying prime if a that product then proofs involving in factorising. factors. Euclidean algorithm A method without prime Euler's relation A rule the greatest for finding common divisorof explicitly factors. giving two finding integers all their a relationship the number of edges,vertices number of regions of a planar between We can use Euclidean to find a particular Diophantine in algorithm solutionof a equation. A complete and vertices graph. satisfies graph with three has v = 3, e = 3,/ = 2,and v \342\200\224 e + f = 2 . Glossary | Definition Term circuit Eulerian A trail closed | a graph which around uses each edgeexactly Eulerian that has an A graph graph A to Eulerian An once,but Fermat'slittle theorem uses each which trail does edge exactly to the return not starting point. allowing us to find the power of a number which givesremainder 1 when Chinese the Eulerian divided circuit is a solution problem. postman can be drawn graph pen and up the without picking without repeating edges. any A graph which has an Eulerian trail semi-Eulerian. is called A result smallest Every Eulerian once. circuit. Eulerian trail Example 1512= l(modl3) by a prime. first recurrence order A in which relation recurrence term in a sequencedepends Arithmetic generalsolution of an The largest (gcd) two given greedy An algorithm way 3 X The general x+y equation = 5-t = 5 is (teZ). The greatest common divisor and 42 is 6. integers. of a solution of the Diophantine x = t,y integer which divides Kruskals algorithm of a greedy algorithm, in which the best every includes every A closed path which there is no other 30 as a productof numbers. The travelling is to graph. is an find 12 example is not. salesman the of whereas algorithm Dijkstras vertex 5 and to write prime stage. cycle recurrence order lines. possibleoption is chosenat Hamiltonian can be sequence geometric 30 = 2 X equation. of points connectedby greatestcommon algorithm described by a first The result stating that every positive can be written as a product integer of prime factorsin exactly one way. An expression describing all A set divisor A one relation. possible solutions of graph each term. previous Theorem Fundamental on problem Hamiltonian shortest cycle in a graph. Hamiltonian graph A graph which has Hamiltonian A a Hamiltonian path complete graph is Hamiltonian. cycle. path Every which every vertex includes of a graph. equation homogeneous A The recurrence relation is not homogeneous. with relation recurrence linear no constant term. indirect proof A where proof a new using previously not inductive step in A part a direct how, facts, Kruskal's least algorithm common multiple linear congruences n, we can next value for the An algorithm Proof by contradictionis example of indirect have already a certain use this to prove it of n. for finding the Theleast common multiple divisibleby two 9 is 18. interested the actual given integers. in which we are only in remainders, rather numbers. Thelinear than of 6 and congruence 6 (mod 7) is satisfiedby all which give remainder 2 when integers 3x = dividedby 7. Glossary one proof. minimum spanning tree of a graph. The smallest integer which is Equations un+2 where induction if we proved the statement up to value of but = way. of proof by we show fact is derived known un+1 Term | linear recurrence relations A | Example terms of the linear terms. bound A sequence appear as be is known to smaller than (or equal desired solution. u n+l , = u2n is linear. not a connecting edge which number The recurrence relation in which the relation recurrence (in a graph) An vertex to itself. loop lower Definition A for the bound lower travelling salesman problemcanbe found to) the removing by one vertex from the connector is the graph. minimum connector problem minimumspanningtree all the vertices of The tree contains arithmetic modular remainders. A multigraph solution One possible x = 2,y of equation. A walk permanent labels (in Dijkstra'salgorithm)A assigned prime proof by contradiction by induction can be drawn exactly of proving A method that assuming its opposite leads to impossibleconsequences. A 'step by step' method of proving A is not 50 = 2x52 5 is a prime number, a statement by is true for all a statement numbers. showing relationship It can but 1 is not. be provedby contradiction is an irrational number. that V2 You used by induction proof in the Core syllabus to prove De Moivres Theorem. (integer part of the) result two integers. dividing relation its two The recurrence graph fc5 factors. natural quotient contains graph same degree. the with planar. An integer that has factors - 1 and itself. that pigeonhole principle every The complete without as a productof a number Writing showing proof that use the can to show that two vertices intersecting. prime prime number We two objects. at least graph edges factorisation the from objects are divided into n groups, then there must be a group A graph number that if n + 1 stating principle containing planar particular solution is one = 5. y vertex. starting principle pigeonhole x + = 3 vertex showing the shortest possibledistance A divided gives remainder 3, then remainder 5. repeated vertices. path to a algorithm. vertex. one solution of an with no KruskaPs using are some edges connected by more than particular found same tree. spanning spanning tree can be Minimum by 6 and y x + y gives where graph minimum If x gives remainder 2 when with calculating minimum The as the a graph. of smallestlength which all the vertices of a graph. for Rules tree containing shortest the find To in a sequencedepends how a on The of quotient 5 is 4. term un+2 - when 23 is divided by un+\\un is recurrencerelation. previous an example of a terms. relatively prime Two integers whose greatest (or coprime) common remainder The amount left divisor divide Route inspection 12 and 35 are relatively prime. is 1. over when we try another. to one integer by The remainder when by 5 is 3. 23 is divided Sameas Chinesepostmanproblem. Glossary Term | Route inspection algorithm Definition An | Example algorithm Chinese postman secondorder recurrence A the for solving problem. in which relation recurrence term in a sequencedepends graph A each The Fibonacci two describedby terms. previous semi-Eulerian on Eulerian trail. order relation. recurrence has an that graph sequence can be a second In a semi-Euleriangraph we can solve the variant of the Chinese postmanproblemwhere simple graph A graph multiple strong induction which has no edges between A variant on only to simple graphs. In this we use more to use value of previous Many theorems vertices. proof by induction need we where loops or one inductive the in n than Option in do not we need to return to the starting the solution is any Eulerian vertex; trail. course this apply strong induction to prove Euler for planar graphs. s relation step. subgraph A is a which graph part of another temporary algorithm) (in Dijkstra's shortest distance from lemma number the starting found so far. vertex Handshaking A vertex showing the to a assigned The is a tree spanning subgraph. graph. label The minimum The result stating that the sum of degrees of all the vertices in a graph is equal to twice the number of edges. The Handshakinglemma implies that the number of odd vertices in a graph has to be even. This is in the Route inspection important algorithm. trail A walk travelling salesman To find the route of shortest length which includes every vertex of the graph and returns to the starting problem no with repeated edges. problem. point. tree upper A graph bound A town in a region every in the shortest possibletime is an salesman example of a travelling Visiting with no larger than solution. (or be the desired is known to which number A tree cycles. equal to) An has 9 10 vertices with bound upper for the edges. travelling salesman problemcanbe found using nearest the neighbour algorithm. vertices (vertex) walk weight 'Points'in a graph. Any A sequence number of adjacent associated edges. with an edge in a graph. The weight between weighted graph A graph associated Glossary in which weight. of an edge could represent the cost of each edge has an A travelling two vertices. weighted graph represent a weights being the could road network with lengths of the roads. - -+<*<;+\" Index 95, 98-99,172 70, 74-75, tables, adjacency adjacent (ofvertices), 69,172 decimal (base10)system, degree defined, 172 algorithm, postman problem, 89-91 graphs, Eulerian bases, 36-39 in different see also modular degree sequenceof arithmetic fill-in base general solution, bases,33-35 36-39 in different, changing between directedgraph, 35-36 different, 34-35 mixed exam practice,41 40 summary, numbers, 33, 34 bipartite graph, 72, 95,172 remainder 59-61, 65, theorem, 172 complement (ofa graph), exercises, 85-87, 97 85, 95,172 completebipartite 72,172 and graph, proof, subgraph of, 85 complexroots, relations, 141 composite numbers, 26, 28,173 by, 63-64 linear, 57-59 modulo congruent modulo 95, 173 81, 83-84 trees as,73-74 recurrences, 136,139,173 to, 47-48 contradiction, proof by, 3,4-6, 7, 28, 29,175 coprime prime) numbers, 20, 21, 23,26,175 (relatively Chinese remainder theorem, 60, 61, 63 constant linear coefficients, division solutions rule, cost adjacency subject 56 matrix, 98, cycle, 73, 95, 173 Hamiltonian, whole 13-19 numbers, graphs, 69, 70, 95,173 79-85 involving, with integer 42-43 solutions, 95,174 89-92, graphs, 101, 109,130 173 13-18 Fermat's Last Theorem, Fermat's Little Theorem, example of a formula for for 2,43 proof by first order recurrence, 134 140 term, second order the nth growth, 144-45 population induction, strong recurrence linear 65, 174 62-64, modelling 9 relations, accounts, modelling a savings Fundamental Theorem of Arithmetic, general solution, recurrence graph 31, 174 137,140 algorithm, Dijkstra's algorithm, 106-12 Kruskal's 102-6 algorithm, exam 27-28, 98 Chinese postman minimum 136-39,174 143-44 48, 49,174 46-47, relation, algorithms, mixed 93,118-21 34 Fermat numbers, 12 12, 51,173 53-54 proofs, graph 56-59 Eulerian trail, 90-91, 95,174 Euler's relation, 80-82, 83,95, m rule, connected graphs, 71, exercises, 78, 85 constraints, edges, 59-62 simultaneous, planar of Fibonaccisequence congruences congruent number, 63-64 congruences, duodecimal (base 12)system, factors, recurrence divisibility linear Eulerian cycle, 93,118-19 82-83 Hamiltonian 173 Euclidean algorithm, 23-25, 31, 173 Euclid's lemma, 26,28,173 Eulerian circuit, 90, 95, 112,174 72, 95,172 graph composite and equations Eulerian,90,112 planar by a theorems 172 complete graph, 38-39, 40, 14, 31, 173 14-17, algorithm, 113 112-14,125, 172 exercises,61-62 87, 95, tests, and remainders, 51-52 exercises,115-18 circuit, divisibility division/divisibility Chinese postman algorithm, Chinese postman problem, Chinese 69,173 principle, 6 5 proof, diagonal 47-48 constraints, 173 Dirichlet's division binary Cantor's proof, 3, direct 46-47 subject to solutions arithmetic exercises, equations, 1,42-43,49,173 of solutions for, 44-46 number finding 73-74 strong induction, 131-33 diagrams, Diophantine 10,11,172 cases, 106-12,173 Dijkstra's algorithm, base 10,33-35,40,172 70-71, 173 a graph, 69, 95,173 digraph, 140-42,172 equation, auxiliary 79-80 theorems, of, 27-28 Theorem Fundamental 112-14 Chinese and arithmetic 33-34 70, 95, 173 (of a vertex), 112-18 spanning tree, 102-6 practice, 126-30 Route inspection problem, 112-18 Ind , ?^% ^ ' + 106-12 shortest path, minimum spanning tree, 102-6,175 mixed exam practice, 151-57 124-25 summary, salesman problem, 118-24 vertices, 118-24 travelling graphs, weighted Diophantine 98-102 Eulerian mixed exam subgraphs 85-87 complements, summary, 95 divisor (gcd), 19-23,31,174 common greatest 23, 25 exercises, method for 70,175 multiples, 13-18 23-25 102,174 Green-Taotheorem, 62-65 65 summary, multigraphs, finding, greedy algorithm, 56-59 congruences, Fermat s little theorem, rules of, 53-56 69-78 terminology, theorem, 59-62 linear and division 41 51-52,149,175 arithmetic, Chinese remainder 87-89 a graph, and modular 148 integers in different bases, representing practice, 96-97 around moving recurrencerelations, 79-85 theorems, important arithmetic, 66 modular graphs, 93-94 Hamiltonian 32 96-97 theory, graph 89-92 graphs, 50 equations, and prime numbers, divisibility graph theory, 2, 67-69 126-30 on graphs, algorithms all the visiting V +, -+<*< nearest neighbour 29 119,120,121 algorithm, exercises, 123-24,127 cycle, 93, 95,174 Hamiltonian exercises,94, problem, 118-21 travelling salesman number graphs, path, 93,174 Euclidean 79, 176 lemma, homogeneous (recurrence relations), solving second order, 142 inductive proofs, 3, 9-12, 18,73-74,135 26-29 numbers, Occam's razor, 10,174 step, integers 63-64 of, 13-18, divisibility different representation 42-44 solutions of equations, see also prime numbers in 33-39 1, 149 problem, introductory bases, irrational numbers, proof by Kruskals algorithm, 3,4 tree, spanning a graph, shortest all the route law of excludedmiddle, least common multiple linear (1cm),21-23,31,174 57-59,174 congruences, linear Diophantine 42-44,49,173 equations, exist, 44-46 if solutions determining the finding 4 solution, 46-47 general mixed exam practice, 50 136 maps, loop (in a graph), lower bound, planar population pigeonhole proof by prime 26-30,175 relatively prime, by contradiction connector 102,175 175 18 example, relations, 135 induction, Pythagorean 9-12 problem, 20, 21,23 , 3,4-6, 7, 28,29, by induction, 3 strong 4-6 Theorem,28 numbers, divisibility 6-8 contradiction, strong induction, minimum 21-22 factors, Prime Number 3 principle, 6-8,175 graph proof, 71 74-75, 80-85, 95, 175 graphs, 144-45 growth, modelling, recurrence methods of proof, 75 93 path, powers factors of integer, 16, 31 modular arithmetic, 55, 62-63,64 factorisation, 26-27, 28, 175 prime proof 119-22,125,175 vertices, 118-24 simple proof 70,175 106-12 112-18 label, 107,108,109,124-25,176 permanent logic,2 logistic 73, 74, (cycle), Hamiltonian prime solutions subject to constraints, 47-48 linear recurrence relations, 136-39,143-44,175 vertices, 46,48,49,175 solution, closedpath 107-9 algorithm, two visiting pigeonholeprinciple, Dijkstra's 102-6 path, 87, 88, 95,175 102-4, 124,174 exercises,104-6,126-27 2, 67-68 graphs, shortest path between shortest route around particular contradiction, 137 problems, optimisation minimum labelling, 13-18 3,174 proof, inductive 23-25 algorithm, prime indirect theory 1-2 factors, multiples and remainders, 19-21 greatest common divisor, least common multiple, 21-23 139,174 graph 33-34 systems, number theory, 93-94,174 Hamiltonian see graph algorithms; existence proof, 8 modelling non-constructive 96, 99,101 Hamiltonian Handshaking network 9-12 triples, 43 quadratic equation quotient, 14, 175 see auxiliary equation Index I - 8 theorem, Ramsey's 175 relations, 2,134,147, recurrence of, 143-47 applications defining sequences, 134-36 order linear, 136-39 first mixed exam practice,149 secondorder 139-43 quadratic, 148 summary, recursive definitions reductio ad absurdum, 4 relatively prime (coprime) division rule, 56 s little Fermat and 134-36 of sequences, numbers, 20, 21,23, 26,175 63 theorem, remainders, 13-18,175 little Fermat's 62-64 theorem, see also modular arithmetic roots, recurrence relations, repeated Route 141-42 algorithm, 125,176 inspection Chinesepostman 112-18 problem, see optimisation route optimisation problems, second order recurrence, 134,176 secondorder recurrence modelling 139-43,147 relations, 144-45 growth, population graphs graph, 90-91, 95, 176 semi-Eulerian sequences 134-36 recursively, defining degree sequenceof a graph, proofs by induction, 9-12 seealso problems,graphs, 70, 95, 176 graphs, simple relations recurrence shortest route 70-71 106-24 of, 85 complement degree sequence of, 71 simultaneous 59-62 congruences, 9-12,176 strong induction, numbers prime relations tree proof, 73-74 spanning tree, 102-6 minimum 124-25,176 107,108,109, label, temporary 135 proof, 95,176 85-87, subgraphs, 27 proof, recurrence trail, 87, 95,176 90-91 Eulerian, travelling along the edges, 112-24 travelling salesman problem, 118-24,176 tree, 73-74, 95, 176 minimum upper spanning vertex/vertices, 95,176 labelling of, Dijkstra's theorems involving, algorithm, all: travelling salesman vertices, 118-24 a graph), (around 87, 95,176 closed,89-90 weight (of an edge), 98,124,176 minimum weighted spanning trees, 102-4 graphs, 98-102,124,176 , - 107-9 79-85 all the visiting walks 102-6 176 119-22,125, bound, visiting tree, 3rvV% problem, 118-24