286
Hochschule Bremen Department of Computer Science Mathematical Puzzles Prof. Dr. Th. Risse An amusing, brisk and cool, enriching and entertaining, informative and oriented towards practical applications, playful, relevant and rewarding, stimulating, thought-provoking little contribution to the (general) mathematical education! c 2002–2014 risse(at)hs-bremen.de Last Revision Date: August 8, 2014 Version 0.5

e Puzzles

Embed Size (px)

DESCRIPTION

interesting puzzles

Citation preview

  • Hochschule BremenDepartment of Computer Science

    Mathematical Puzzles

    Prof. Dr. Th. Risse

    An amusing,brisk and cool,

    enriching and entertaining,informative and oriented towards practical applications,

    playful,relevant and rewarding,

    stimulating,thought-provoking

    little contribution to the (general) mathematical education!

    c 20022014 risse(at)hs-bremen.deLast Revision Date: August 8, 2014 Version 0.5

  • Table of Contents

    0. Introduction1. Riddles [7]

    Measuring with Two Jugs Races Census and its Boycott Zig-Zag between Trains Outward and Return JourneyMagic Squares Conspicuous Text No Talk about Money Corrupt Postal System Equal Opportunities Two andMore Eyes

    2. More Riddles [11] Matches Decanting Analytical Riddles I AnalyticalRiddles II Analytical Riddles III Analytical Riddles IV Analytical Riddles V Crossing a Bridge Synthetic Rid-dles I Synthetic Riddles II Synthetic Riddles III Syn-thetic Riddles IV Dialectic Riddle Riddles, 588 Riddles,622 Labyrinth, 652 Riddles, 680 Riddles, 708 Riddles,734 Riddles, 750 Riddles, 772

    3. Prime Numbers

  • Table of Contents (cont.) 3

    Fermat-Numbers Euler-Numbers Mersenne-Numbers4. Computations with Remainders

    Crucial is What is Left Over Computing With Remain-ders Adroit Computing With Remainders Euclid & littleFermat Fermat, Euler and More Chinese Stuff GaloisFields GF(p) Galois Fields GF(pn)

    5. Cryptography Caesar and Cohorts Caesar in General Vigene`re andAccomplices Permutations DES Public Keys? RSA AES Elliptic Curves over R Elliptic Curves over GF(p) Elliptic Curves over GF(2m) Elliptic Curve Cryptogra-phy, ECC

    6. Compression Exploiting Relative Frequencies Using Dictionaries

    7. Probability & Intuition Cards & Goats Algorithms to Generate Chance? Whatis Randomness?

    8. Sources and LinksSolutions to Problems

  • 40. Introduction

    To begin with Youll find some mathematical riddles. But there ismore serious stuff. Several algorithms to be tried are provided by thisdocument to explore procedures of cryptography, coding, probability,etc.There are other in this sense interactive documents, e.g.www.weblearn.hs-bremen.de/risse/MAI/docs/numerics.pdf orwww.weblearn.hs-bremen.de/risse/MAI/docs/heath.pdf (German)

    The functionality of pdf-documents provides

    convenient selection of problem areas of interest or of single prob-lems and, uniquely, execution of algorithms

    easy navigation between problem and solution and vice versa,

    simple visit of the numerous links to informations on our webDAVserver or in the WWW.

  • 51. Riddles [7]

    Measuring with Two JugsProblem 1. There are two jugs at hand with a capacity of p ` andq ` liters and any amount of water.What quantities m of water can be measured out?

    (a) p = 5, q = 3, m = 4(b) p = 5, q = 3, m = 1(c) p = 4, q = 9, m = 1, 2, . . . , 13(d) p = 6, q = 3, m = 4

    RacesProblem 2.

    (a) Climbing a 3000m mountain top Sisyphos makes 300m a day onlyto loose 200m each night again.Wenn does Sisyphos reach the top?

  • Section 1: Riddles [7] 6

    (b) At a 100m race the first runner A beats the second B by 10m,and the second B beats the third C by 10m.How many meters is the first runner A ahead of the third C whencrossing the finishing line?

    Census and its BoycottProblem 3.

    (a) At a census there is the following dialog:Field helper: number of children?Citizen: three!Field helper: age of Your children in whole numbers?Citizen: The product of the years is 36.Field helper: This not a sufficent answer!Citizen: The sum of the ages equals the

    number of the house of our next neighbour.(Field helper acquires the number.)

    Field helper: That is still not a sufficient answer!

  • Section 1: Riddles [7] 7

    Citizen: Our eldest child plays the piano.How old are the three children?

    Zig-Zag between TrainsProblem 4.

    (a) Two trains start on the same line 100km apart to drive at 50km/htowards each other. A fly flies from one to the other at 75km/h.How many kilometres has the fly travelled up to its unavoidablefate?

    Outward and Return JourneyProblem 5.

    (a) In A somebody gets up at sunrise and walks with many rests toB where he arrives at sunset.The next day he walks back on the same route, again pausing abit here and there.

  • Section 1: Riddles [7] 8

    There is a point of the route the roamer at the same time of dayhits both on the outward as on the return journey.

    Magic SquaresProblem 6.

    (a) Magic squares are natural numbers arranged in a square grid, i.e.a quadratic matrix, such that the sum of all numbers in each row,in each column, and in each diagonal are all the same!

    a b c

    d e f

    g h i

    mita + b + c = s . . .a + d + g = s . . .a + e + i = s . . .

    Taking symmetry into consideration, there is exactly one magicsquare consisting of the natural numbers 1, 2, . . . , 9 arranged ina 3 3-matrix.

  • Section 1: Riddles [7] 9

    Conspicuous TextProblem 7.

    (a) Study this paragraph and all things in it. What is virtually wrongwith it? Actually, nothing in it is wrong, but you must admitthat it is most unusual. Dont zip through it quickly, but studyit scrupulously. With luck you should spot what is so particularabout it. Can you say what it is? Tax your brains and try again.Dont miss a word or a symbol. It isnt all that difficult.

    No Talk about MoneyProblem 8.

    (a) The boss in an office wants to acquire the average salary of hisemployees without getting to know individual salaries und thusbreaking privacy. How does he proceed?

  • Section 1: Riddles [7] 10

    Corrupt Postal SystemProblem 9.

    (a) In a corrupt postal system each letter is opened and the contentstolen independently of its value. Only securely closed strongboxes are delivered reliably (because it takes too much hassle toopen them).How can Bob send a valuable item to Alice in some strong boxwhich can be locked with several locks when they both can com-municate about the transfer?

    Equal OpportunitiesProblem 10.

    (a) Alice and Bob live in different cities and decide to go to see eachother in turns. They want to find out who starts to drive to theother by tossing a coin.How do they find out if they live in different cities?

  • Section 1: Riddles [7] 11

    Two and More EyesProblem 11. It is called the Two Eyes Principle if two persons eachwith a separate key are necessary to open a treasure box, or if twopasswords are necessary to open a file.Each person opens her/his lock of the treasure box by her/his ownkey or adds her/his part of the password to complete the password.

    (a) Alice, Bob and Claire own a treasure box with several locks. Theywant to make sure that only at least two persons together can getat the content of the treasure box.How many locks and how many keys to each lock do they need?

    (b) Now, Alice, Bob, Claire and Denis want to be sure that only atleast two persons together can open the treasure box.Minimally how many locks and minimally how many keys to eachlock do they need?

    (c) Only at least m persons together out of a total of n persons aremeant to be able to open the treasure box.How many locks, how many keys do they need?

  • 12

    2. More Riddles [11]

    MatchesProblem 12. Move a given number of matches in order to generatea given number of equally sized squares.

    (a)Move four matches in order to generate threeequally sized squares.

    (b)Move two matches in order to generate fourequally sized squares.

    (c)Move three matches in order to generate threeequally sized squares.

    (d)Move three matches in order to generate fiveequally sized squares.

  • Section 2: More Riddles [11] 13

    DecantingProblem 13.

    (a) How can one get 6 litres water from a river if there are only a fourlitre and a nine litre bucket available?

    (b) How can one get exactly 1 litre from a container if there are onlya 3-litre and a 5-litre container available?

    (c) A 8 litre canister is filled with wine. How to decant 4 litre if thereare only a 3-litre and a 5-litre jug available?

    (d) A barrel contains 18 litres wine. There is a 2-litre can, a 5-litrejug and a 8-litre bucket. How to distribute the wine such that thebarrel contains half of it, the bucket a third, the jug a sixth?

    Analytical Riddles IProblem 14.

    (a) Let the sum of the ages of a family of four, father, mother, andtwo children, be 124. The parents together are three times as

  • Section 2: More Riddles [11] 14

    old as the children. The mother is more than twice as old as theoldest child. Age of father minus age of mother is nine times thedifference age of the oldest minus age of the youngest child. Howold is each member of the family?

    (b) Emil is 24 years old. Hence, he is twice as old as Anton has beenwhen Emil was as old as Anton is now. How old is Anton?

    (c) In a supermarket one gets a deduction of 20%, but has to pay 15%turnover tax. What is best, first to deduct the discount or first topay the tax?

    (d)

    2

    2

    1

    1

    The L-shaped area is to be divided into four con-gruent subareas.

    (e) If Fritz was 5 years younger then he was twice as old as Paul waswhen he was 6 years younger. Wenn Fritz was 9 years older thenhe was trice as old as Paul when Paul was 4 years younger. Howold are Fritz and Paul?

  • Section 2: More Riddles [11] 15

    Analytical Riddles IIProblem 15.

    (a)11 18

    27

    The vertices of the triangle are labeled with un-known integers. The edges are labeled with thesum of the labels of the incident vertices. Whatare the vertex labels?

    (b) Hans is 34 years, his wife is 30 and his daughter 7 years old. Howmany years before wife and daughter together were as old as Hans?

    (c) Three geese together weight 10kg. The second goose is by a thirdheavier than the first one. The third goose is by a fourth lighterthan the second one. What are the weights of the geese?

    (d) Are there four positive integers summing up to 79 with The second is by one smaller than double the first. The third is by one smaller than double the second. The fourth is by one smaller than double the third.

    (e) Loaded with sacks, a mule and a donkey trudge somewhere. Whenthe donkey groaned under the load the mule said: What are Youcomplaining? Double Your load Id had to carry if Youd give me

  • Section 2: More Riddles [11] 16

    a sack. And we both carried the same number of sacks if Youdtake one of may sacks. How many sacks did the donkey and howmany did the mule carry?

    Analytical Riddles IIIProblem 16.

    (a) What is the radius of a circle whith the same number of inchescircumference as the number of square inches area?

    (b) A train passes in 7sec the station master. The platform is 330mlong. It takes 18sec from the beginning of the platform and thelocomotive to the end of the platform and the last railway car.How long is the train and how fast is it going?

    (c) A worker produces parts with a rate of 10 parts a day for the firsthalf of the lot and a rate of 30 parts a day for the second half.How many parts per day did the worker produce on average?

    (d) Are all palindromial numbers with four decimal digits divisableby 11?

  • Section 2: More Riddles [11] 17

    (e) As I was going to St. Ives / I met a man with seven wives. / Eachwife had seven sacks, / Each sack had seven cats, / Each cat hadseven kids, / Kids, cats, sacks, wives, / How many were going toSt. Ives?

    (f) By which fraction exceeds four fourth the number three fourth?

    Analytical Riddles IVProblem 17.

    (a) If 5 cats catch 5 mice in 5 minutes how many cats catch 100 micein 100 minutes?

    (b) How to multiply(c) One and a half hens lay one and a half egg in one and a half day.

    How many eggs do seven hens lay in six days?(d) There are four types of balls: A, B, C, and D. Balls of the same

    type have the same weight. It is known that two balls of type B are as heavy as one ball of type A, three balls of type C are as heavy as one ball of type B,

  • Section 2: More Riddles [11] 18

    two balls of type D are as heavy as one ball of type C.How many balls of type D are as heavy as one ball of type A?

    (e) A family consisted of father, mother, two sons and two daughters.The product of the integer ages of all female family members is5291, that one of the integer ages of all male family members is3913. Two childeren of the family are twins. These twins, do theyhave the same or different sex?

    Analytical Riddles VProblem 18.

    (a) With constant speed a train crosses a 255 m long bridge in 27 sec,from the of the locomotive to the bridge until the of the lastrailway car from the bridge. The train passes a pedestrian walkingin the opposite direction of the train in 9 sec during which timethe pedestrian moves 9 m. How long is the train and how fast isit?

    (b) x2 x2 = x2 x2 (x + x)(x x) = x(x x) x + x = x 2x = x 2 = 1 Where is the mistake?

  • Section 2: More Riddles [11] 19

    (c) All divisions are integer divisions. If on increases the dividendby 65 and the divisor by 5 then neither quotient nor rest change.What is this quotient?

    (d) Is it possible to find five positive integers in succession such thatthe sum of the squares of the two biggest equals the sum of thesquares of the three remaining numbers?

    (e) A bottle of wine costs 9 Euro. The wine costs 8 Euros more thanthe bottle. How expensive is the bottle?

    (f) A farmer grows wheat on one third of his land, peas on one fourth,beans on one fifth and corn on the remaining 26 ha. How big ishis land?

    (g) Heini and Carl rest. One unpacks five saussages, the other threesuassages. Egon comes along and wants to join in the meal: I amwilling to pay! Heine and Carl agree. Afterwards Egon pays 8Euros to Heini and Carl. How have Heini and Carl to share thismoney?

    (h) A farmer has 17 cows. In his will he bequeath half of the cows tohis oldest son, one third to his middle son and one nineth to hisyoungest son. No cow is to be slaugthered. How can a neighbour

  • Section 2: More Riddles [11] 20

    help the sons to share the cows?

    Crossing a BridgeProblem 19.

    (a) Four persons have to cross a suspension bridge at night. To do soone needs a torch. There is only one torch available with maximalburn time of one hour. There must not be more than two personson the bridge at the same time. The four persons take differenttimes to cross the bridge: A 5 min, B: 10 min, C: 20 min, D:25 min. The slower person sets the speed. In which order do thefour persons have to cross the bridge so that all four reach theother side within one hour?

    Synthetic Riddles IProblem 20.

  • Section 2: More Riddles [11] 21

    (a)The equilateral triangle can be partitioned intothree congruent subtriangles.

    2

    2

    1

    1 The L-shaped figure can be partitioned into fourcongruent (L-shaped) subfigures.Can also a square be partitioned into five congru-ent subfigures?

    (b)The coins are to be moved so that two straigthrows with four coins each are produced.

    (c)The nine dots are to be connected off the reel byfour straight lines.

    (d) Each of the 30 vassals has to pay 30 gold coins to the king. Oneof them is known to pay with 9g coins instead of the obligatory10g coins. How can the king with a single weighing identify thefraudster?

    Synthetic Riddles IIProblem 21.

    (a) Three farmers together order a plough for 30 taler. Each farmer

  • Section 2: More Riddles [11] 22

    pays 10 taler. Delivering the plough the blacksmith thinks it tooexpensive, 25 taler was enough. So he sends the apprentice toreturn 5 taler. The apprentice cannot cut 5 taler into thirds. Sohe returns one taler to each farmer and keeps 2 taler. Summingup, the farmers payed 9 taler each, the apprentice kept 2 taler,which amounts to 29 taler. Where is the thirtieth taler?

    (b) With six matches construct four equilateral triangles.(c) Plant ten trees such that these trees form five straight lines of four

    trees each.(d) A quadratic beer tray accomodates 36 bottles. Is it possible to

    store 14 bottles such that the number of bottles in each row andcolumn is even?

    Synthetic Riddles IIIProblem 22.

    (a) Expand (x a)(x b) . . . (x z).(b) A very heavy armchair is to be moved. But it can only be turned

  • Section 2: More Riddles [11] 23

    around its corners by exactly 90o. Is it possible that the arm-chair eventually will sit in a position directly adjacent to the startposition so that the back rest is again behind?

    (c) Off a chess board two opposite corner squares/locations are re-moved. Is it possible to cover the modified chess board withdomino pieces if a domino piece covers exactly two chess squares?

    (d) In order to square a two decimal digit number t5 with least signif-icant digit 5 one multiplies z and z+ 1 and writes after the result25, e.g. 752 = (7 8) 100 + 25 = 5625. Does the trick alwayswork?

    Synthetic Riddles IVProblem 23.

    (a) A cuboid is to saw up into 27 congruent little cuboids. This ispossible with six cuts. Is it also possible with fewer cuts?

    (b)

    1 floor 2 floors 3 floors

    Build a house of cards as indicated. How manycards do you need?

  • Section 2: More Riddles [11] 24

    (c) Find with three weighings on a beam balance without separateweighs whether one of the 12 golden dublones is fake and as suchlighter or heavier than a true dublone.

    (d) Is there a squence of numbers such that every decimal digit 0 to9 occurs exactly once in them and they sum up to 100?

    Dialectic RiddleProblem 24.

    (a) Three captives are released if they solve the following task: theyare blindfolded and positioned in an equilateral triangle lookingto its center of gravity. Behind each of them is set up one offive flags, three white and two black ones. The two leftover flagsare discarded. Then the blindfolds are removed and each captivetries to determine the color of the flag behind. After quite a whileof intense consideration they nearly at the same time name thecorrect color of the flag behind them. How is that?

  • Section 2: More Riddles [11] 25

    Riddles, 588Problem 25.

    (a) 81 persons take part in a cross country run, twice as many menthan women. The number of children and twens is half the numberof adults. Twice as many twens as children take part. How manymen, women, twens, and children take part?

    (b) FFFEEE symbolizes a row of six glasses, three full and three emptyones.Touch/move only one glas (full or empty) to get a row of glassesevery second is full and every second is empty.

    (c)=

    Move only one match to get a correct equation.(d) Engine driver, stoker and conductor of a train are Mr. J., M., and

    B. On the train there are travellors Dr. J., Dr. M., and Dr. B.1. Dr. B. lives in Charlottenburg.2. Dr. J. earns 5000Euro a month.3. The conductor lives half way between Charlottenburg and Nurn-

    berg.

  • Section 2: More Riddles [11] 26

    4. His neighbour, one of the passengers, earns exactly thrice as heearns.

    5. The namesake of the conductor lives in Nurnberg.6. M. beats the stoker in chess.

    What is the name of the engine driver?(e) Roberts collects lizards, beetles, and worms. He has got more

    worms than lizards and beetles together. In total he has got 12specimen with 26 little legs. How many lizards has Robert?

    (f) Three men each have two jobs. The chauffeur insulted the musi-cian. Musician and gardener together go fishing. The painter isborrowing from the merchant. The chauffeur flirts with the sisterof the painter. Claus owes the gardener 20Euro. Joe beats Clausand the painter when playing chess. One of them is a barber. Notwo of them have the same job. Who has wich jobs?

    (g) Five women are sitting around a round table. Mrs. Owald sitsbetween Mrs. Lutz and Mrs. Martin. Erika sits between Katy andMrs. Neidlinger. Mrs. Lutz sits between Erika and Alice. Katyand Doris are sisters. Bettinas neighbour to the left is Mrs. Pieper,and to the right it is Mrs. Martin. Who with which first and which

  • Section 2: More Riddles [11] 27

    last name is sitting where?

    Riddles, 622Problem 26.

    (a) Are there 204 squares on a standard chess board?(b) Drawing any number of lines through some square partitions the

    square into disjoint regions. How many colors are needed at leastto color these regions such that no two adjacent regions have thesame color?

    (c) Mrs. A., E., I., O. and U. work in a star-shaped office with acentral main office and offices in the north, west, south and east.The wing offices are connected by the main office. Before A. andme exchanged work places, my office was north of O.s who workedeast of U. who worked west of E. At that time A. worked east of I.In addition A. had to make a right in in the central office when shewent to see E. Whereas me, I had to walk straight in the centraloffice when I went to see A. Who works where? and who is me?

  • Section 2: More Riddles [11] 28

    Labyrinth, 652Problem 27.

    (a) Find the intersection-free path through the labyrinth back to thestarting point.

    Riddles, 680Problem 28.

    (a) How can one measure 15min using a 7-min- and a 11-min-sandglass?

    Riddles, 708Problem 29.

    (a) Mr. Punctual sets his clock on Saturday noon by the radio. OnSunday noon he recognizes that his clock is six minutes late. Whatis the time on his clock on Monday at 8h?

  • Section 2: More Riddles [11] 29

    (b) At a bakery a woman buys half of all breads and half a loaf. Then,a second woman buys half of all remaining breads and half a loaf.After that, a third woman buys half of all remaining breads andhalf a loaf. Now, all breads are sold. How many breads did thebaker sell?

    (c) An automatic stamp tool prints consecutive numbers starting with0, one number per second. How often does it print the digit 1 inthe the first quarter of an hour?

    Riddles, 734Problem 30.

    (a) If campainers group themselves in rows of two, three upto ten,then in each case there is one campainer too little. How manycampainers are there, if there are less than 5000 campainers?

    (b) My sister, you have as many brothers as sisters!My brother, you have twice as many sisters as brothers!What is the number of children in this family?

  • Section 2: More Riddles [11] 30

    (c) The difference of the ages of two sisters is four. The differenceof the cube of the age of the first and the cube of the age of thesecond is 988. How old is each sister?

    Riddles, 750Problem 31.

    (a) On a farm there are equally many cows, pigs, horses and rabbits.There is a plague and all complain:Father: every fifth cow died. Mother: there are as many deadhorses as surviving pigs. Son: the new percentage of rabbits (outof the survivers) is 5/14. Grandma: death has hit each kind ofanimals.Prove that grandma is wrong.

    Riddles, 772Problem 32.

  • Section 2: More Riddles [11] 31

    (a) A bottle of wine costs 9 Euro. The wine costs 8 Euro more thanthe bottle. What is the price of the bottle only?

    (b) A father bequeathes his three sons 30 wine barrels, ten of whichare full, ten half empty and ten empty. How to devide barrels andwine so that each son gets the same number of barrels and thesame amount of wine?

  • 32

    3. Prime Numbers

    In all modern cryptographical algorithms prime numbers play a deci-sive role. On top of that prime numbers challenged not only mathe-maticians for millennia and, (futile) attempts to generate prime num-bers algorithmically date back centuries.

    Fermat-NumbersProblem 33. Fermat1 numbers are specified by

    F (n) = 22n

    + 1

    (a) Fermat himself misleadingly believed to enumerate (all?) primenumbers in this way.

    1 Pierre Fermat (1601-1665) www-history.mcs.st-and.ac.uk/history/Biographies/Fermat.html

  • Section 3: Prime Numbers 33

    Euler-NumbersProblem 34. Euler2 numbers are defined by

    E(n) = n2 n+ 41(a) Only the first 40 Euler-numbers are prime.

    2 Leonhard Euler (1707-1783) www-history.mcs.st-and.ac.uk/Biographies/Euler.html

  • Section 3: Prime Numbers 34

    Mersenne-NumbersProblem 35. Mersenne3 numbers are defined by

    M(n) = 2n 1(a) Only some Mersenne numbers are prime. But,

    n not primeM(n) not primeUnfortunately, M(n) is not necessarily prime if n is prime asalready a small (< 212) Mersenne number with four digits shows.

    3Marin Mersenne (1588-1648) www-history.mcs.st-and.ac.uk/Biographies/Mersenne.html

  • 35

    4. Computations with Remainders

    Crucial is What is Left OverModulo-Arithmetic, i.e. computations with remainders, is essential(not only) in cryptography.

    n mod m = r n = vm+ r fur n, v Z,m, r N und 0 r < m

    Problem 36.

    (a) Which day of the week do we have in n days?(b) Which day of the week did we have n days ago?(c) How is the UNIX-date computed, if an internal counter counts the

    seconds since 1.1.1970 0h ?

  • Section 4: Computations with Remainders 36

    Computing With Remaindersn r (mod m) m | (n r) m |n rn r (mod m) n r = v m fur m, r, v N und 0 r < m

    Problem 37.

    (a) Connection of n mod m = r and n r (mod m) ?(b) additivity, multiplicativity:

    n1 r1 (mod m)n2 r2 (mod m)

    }{

    (n1 n2) (r1 r2) (mod m)(n1 n2) (r1 r2) (mod m)

    (c) scalar multiples, powers

    n r (mod m){c n c r (mod m) fur jedes c Nnp rp (mod m) fur jedes p N

    (d) transitivity

    r s (mod m), s t (mod m) r t (mod m)

  • Section 4: Computations with Remainders 37

    Adroit Computing With RemaindersLet s(n) =

    i=0 zi denote the cross sum of n =

    i=0 zi10

    i.

    Problem 38. Better to test dividability than to divide!

    (a) 3 | s(n) 3 |n as well as 9 | s(n) 9 |nCompute 1234567890 mod 3, 1234567890 mod 9 etc.

    (b) 11 | i=o(1)izi 11 | i=0 zi10iCompute 1234567890 mod 11 etc.

    (c) The last digit of the 10-digit ISBNumber is a check digit, an error

    checking number, namely n mod 11 if n=9i=1 i zi denotes the

    weighed sum 1 z1 + 2 z2 + . . . + 9 z9 of the first nine digitsz1 . . . z9.(In case n mod 11 = 10 the check digit is represented by X.)

    (d) 7|i=0(z7i+0 + 3z7i+1 + 2z7i+2 z7i+3 3z7i+4 2z7i+5 + z7i+6) 7 | i=0 zi10i

    Compute 1234567890 mod 7 etc.(e) Parity, ECC, CRC, RSC, . . . ?

  • Section 4: Computations with Remainders 38

    Euclid & little FermatProblem 39. gcd(a, b) denotes greatest common divisor, gcd of a Nand b N, i.e. gcd(a, b) = d N with d | a and d | b as well asmaximality, i.e. d | a, d | b d | d.(a) For a, b N holds gcd(a, b) = gcd(a, b mod a) = gcd(b, a mod b)(b) By iteration we get the (terminating) Euclidean4 algorithm.(c) Fermat5s Little Theorem, FLT: if p is prime then

    ap1 1 (mod p)for all a N with gcd(a, p) = 1Contraposition:

    an1 6 1 (mod n) for one a N n is combined!(d) The implication holds n prim n | 2n1 1

    but not its contraposition n prim n | 2n1 1

    4 Euclid of Alexandria (ca 325-265) www-history.mcs.st-and.ac.uk/Biographies/Euclid.html5 Pierre Fermat (1601-1665) www-history.mcs.st-and.ac.uk/Biographies/Fermat.html

  • Section 4: Computations with Remainders 39

    Fermat, Euler and MoreProblem 40. The Euler6 function is defined by

    (n) = |{m N : m < n, gcd(m,n) = 1}|

    (a) If p is prime then (p) = p 1.(b) If p is prime then (pk) = pk pk1 = (p 1)pk1.(c) If r and s relatively prime then (r s) = (r) (s).(d) The prime factor decomposition of n provides a simple computa-

    tion of (n). Especially, for prime p and q we have

    (p q) = (n) = n (p+ q) + 1 = (p 1)(q 1) fur n = p q(e) Theorem of Euler, EFT7:

    a(n) 1 (mod n)for each n N and each a relatively prime to n.

    6 Leonhard Euler (1707-1783) www-history.mcs.st-and.ac.uk/Biographies/Euler.html7Euler-Fermat-Theorem, 1736

  • Section 4: Computations with Remainders 40

    Chinese StuffProblem 41.

    (a) Chinese Remainder Theorem: Let m1, m2, . . . , mn N bepairwise relatively prime. To find all solutions x N with

    x ri (mod mi) fur i = 1, . . . , ndetermine m =

    ni=1mi and bi = m/mi as well as xi with

    xibi = 1 mod mi, hence xi as the (modulo mi)-inverse to bi fori = 1, . . . , n. Then:

    x ni=1

    (xibiri) (mod m)

    (b) If p and q relatively prime, then

    x = y mod p und x = y mod q x = y mod (pq)(c) The age of say party guests can be computed by the remainders

    when dividing the unknown age by 3, 5 and 7.

  • Section 4: Computations with Remainders 41

    Galois Fields GF(p)Problem 42. Usually arithmetic takes place in fields with infinitelymany elements, like Q, R and C. However, in e.g. cryptography onlyfields with finitely many elements are relevant and hence needed.As a reminder, a field is a set F of elements with two operations, namely

    addition + and multiplication , so that (F,+) (with zero-element 0) and(F , ) = (F \ {0}, ) (with one-element 1) are commutative groups and theusual laws of distributivity hold:

    (F,+) is a commutative group (F , ) is a commutative groupa,bF a+ b = b+ a F a,bF a b = b a F

    0FaF a+ 0 = 0 + a = a 1FaF a 1 = 1 a = aaFaF a+ (a) = (a) + a = 0 aFa1F a a1 = a1 a = 1

    a (b+ c) = a b+ a c(a) How do addition and multiplication have to be defined in GF(2) ={0, 1}, the Galois8 field of order 2, i.e. with two elements?

    (b) How are addition and multiplication to be defined in GF(3) =8 Evariste Galois (1811-1832) www-history.mcs.st-andrews.ac.uk/Biographies/Galois.html

  • Section 4: Computations with Remainders 42

    {0, 1, 2}, the Galois field of order 3 ?(c) How are addition and multiplication to be defined in GF(5) ={0, 1, 2, 3, 4}, the Galois field of order 5 ?

    (d) How can this approach be generalized to GF(p) = {0, 1, 2, . . . , p1}, the Galois field of prime order p ? Why is this approachdoomed to failure for GF(pq) with primes p and q, i.e. for GF(m)with composite m ?

  • Section 4: Computations with Remainders 43

    Galois Fields GF(pn)Problem 43. Let p be prime and n N. If GF(pn) is defined to bea subset of P(n), the set of all polynomials of order n, i.e. of degreen1, with coefficients in GF(p), so called polynomials over GF(p),then two such polynomals over GF(p) are readily as usual added.(a) What is then

    (GF(pn),+

    )?

    (b) What happens if two polynomials r, s GF(pn) are multiplied aspolynomials over GF(p) ?

    (c) Assuming the product of two polynomials r, s GF(pn) is definedas the reminder of the product of r and s as polynomials overGF(p), divided by some polynomialm. How has such a polynomialm to look like, if each product so defined lies necessarily again inGF(pn) ?

    (d) Which polynomialsm(x) have to be excluded in order to guaranteethat products of non-vanishing factors do not vanish?

    (e) E.g., why is m1(x) = x2 + 1 a reducible and m2(x) = x

    2 + x + 1an irreducible polynomial over GF(2) ?

  • Section 4: Computations with Remainders 44

    Problem 44.

    (a) How do multiplication and computation of inverse elements inGF(22) with m(x) = x2 + x+ 1 look like?

    (b) Let m(x) be an irreducible polynomial over GF(p) of degree n.Defining a multiplication by

    r s := (r(x) s(x)) mod m(x)for r, s GF(pn) then, what is (GF(pn), ) ?

    (c) How are inverse elements in GF(pn) computed?(d) How many irreducible polynomials over GF(p) there are of a given

    (small) degree?(e) In constructing GF(pn), what impact has the choice of the irre-

    ducible polynomial m(x) over GF(p) of degree n 1 ?(f) Which elements generate e.g. GF(22) or GF(23) ?(g) How can the cyclicity of GF(pn) be used to speed up the multi-

    plication in GF(pn) ?(h) How can the cyclicity of GF(pn) be used to speed up the inversion

    in GF(pn) ?

  • 45

    5. Cryptography

    Caesar and CohortsProblem 45.Let the letters of the Latin alphabet be numbered from 0 to 25 !

    (a) Caesar9- encryption/decryption:Plain text x1x2x3 . . . is letter-wise encrypted by key k per

    y = (x+ k) mod 26 to give the encrypted text y1y2y3 . . .

    Encrypted text y1y2y3 . . . is letter-wise decrypted by key k per

    x = (y k) mod 26 to give the plain text x1x2x3 . . ..There is a encrypted text wklvlvdwrsvhfuhwphvvdjh.

    (b) How many keys are there? What degree of security is achieved?

    9Gaius Julius Caesar (100-44 v.Chr.)

  • Section 5: Cryptography 46

    Caesar in GeneralProblem 46.Let the letters of the Latin alphabet be numbered from 0 to 25 !

    (a) Under which condition is y = (kx) mod m a useful encryption

    method?(b) When

    encrypting per y = (k x) mod m and

    decrypting per x = (kinvy) mod m what kinv has to be used?

    (c) Combining both methods gives

    encryption per y = (k1 x+ ko) mod m and

    decryption per x = (k1y + ko) mod m using which k

    1 und k

    o ?

    (d) How many keys are there? What degree of security is achieved?

  • Section 5: Cryptography 47

    Vigene`re and AccomplicesProblem 47.Let the letters of the Latin alphabet be numbered from 0 to 25 !

    (a) Vigene`re10-encryption/decryption:Plain text x1x2x3 . . . is letter-wise encrypted to encrypted text

    y1y2y3 . . . per yi = (xi + ki mod l) mod 26 using key kok1...kl1,encrypted text y1y2y3 . . . is letter-wise decrypted to plain text

    x1x2x3 . . . per xi = (yi ki mod l) mod 26 using key kok1...kl1.dlgcmqkxmzwcmvcdqccwyqi is an encrypted message.

    (b) How many keys are there? What degree of security is achieved?

    10 Blaise de Vigene`re (1523-1596) raphael.math.uic.edu/~jeremy/crypt/contrib/deepak.html

  • Section 5: Cryptography 48

    PermutationsProblem 48. For Caesar- and Vigene`re-encryption/decryption it ischaracteristic that due to one (Caesar) or several (Vigene`re) onetoone functions f : A A of the used alphabet A each plain textletter is substituted by another ((monoalphabetic) substitution). Suchfunctions f are also called permutations.

    (a) The Latin alphabet A = {A,B, . . . , Z} has 26 letters. How manypermutations of A there are?

    (b) Do permutations provide new encryption/decryption methods essentially better than the Caesar- or the Vigene`re-method?

    (c) How feasible is encryption by just permuting the plain text letters?

  • Section 5: Cryptography 49

    DESProblem 49. Data Encryption Standard, DES [28] is a block ori-ented, symmetrical (identical keys for encryption and decryption)encryption/decryption method consisting of permutations and severalsubstitutions, s.a. www.itl.nist.gov/fipspubs/fip46-2.htm

    (a) The DES algorithm applies an initial permutation P , then severalsubstitutions, and finally P inv to each 64bit block of the plaintext. DES specifies P as follows

    P =

    58 50 42 34 26 18 10 2 60 52 44 36 28 20 12 462 54 46 38 30 22 14 6 64 56 48 40 32 24 16 857 49 41 33 25 17 9 1 59 51 43 35 27 19 11 361 53 45 37 29 21 13 5 63 55 47 39 31 23 15 7

    . What is P inv ?

    (b) Each of the other operations encrypts left and right 32bit halvesof a 64bit block (L,R) by 32bit key K per

    fK(L,R) = (R,LK) where denotes addition modulo 2f invK (L,R) = ? In what respect are these operations substitutions?

    (c) What type of encryption has been defined by L := P inv fK16

  • Section 5: Cryptography 50

    fK15 . . . fK2 fK1 P so far? with what consequences?(d) The last element in DES is a confusion/diffusion11-method which

    is implemented by the so called substitution boxes, S-Boxes: eachhalf block a` 32bit is extended to 48bit by duplicating certain bits(depending on the round): a total of eight S-Boxes S1, . . . , S8encrypt 6bit input to 4bit output each, e.g. S5

    S5 middle four bits of inputOuter2 bits

    0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111

    00 0010 1100 0100 0001 0111 1100 1011 0110 1000 0101 0011 1111 1101 0000 1110 100101 1110 1011 0010 1100 0100 0111 1101 0001 0101 0000 1111 1100 0011 1001 1000 011010 0100 0010 0001 1011 1100 1101 0111 1000 1111 1001 1100 0101 0110 0011 0000 111011 1011 1000 1100 0111 0001 1110 0010 1101 0110 1111 0000 1001 1100 0100 0101 0011

    s.a. www.itl.nist.gov/fipspubs/fip46-2.htm or e.g. alsowww.kuno-kohn.de/crypto/crypto/des.htm for all eight DES S-boxes. How big are the look up tables for the eight S-boxes allto-gether? How big would the look up table for the 32bit substitutionimplemented by the S-boxes be? How to invert a S-box?

    11 Claude E. Shannon (1916-2001) www-history.mcs.st-andrews.ac.uk/Biographies/Shannon.html

  • Section 5: Cryptography 51

    Problem 50. Since its publication, the security of the Data Encryp-tion Standard, DES was disputed, cp. e.g.http://en.wikipedia.org/wiki/Data Encryption Standard.In mid 1990ies, the insecurity of DES was demonstrated. This spurredimprovements especially for high security critical applications.

    (a) What is effective DES key length? what is the DES key space?(b) Triple DES, TDES or Triple Data Encryption Algorithm, TDEA

    consists in applying DES three times with three keys

    TDESK3,K2,K1(x) = DESK3(DESinvK2

    (DESK1(x)

    ))What condition guaranties that several DES encryptions (likeTDEA) offer substantially higher security?

    (c) What is effective TDEA key length? what is the TDES key space?(d) When and by what has DES resp. TDEA been superseded?

  • Section 5: Cryptography 52

    Public Keys?Problem 51. Symmetric encryption/decryption methods require that thekey (identical for encryption and decryption) can be exchanged between

    sender and receiver via a secure channel a contradiction per se!

    Asymmetric encryption/decryption methods working with pairs ofprivate, i.e. secret and public key, so called public key encryptionmethods12 do offer a solution.

    (a) For each partner A,B,C, . . . there is a public key and hence a publicencryption method fA, fB , fC , . . .. Each partner keeps her/his private

    key A1, B1, C1, . . . and hence her/his private decryption methodf1A , f

    1B , f

    1C , . . . top secret.

    Now, Bob can tell Alice say x by sending to her the encryptedmessage fA(x). Only Alice can decrypt this message by f

    1A to

    get x = f1A (fA(x)).What is the base of the security of such public key methods?

    12 Whitfield Diffie, Martin Hellman: New Directions in Cryptography;IEEE Trans. Inform. Theory, IT-22, 6, Nov 1976 pp.644-654

  • Section 5: Cryptography 53

    RSAProblem 52. The RSA13-method is a public key encryption/decryp-tion method. It works as follows:

    Let p and q be big prime numers and n = pq, i.e. (n) = (p1)(q1).A message x is encrypted by

    y = xe mod n with public key e, so that gcd(e, (n)

    )= 1.

    A message y is (decrypted) by

    x = yd mod n with private key d, so that e d = 1 mod (n).

    (a) Show: fe : x xe mod n is a trapdoor function.(b) The security of the RSA-method, on what basis does it rest?(c) f1e , i.e. fd can be used to generate a digital signature.

    If Alice signs her message digitally, then Bob is assured that amessage y he received truly originated by Alice. How to cut cost?

    13R. Rivest, A. Shamir, L. Adleman: A method for obtaining digital signaturesand public key cryptosystems; Communications ACM, 21 (1978), 120-126

  • Section 5: Cryptography 54

    AESProblem 53. Established in 2000, the Advanced Encryption Stan-dard, AES is DESs successor standard. To avoid all suspicions ofconspiracy of the standardizing body (NIST) with the developers ofthe standard (IBM in the case of DES) this standard is the result ofa public competition. AES represents a special case of the Rijndaelcipher [26].

    (a) What type of cipher is AES?(b) What are the characteristic parameters of AES.(c) What does a round of AES consist of?

    A. Hofmeier, AES Eine Einfuhrung in Kryptographie 10

    rechts weitergegangen und wieder oben angefangen.

    0

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    0

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    20

    21

    22

    23

    24

    25

    26

    27

    28

    29

    30

    31

    128 Bit-Block (16-Byte) 256 Bit-Block (32 Byte)

    In der folgenden graphischen Darstellung wird von einer Blockgroe von 128 Bitausgegangen. Die Blocke lieen sich allerdings in Vier-Byte-Schritten (32 Bit)bis auf 256 Bit ausweiten. Dasselbe gilt fur den Schlussel. Daten-Blockgroeund Schlussel-Block-Groe sind vollkommen unabhangig voneinander. Im AES-Standard sind allerdings lediglich Datenblockgroen von 128 Bit und Schlussel-blocklangen von 128, 192 und 256 Bit vorgesehen. Dies andert nichts daran, dassder Rijndael-Algorithmus mehr kann, was aber nicht notwendiger implementiertsein muss, wenn auf AES Bezug genommen ist.

    Die graphische Darstellung verdeutlicht den Fluss der Daten:

    k(0) k(1...) k(n)} }Round() FinalRound()

    SubByte() ShiftRows() MixColums()AddRoundKey( )

    Adaptiert von Daemen und Rijmen (2002).

    3.3.1 Anzahl der Runden

    Wie oben ersichtlich, wird die Funktion Round() N mal ausgefuhrt. Wobei N vonder Schlussel- und der Daten-Block-Groe abhangt. Die folgende Tabelle stelltdie Lange des Schlussels der Lange des Datenblockes gegenuber und gibt fur jedeKombination eine Anzahl von Runden an. Alle fett dargestellten Falle sind durch

  • Section 5: Cryptography 55

    Problem 54. Now, the functions of a round are to be examined sep-arately. Identifiers are used as incsrc.nist.gov/publications/fips/fips197/fips-197.pdf

    (a) SubBytes(): How is this substitution specified? How is it imple-mented by a s-box? How is the substitution inverted?

    (b) ShiftRows(): How is the permutation of the rows of a blockimplemented when a block is represented as 4 4-byte-matrix?How is this transformation inverted?

    (c) MixColumns(): How are the columns of a block transformed whena block is represented as 4 4-byte-matrix? How is this transfor-mation inverted?

    (d) AddRoundKey(): How are the columns of a block XORed by partsof the expanded key? Why is this transformation its own inverse?

  • Section 5: Cryptography 56

    Elliptic Curves over RProblem 55. To introduce Elliptic Curve Cryptography, ECC it isreasonable to consider so called elliptic curves y2 = x3 + ax + b overR, i.e. curves in R2 with real coefficients a, b R first.(a) Which geometric features exhibit elliptic curves E = E(R) =

    Ea,b(R) over R ? What happens for x + ?(b) What are the zeroes of the radicand x3+ax+b of an elliptic curve

    E = E(R) = Ea,b(R) over R ?(c) What condition guaranties that the radicand of an elliptic curve

    E = E(R) = Ea,b(R) over R has no multiple zeroes?(d) Given any non vertical, non tangent line intersecting an elliptic

    curve E = E(R) = Ea,b(R) over R at least twice. Why does theline then intersect the curve E trice?

    (e) Given P = (xP , yP ) and Q = (xQ, yQ) with xP 6= xQ on an ellipticcurve E = Ea,b(R) over R. Under the above condition, what arethe coordinates of the third intersection point R = (xR, yR) on Eand on the line through P and Q ?

  • Section 5: Cryptography 57

    Problem 56. One specifies an addition of points P and Q on anelliptic curve E = Ea,b(R) over R by defining R := P +Q to be the Rthe intersection point of the line through P and Q with E, mirroredat the x-axis.

    x

    y

    a = 3, b = 5

    P

    Q

    R

    R

    (a) How is P + P to be defined consistently?(b) How can P +Q for xp = xQ and yP 6= yQ be defined consistently?(c) What does this mean for P + Q with P = (xP , yP ) and Q =

    (xp,yP ) and the solvability of P +Q = R in Q for given P,R E ?

    (d) Which structure on E = Ea,b(R) is provided by this addition?

  • Section 5: Cryptography 58

    Elliptic Curves over GF(p)Problem 57. Elliptic curves E = Ea,b(R) over R are unfit for cryp-tographic purposes. Instead one uses elliptic curves E = Ea,b(F) oversome finite field F, e.g. F = GF(p) for prime p.(a) How is P +Q to be defined on E = Ea,b

    (GF(p)

    )?

    Elliptic Curves over GF(2m)Problem 58. Using F = GF(2m), another type of finite fields, allowsto define groups on elliptic curves E = Ea,b

    (GF(2m)

    )over GF(2m),

    namelyy2 + xy = x3 + ax+ b for a, b GF(2m)

    (a) Why can now y2 = x3 + ax+ b be used no longer?(b) How is P +Q to be defined on E = Ea,b

    (GF(2m)

    )?

  • Section 5: Cryptography 59

    Elliptic Curve Cryptography, ECCProblem 59. Elliptic Curve Cryptography, ECC is based on exploit-ing the group structure of a public elliptic curve E = Ea,b(F) oversome finite field F together with some suitable generator point G E.Each participant owns a secret and public key pair (r,Q) NE withrandom number 1 < r < card(< G >) and Q = rG.

    (a) What type of cipher is ECC, suitable for what applications?(b) How can an ECC based El-Gamal encryption/decryption be im-

    plemented?(c) How can an ECC based Diffie-Hellman key exchange, ECDH, be

    implemented?(d) How can an ECC based Digital Signature Algorithm, ECDSA be

    implemented?

  • 60

    6. Compression

    Exploiting Relative FrequenciesProblem 60.If the (relative) frequencies of the symbols in a text are known apriori then one can design a code so that the most frequent symbolsare assigned the shortest codes. Let us call such codings monotonous.To save the insertion of a special character to separate codes it isnecessary that each code cannot be confused with the beginning ofanother code: The coding has to be prefix- or comma-free.

    (a) Given an alphabet s1, s2, . . . , sn with frequency fi of symbol si,where f1 > f2 > . . . > fn for i = 1, . . . , n. Assume ci = code(si) =01i1 {0, 1}i. What about this code?

    (b) How to represent prefix-free codings by graphs?(c) Construct a monotonous prefix-free coding.

  • Section 6: Compression 61

    Using DictionariesProblem 61.The idea of LZW14 is to let sender and receiver set up and maintaina dictionary for characters and combination of characters to be sentand received.

    (a) Both in compression and decompression, first the dictionary is ini-tialized with the letters of the alphabet together with their codes.Then, plain text resp. compressed text is read character by char-acter.In compression, the text is read character by character. PATTERNis the longest string in the dictionary which coincides with therecently read input characters. In decompression the codes areread. At the same time, the dictionary is accordingly extended.

    14 Jacob Ziv and Abraham Lempel: A Universal Algorithm for Sequential DataCompression; IEEE Transactions on Information Theory, May 1977Terry Welch, A Technique for High-Performance Data Compression, Computer,June 1984

  • Section 6: Compression 62

    Compression: PATTERN = get input characterWHILE there are still input characters DO

    CHARACTER = get input character

    IF PATTERN+CHARACTER is in dictionary

    PATTERN = PATTERN+character

    ELSE

    output the code for PATTERN

    add PATTERN+CHARACTER to dictionary

    PATTERN = CHARACTER

    output the code for PATTERN

    Decompression: Read oldCODE; output dict[oldCODE]WHILE there are still input characters DO

    Read newCODE

    PATTERN = dict[newCODE]

    output PATTERN

    CHARACTER = first character in PATTERN

    add dict[oldCODE]+CHARACTER to dictionary

    oldCODE = newCODE

  • Section 6: Compression 63

    (b) There is a flaw in the algorithm presented above:

  • 64

    7. Probability & Intuition

    Cards & GoatsProblem 62.

    (a) In an urn there are three cards: one is on both sides red, one onboth sides blue, and the third one is on one soide red and on oneside blue.What is the probability P that a card drawn at random from theurn is red on the top side and blue on the bottom side?

    (b) In a contest there are three doors behind which two goats and acar are hidden (the quizmaster knows where).The candidate chooses a door. Then the quizmaster reveals a goatbehind another door.Does the candidate improve the chances to win the car by revisingher/his initial choice?

  • Section 7: Probability & Intuition 65

    Algorithms to Generate Chance?Random numbers play an importante role in simulation, (zero knowl-edge) authentification etc. Hence, high level programming languagesusually offer library functions like ran, random or randomize to al-gorithmically and hence deterministically generate so called pseudo-random numbers.

    Problem 63.

    (a) What are characteristics of random numbers besides being seem-ingly random (whatever this might be)? How to generate randomnumbers with such given characteristics from random numbers ofsome standard?

    (b) How to generate standard random numbers fast, i.e. by little com-putational effort?

    (c) xn+1 = (a xn + c) mod m, mit xo = 1is periodic why? and with which maximal/minimal periodiclength?

  • Section 7: Probability & Intuition 66

    What is Randomness?Criteria for the quality of pseudo random number generators have tobe established, especially of generators of evenly distributed, contin-uous pseudo random numbers in the unit interval. These criteria areto be assessed in tests.But, randomness has no definition, no specification. Therefore, therecan be tests only for certain features of randomness.

    Problem 64.

    (a) How to test whether the co-domain is evenly covered?(b) How to test randomness of pseudo random numbers by measuring

    the information content of each generated digit?(c) How to test randomness of pseudo random numbers by measuring

    their compressability?(d) How to test randomness of pseudo random numbers by measuring

    the mutual (in) dependece of their digits?

  • 67

    8. Sources and Links

    Some references on Recreational Mathematics

    [1] About.com: Recreational Mathematics;http://math.about.com/od/recreationalmath

    [2] Bild der Wissenschaft; www.wissenschaft.de/ s. Spiele-Archiv

    [3] Chlond, Martin: Integer Programming in Recreational Mathe-matics; www.chlond.demon.co.uk/academic/puzzles.html

    [4] Canadian Mathematical Society www.math.ca/Recreation

    [5] Dutch, Steven: Recreational Mathematics;www.uwgb.edu/dutchs/RECMATH/recmath.htm

    [6] Eppstein, David: Math Fun;www.ics.uci.edu/~eppstein/recmath.html

    [7] Flannery, Sarah: In Code A Mathematical Journey; ProfileBooks, 2000 ISBN 1-86197-222-9 2, 5, 6, 7, 8, 9, 10, 11

  • Section 8: Sources and Links 68

    [8] Gardner, Martin: Mathematical recreations and many more ti-tles; s. book list, e.g. http://thinks.com/books/gardner.htm

    [9] Gilleland, Michael: Recreational Mathematics Links;www.weblearn.hs-bremen.de/risse/MAI/docs/MichaelGilleland.html

    [10] Google Directory - Science > Math > Recreations;www.google.com/Top/Science/Math/Recreations

    [11] Herold, Helmut, Lurz, Bruno, Wohlrab, Jurgen: Grundlagen derInformatik; Pearson 2012 2, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,22, 23, 24, 25, 26, 27, 28, 29, 30, 31

    [12] Journal of Recreational Mathematics, Editor: Charles Ashbacherand Lamarr Widmer; www.baywood.com/journals/PreviewJournals.asp?Id=0022-412x

    [13] Mathematical Association of America, MAA: Recreational Math-ematics; www.maa.org/BLL/recmath.htm

    [14] Mathematikwettbewerb Kanguru e.V. www.mathe-kaenguru.des.a. www.weblearn.hs-bremen.de/risse/MAI/docs/

  • Section 8: Sources and Links 69

    [15] Michon, Gerard P.: Recreational Mathematics;www.numericana.com/answer/recreational.htm

    [16] New Scientist: Physics & Mathwww.newscientist.com/section/physics-math

    [17] OConnor, J.J., Robertson, E.F.: mathematical games and re-creations; www-groups.dcs.st-andrews.ac.uk/~history/HistTopics/Mathematical games.html

    [18] open directory project dmoz.org/Science/Math/Recreations/

    [19] Problem of the Week, s. e.g. www.google.com

    [20] Scientific American www.sciam.com,s. puzzling adventures in single issues

    [21] Singmaster, David: The Unreasonable Utility of RecreationalMathematics;

    anduin.eldar.org/~problemi/singmast/ecmutil.html

    [22] Euge`ne Strens Recreational Mathematics Collection Database;www.ucalgary.ca/lib-old/sfgate/strens

  • Section 8: Sources and Links 70

    [23] Wilkinson, David: Recreational Mathematics Links;www.scit.wlv.ac.uk/~cm1985/RecMaths.html

    [24] Wolfram Mathworld: Recreational Mathematics;mathworld.wolfram.com/topics/RecreationalMathematics.html

    Some references on Number Theory

    [25] Forster, Otto: Algorithmische Zahlentheorie; Vieweg 1996 187,194

    Some references on Cryptography

    [26] Federal Information Processing Standards, FIPS: Advanced En-cryption Standard (AES); Publication 197http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf

    Advanced Encryption Standard Algorithm Validation Listhttp://csrc.nist.gov/cryptval/aes/aesval.html 54

    [27] Daemen, Joan, Rijmen, Vincent: The Design of Rijndael AES,The Advanced Encryption Standard; Springer 2002

  • Section 8: Sources and Links 71

    [28] Federal Information Processing Standards, FIPS: Data Encryp-tion Standard (DES); Publication 46-3 http://csrc.nist.gov/publications/fips/fips46-3/fips46-3.pdf 49

    [29] Federal Information Processing Standards, FIPS: Digital Signa-ture Standard (DSS) DSA, RSA, and ECDSA algorithms; Pub-lication 186-2 http://csrc.nist.gov/cryptval/dss.htm

    [30] Hankerson, Darrel, Menezes, Alfred, Vanstone, Scott: Guide toElliptic Curve Cryptography; Springer 2004 264

    [31] Oswald, Elisabeth: Introduction to Elliptic Curve Cryptogra-phy; www.iaik.tugraz.at/aboutus/people/oswald/papers/Introduction to ECC.pdf 258, 261, 264

    [32] Standards for Efficient Cryptography Group, SECG: SEC1 El-liptic Curve Cryptography;

    www.secg.org/collateral/sec1 final.pdf 264

    [33] Wagner, Neal R.: The Laws of Cryptography;www.cs.utsa.edu/~wagner/lawsbookcolor/laws.pdf

  • Section 8: Sources and Links 72

    Some references on Coding Theory and Compression

    [34] Dankmeier, Wilfried: Codierung; Vieweg 2001

    [35] Nelson, Marc, Gailly, Jean-loup: The Data Compression Book;2nd edition, M&T Books, New York, NY 1995

    Some references on Probability

    [36] Bronstein, I.N. & Semendjajew, K.A. et al: (Teubner-) Taschen-buch der Mathematik; Teubner 2003 284

    Of course, any feedback, critics, inventive problems and solutions aremost welcome.

    Prof. Dr. Th. Risse, ZIMT 244, 0049 (0)421 5905-5489www.weblearn.hs-bremen.de/risse mailto: [email protected]

  • 73

    Solutions to Problems

    Problem 1(a)

    4 = (5 3) + (5 3)

  • Solutions to Problems 74

    Problem 1(b)

    1 = 3 + 3 5

  • Solutions to Problems 75

    Problem 1(c)

    For example, 5 = 9 4, 3 = 4 + 4 + 4 9, . . .

  • Solutions to Problems 76

    Problem 1(d)

    There is no solution.

  • Solutions to Problems 77

    Problem 2(a)

    This is the height he achieves each day:

    At the 1st day he reaches 300m, in the 1st night back to 100mat the 2nd day he reaches 400m, in the 2nd night back to 200mat the 3rd day he reaches 500m, in the 3rd night back to 300m. . .at the 27th day he reaches 2900m, in the 3rd night back to 2700mat the 28th day he reaches 3000m

  • Solutions to Problems 78

    Problem 2(b)

    A needed tA time units, TU for the 100m. Hence his speed is vA =100/tA.

    B needed tB TU for the 100m. Hence his speed is vB = 100/tB =90/tA. Therefore tA/tB = 0.9.

    The speed of C is vC = 90/tB = x/tA. Therefore x = 90tA/tB =90 0.9 = 81m.Thus, the first runner A beats C by 19m.

  • Solutions to Problems 79

    Problem 3(a)

    36 = 22 32. If one considers also the one year olds, then there arethe following combinations:

    3. 2. 1.

    1 1 36 381 2 18 211 3 12 161 4 9 141 6 6 132 2 9 132 3 6 113 3 4 10

    Only in case of sum 13 another hint was necessary. But there is anoldest child only if the family has two years old twins and a nine yearsold child.

  • Solutions to Problems 80

    Problem 4(a) poor mans solution:

    The catastrophe happens after one hour. Then, the fly has travelled75km.

    alledgedly John von Neumanns solution:

    Let sl be the position of the left train, sr that one of the right train.The fly started right. Let t1 be the point in time when the fly meetsthe left train, t2 when it meets the right trains, etc.Then, we have sl(t1) = 50t1 and 75 = (100 sl(t1))/t1. Hence,75t1 = 100 50t1, 125t1 = 100 and finally t1 = 4/5.

    t/h sl(t)/km sr(t)/km d/km0 0 100 04/5 40 60 604/5 + 4/25 48 52 124/5 + 4/25 + 4/125 49.6 50.4 2.4

    ...

    where d is the distance the fly has travelled between two impinge-

  • Solutions to Problems 81

    ments.

    The point in time of the catastrophe is

    t = 4i=1

    0.2i = 4

    (1

    1 0.2 1)

    = 4

    (5

    4 1)

    = 1

    and the total travelled distance

    754

    5+ 75

    4

    25+ 75

    4

    125. . . = 75km.

  • Solutions to Problems 82

    Problem 5(a)

    Let sh(t) and sr(t) denote the distance travelled along the outwardjourney and the return journey resp., at any point t in time betweensunrise 0 and sunset 1.

    Let d denote the total distance between A and B. Then, sh(0) = 0,sh(1) = d, sr(0) = d, sr(1) = 0.

    With sh and sr also (t) = sr(t) sh(t) is a continuous function of t.Because of the different signs of (0) = d and (1) = d the function(t) has at least one zero to in the intervall [0, 1].

    At time to we have sr(to) = sh(to).

    Under which conditions are there more than one such point?

  • Solutions to Problems 83

    Problem 6(a) There are eight equations with nine unknowns. And,the solutions have to consist of the natural numbers 1,. . . ,9.Stepwise pick the arrangements corresponding to magic squares froma total of 9!=362880 arrangements.

    1. The number in the middle/centre is necessarily 5.It cannot be n = 6, 7, 8 or 9 because then m = 9, 8, 7 or 6 hadno place in the magic square.

    2. The 9 is in no corner, neither in NO, NW, SW, nor SO.Assuming NW=9 the SO=1 and for the three numbers 6,7 and8 there would be left only the two positions O and S.

    3. Without restriction of generality let W=9, then either NW=2and SW=4 or NW=4 and SW=2.Assuming now NW=3.Then also SW=3. But the number 3must not appear twice.

    Two of the eight possible magic squares identical when taking sym-metry into consideration are presented

  • Solutions to Problems 84

    2 7 6

    9 5 1

    4 3 8

    und

    4 3 8

    9 5 1

    2 7 6

    How do the other six magic squares look like?

  • Solutions to Problems 85

    Problem 7(a)

    This text has no letter e, but every other letter of the Latin alphabetoccurs at least once.

    Write a similar text in German.

  • Solutions to Problems 86

    Problem 8(a)

    With the following procedure he acquires the average salary withouthim or any of his employees getting to know an individual salary.

    1. He at random chooses a big secret number k.

    2. He tells k to the first employee in order to increment k by her/hisown salary and to tell the sum to the second employee.

    3. One after another the employees get to know some number inorder to increment it by their own salary and to tell the sum tothe next colleague.

    4. The last nth employee increments the number by her/his salaryand tells the sum g to the boss.

    Then, the average salary is (g k)/n.

  • Solutions to Problems 87

    Problem 9(a)

    The problem is to let Alice get at the content of the box. The twoagree on the following procedure:

    1. Bob sends the box locked by his lock to Alice.

    2. Alice additionally locks the box she received by her lock andsends it back to Bob.

    3. Bob removes his lock from the box and sends the box locked byonly Alices lock back to Alice.

  • Solutions to Problems 88

    Problem 10(a)

    They agree say per e-mail on the following procedure:

    1. Alice and Bob agree to use a suitable one way function f , i.e. aonetoone function f : N D W N, so that f(x) is easilyand f inv(y) is extremely hard to compute.

    2. Now, say Alice starts and chooses an odd or even x D. Nowshe sends y with y = f(x) to Bob without offenbaren x.

    3. Bob receives y and bets whether x was odd or even.(If he wins then Alice otherwise Bob has to drive.)

    4. Alice checks Bobs bet and sends x to Bob for verification, i.e.to let Bob compare f(x) with the y he initially received.

  • Solutions to Problems 89

    Problem 11(a)

    They need three locks with two keys each. If each person owns keysaccording to the following scheme,

    Alice

    Bob

    Claire

    PPPPPPPPPPPPPPPPPP

    lock 1

    lock 2

    lock 3

    then only at least two persons together have keys for all three locksof the treasure box.

  • Solutions to Problems 90

    Problem 11(b)

    The following schema represents a solution

    Alice

    Bob

    Claire

    Dennis

    PPPPPPPPP

    QQQQQQQQQ

    PPPPPPPPP

    QQQQQQQQQ

    PPPPPPPPP

    lock 1

    lock 2

    lock 3

    lock 4

    because one person is always lacking a key, and any two persons to-gether have a key to each of the four locks.

    Is this solution with four locks with three keys each minimal?

    With three locks each person may have at most two keys. Hence thereare a total of at most eight keys for three locks and for four persons:

  • Solutions to Problems 91

    There is no lock with only one key, because without the owner of thatone key pairs of persons cannot open the treasure box.Hence there is either one person with keys to four locks or there aretwo persons with keys to three locks. In both cases a contradiction!

    Finally with four locks, it is not sufficient to have two keys per personbecause then any two persons together might not have keys to eachof the four locks!

  • Solutions to Problems 92

    Problem 11(c) ???

  • Solutions to Problems 93

    Problem 12(a)

  • Solutions to Problems 94

    Problem 12(b)

  • Solutions to Problems 95

    Problem 12(c)

  • Solutions to Problems 96

    Problem 12(d)

  • Solutions to Problems 97

    Problem 13(a)Let (x, y) be the state of the system with x litres in the four litre andy litres in the nine litre bucket. Then the follwing state transitionsare possible.(0, 0) (0, 9) (4, 5) (0, 5) (4, 1) (0, 1) (1, 0) (1, 9)(4, 6)

  • Solutions to Problems 98

    Problem 13(b)(0, 0) (3, 0) (0, 3) (3, 3) (1, 5) (1, 0)

  • Solutions to Problems 99

    Problem 13(c)Let (x, y, z) be the state of the system with x litres in the 8 litrecanister, y litres in the 5-litre and z litres in the 3-litre jug. Then thefollwing state transitions are possible.(8, 0, 0) (5, 0, 3) (5, 3, 0) (2, 3, 3) (2, 5, 1) (7, 0, 1) (7, 1, 0) (4, 1, 3)

  • Solutions to Problems 100

    Problem 13(d)The barrel should contain 9 litres, the bucket 6 litres and the jug 3litres. The can is empty. Let (w, x, y, z) be the state of the systemwith w litres in the barrel, x litres in the bucket, y litres in the jug andz litres in the can. Then the follwing state transitions are possible.(18, 0, 0, 0) (10, 8, 0, 0) (10, 6, 0, 2) (10, 6, 2, 0) (7, 6, 5, 0)(7, 6, 3, 2) (9, 6, 3, 0)

  • Solutions to Problems 101

    Problem 14(a)Let f , m, c1 and c2 denote ages of father, mother, oldest child andyoungest child resp. Then we know

    a) f +m+ c1 + c2 = 124b) f +m = 3(c1 + c2)c) m > 2c1d) f m = 9(c1 c2)

    a) and b) give c1 + c2 = 31 und f +m = 93 sowie 2f = 93 + 9(c1 c2)or 2m = 93 9(c1 c2). In any case c1 c2 is odd.If c1 c2 = 1 then c1 + c2 = 31 implies c1 = 16 and c2 = 15 as wellas m > 32. From f +m = 93 and f m = 9 we conclude f = 51 andm = 42 > 32. This is the only solution.

    Namely, if otherwise c1 c2 3 then c1 + c2 = 31 implies c1 17and c2 14 as well as m > 34. From f +m = 93 and f m 27 weconclude f 60 and m 33, a contradiction.

  • Solutions to Problems 102

    Problem 14(b)E = 24 = 2(A d) where E d = A = 24 d so that 12 = A d =2A 24 and thus A = 18.

  • Solutions to Problems 103

    Problem 14(c)In any case, one has to pay (1 15 )(1 + 15100 ) = 45 2320 = 2325 -fold or 92%of the netto-price.

  • Solutions to Problems 104

    Problem 14(d)

    2

    2

    1

    1

  • Solutions to Problems 105

    Problem 14(e)

    F 5 = 2(P 6)F + 9 = 3(P 4)

    F 2P = 7)F 3P =21

    P = 14F = 21

  • Solutions to Problems 106

    Problem 15(a)

    11 18

    27Let A, B, and C the labels of the three vertices. From

    A B 27B + C 18A+ C 11

    we conclude B A = 7 and thus B = 17, A = 10 and C = 1. Ingeneral there is only a system of linear equations to solve.

  • Solutions to Problems 107

    Problem 15(b)From (30 a) + (7 a) = 34 a we get 3 = 3a and hence a = 1.

  • Solutions to Problems 108

    Problem 15(c)g1 +g2 +g2 = 10, g2 =

    43g1, g3 =

    34g2 g1 + 43g1 + 34 43g1 = 10 = 103 g1 g1 = 3, g2 = 4, g3 = 3.

  • Solutions to Problems 109

    Problem 15(d)k + ` + m + n = 79 and ` + 1 = 2k and m + 1 = 2` and n + 1 = 2mimply 79 = k+2k1+2`1+2m1 = 3k3+(4k2)+(4`2) =7k 7 + (8k 4) = 15k 11 and thus 15k = 90, therefore k = 6,` = 11, m = 21, and n = 41.

  • Solutions to Problems 110

    Problem 15(e)Let m and d be the number of sacks the mule and the donkey carryresp. Then m + 1 = 2(d 1) and m 1 = d + 1 imply m = 7 andd = 5.

  • Solutions to Problems 111

    Problem 16(a)U = 2pir = pir2 = A r = 2

  • Solutions to Problems 112

    Problem 16(b)Let ` [m] be the length and v [m/sec] the speed of the train. We know` = 7v and 330 = (18 7)v, hence v = 30 [m/sec] and ` = 210 [m].

  • Solutions to Problems 113

    Problem 16(c)In total, he worker produces x parts. To produce the first half it takesx20 days, to produce the second half it takes

    x60 days. On average, he

    produces xx/20+x/60 =604 = 15 parts per day.

  • Solutions to Problems 114

    Problem 16(d)n = d310

    3 + d2102 + d110 + do is palindromial n = do103 +

    d1102+d110+do. For such n we have 11|n = 1000do+110d1+do

    n|1001do = 11 91do.

  • Solutions to Problems 115

    Problem 16(e)I, a man, 7 wives, 72 sacks, 73 cats, 74 kids, i.e.

    1+4i=o 7

    i = 1+ 75171 = 1+

    16 (8235431) = 1+137257 = 137258

  • Solutions to Problems 116

    Problem 16(f)44 =

    4334 = (1 +

    13 )

    34

  • Solutions to Problems 117

    Problem 17(a)One cat catches 1 mice in 5 minutes. One cat cathes 20 mice in 100minutes. Five cats catch 100 mice in 100 minutes.

  • Solutions to Problems 118

    Problem 17(b)Let 6 a, b 10 for a, b N. Then, in general we have10(a5+b5)+(10a)(10b) = 10(a+b)100+10010(a+b)+ab = ab

  • Solutions to Problems 119

    Problem 17(c)One hen lays one egg in one and a half days. Seven hens lay seveneggs in one and a half day. Seven hens lay 28 eggs in six days.

  • Solutions to Problems 120

    Problem 17(d)Let the type denote at the same time the weight. Then we haveA = 2B, B = 3C, C = 5D A = 2B = 6C = 30D.

  • Solutions to Problems 121

    Problem 17(e)Because of the prime factorization 5291 = 11 13 37 und 3913 =7 13 43 the twins are a 13 year old girl and a 13 year old boy.

  • Solutions to Problems 122

    Problem 18(a)One cat catches 1 mice in 5 minutes. One cat cathes 20 mice in 100minutes. Five cats catch 100 mice in 100 minutes.

  • Solutions to Problems 123

    Problem 18(b)One must not divide by 0.

  • Solutions to Problems 124

    Problem 18(c)Let n be the numerator and d be the denominator. The we havend =

    n+65d+5 5n = 65d n = 13d nd = 13.

  • Solutions to Problems 125

    Problem 18(d)The numbers are n, n+ 1, n+ 2, n+ 3, n+ 4 for some n N. Then wehave n2 + (n+ 1)2 + (n+ 2)2 = (n+ 3)2 + (n+ 4)2 3n2 + 6n+ 5 =2n2 + 14n+ 25 n2 8n 20 = 0 n1,2 = 4

    36 n = 10.

  • Solutions to Problems 126

    Problem 18(e)Let b be the (price of the) bottle and w of the wine. Then b+ w = 9and w = b+ 8 imply 2b+ 8 = 9 or b = 12 Euro.

  • Solutions to Problems 127

    Problem 18(f)Let x be the area of his land. Then we have x3 +

    x4 +

    x5 + 26 = x

    4760x+ 26 = x 1360x = 26 x = 120.

  • Solutions to Problems 128

    Problem 18(g)There are 8 saussages and each person eats 83 saussages. Egon paysfor his 83 saussages 8 Euro. Therefore a saussages costs 3 Euro. Hence,Heini gets for the 3 83 = 13 saussages he has not eaten himself 1 Euroand Carl gets for the 5 83 = 73 saussages he has not eaten himself7 Euro.

  • Solutions to Problems 129

    Problem 18(h)

    1

    2+

    1

    3+

    1

    9=

    9 + 6 + 2

    18=

    17

    18Thus, the oldest son gets 9 cows, the middle one 6 cows and theyoungest son 2 cows. The moderating neighbour, the 18th person,gets no cow.

  • Solutions to Problems 130

    Problem 19(a)time this side bridge other side00 ABCD

    BC AD25 BC AD

    BC A D30 ABC D

    B AC D50 B ACD

    B A CD55 AB CD

    AB CD65 ABCD

    time this side bridge other side00 ABCD

    CD AB10 CD AB

    CD A B15 ACD B

    A CD B40 A BCD

    A B CD50 AB CD

    AB CD60 ABCD

    The left plan obviously does not work. However, it saves time to letC and D together cross the bridge. But the two must not be the firstto let somebody faster return the torch.

  • Solutions to Problems 131

    Problem 20(a)

  • Solutions to Problems 132

    Problem 20(b)Put the right most coin on top on the coin at the intersection of thetwo rows.

  • Solutions to Problems 133

    Problem 20(c)

  • Solutions to Problems 134

    Problem 20(d)The ith vassal has to contribute to the weighing i coins. If all wouldpay in 10g coins then the contributions would amount to 10

    30i=1 i =

    10 30312 = 150 31g coins. Now, if the jth vassal contributes 9g coinsthen this will lead to a deficit of exactly jg coins, thus convicting thejth vassal.

  • Solutions to Problems 135

    Problem 21(a)

    time farmers blacksmith apprentice

    0 30 301 30 302 25 5 303 3 25 2 30

    bezahlt 27 bekommen 25 behalten 2 30

    One must not mix debit and credit.

  • Solutions to Problems 136

    Problem 21(b)Construct a regular tetraeder in space (!).

  • Solutions to Problems 137

    Problem 21(c)

    1

    2

    3 45 6

    7 8

    9 10

  • Solutions to Problems 138

    Problem 21(d)Interchanging rows or columns leaves the number of bottles in rowsor columns unchanged. Hence, we can assume that rows and columnsare ordered according to descending number of bottles.Then, the number of rows with six bottles must be even, namely two.The remaining two bottles produce odd columns if put into a row,and odd rows if put into a column.The number of rows with four bottles is even, namely two. The re-maining six bottles similarly produce odd rows or columns necessarily.It is not possible to store 14 bottles in the tray in rows with only twobottles.

  • Solutions to Problems 139

    Problem 22(a)The last but two factor is (xx). This implies (xa)(xb) . . . (xz) =0.

  • Solutions to Problems 140

    Problem 22(b)

    The arrow indicates the viewing direction. The new positions areshown. Horizontally and vertically horizontal and vertical arrows al-ternate. Thus, the intended position/orientation is not achievable.

  • Solutions to Problems 141

    Problem 22(c)Opposite corner squares have the same color. Removing these squarescauses the number of black and white squares to differ. But, a dominopiece covers always exactly one white and one black square. Therefore,the modified chess board cannot be covered by domino pieces.

  • Solutions to Problems 142

    Problem 22(d)n = 10t+ 5 n2 = 100t2 + 100t+ 25 = 100t(t+ 1) + 25.

  • Solutions to Problems 143

    Problem 23(a)No, the inner cuboid has no face on the outside. To cut it one needssix cuts. So six is the minimum number of cuts.

  • Solutions to Problems 144

    Problem 23(b)One needs for one floor c1 = 2, for two floors c2 = c1 + 1 + 2 2 = 7and for three floors c3 = c2 + 2 + 2 3 = 15 cards, hence in generalci = ci1 + (i 1) + 2i = ci1 + 3i 1 with c1 = 2. The assumptionci = Ai

    2 +Bi+C gives ci =32 i2 + 12 i, especially c47 =

    3247

    2 + 1247 =1247(3 47 + 1)47 71.

  • Solutions to Problems 145

    Problem 23(c)?

  • Solutions to Problems 146

    Problem 23(d)?

  • Solutions to Problems 147

    Problem 24(a)There cannot be two black flags because the captive seeing the twoblack flags would have instantenously concluded that the flag behindmust be white.Hence there also cannot be a single black flag because the two captivesseeing the one black flag would have instantenously concluded thatthe flags behind them must both be white. So after a while theyunanimously conclude that behind them there are only white flags.

  • Solutions to Problems 148

    Problem 25(a)Let C, T , W , M denote the number of children, twens, women, andmen resp. Then we have: 2C = T , 2W = M , 3C + 3W = C + T +W +M = 81 und 2 3C = 2(C + T ) = W +M = 3W , also 2C = Wund daher C = 9, T = 18 = W , M = 36.

  • Solutions to Problems 149

    Problem 25(b)FFFEEE

    Take the second full glas and empty it into the second empty glas.

  • Solutions to Problems 150

    Problem 25(c)

    =

    d.h. 1 =

    1

  • Solutions to Problems 151

    Problem 25(d)With a), b) and f) we have

    personnel J M B

    job 6= firemantravellers Dr. J Dr. M Dr. B

    income 5000Euro/Monatresidence Ch-burg

    5000 is not divisible by 3. Hence, Dr. J is no neighbour of the conduc-tor who lives in (Ch.+N)/2 and not in N so that Dr. J lives neither inCh. nor in (Ch.+N)/2. Because of e) Dr. J lives in N. Also, Dr. M isneighbour of tghe conductor. Because of e) the name of the conductoris J. Therefor, the name of the is B.

    personnel J M B

    job conductor 6= fireman engine drivertravellors Dr. J Dr. M Dr. B

    income 5000Euro/monthresidence N (Ch+N)/2 Ch

  • Solutions to Problems 152

    Problem 25(e)Let the number of lizards, beetles and worms be L, B, and W resp.We have L + B + W = 12. Lizards got four and beetles got six legs.Worms got no legs. Hence, 4L+ 6B = 26 implies B {1, 3}.If B = 1, then L = 5 and W = 6 = L+B which is excluded becauseof W > L+B.If B = 3, then L = 2 and W = 7 > L+B.

  • Solutions to Problems 153

    Problem 25(f)One after another we get the following jobs:

    Joe Hans Klausgardener 6= musiscian, 6= gardener 6= gardener

    musicianchauffeur painter

    merchantbarber

  • Solutions to Problems 154

    Problem 25(g)

    We assume that sisters have the same last name.

    Bettina

    Pieper

    Martin

  • Solutions to Problems 155

    Problem 26(a)There is 12 = 1 square with side length 8.There are 22 = 4 squares with side length 7.There are 32 = 9 squares with side length 6.. . .There are 88 = 64 squares with side length 1.

    In total, there are8i=1 i

    2 = n(n+1/2)(n+1)3

    n=8

    = 88.593 = 24172 =

    12 17 = 204 squares.

  • Solutions to Problems 156

    Problem 26(b)

    To color the three outer sectors one needs three col-ors. Then, to color the inner disk one needs anotherforth color. cp.http://en.wikipedia.org/wiki/Four color theorem

  • Solutions to Problems 157

    Problem 26(c)???

  • Solutions to Problems 158

    Problem 27(a)

  • Solutions to Problems 159

    Problem 28(a)At t = 0 start both sand glasses. At t = 7 turn both sandglasses.After 4 min, i.e. at t = 11 the 11-min sand glass is drained. Turn the7-min sand glass, in order to measure the rest 4 min.

  • Solutions to Problems 160

    Problem 29(a)The clock is late 6min/24 = 1/4min = 15sec per hour, i.e. in 24 +20 = 44 hours it is 11 min late and at 8h it shows 7:49h.

  • Solutions to Problems 161

    Problem 29(b)For the third woman is exactly one bread left: she buys half of it andanother half so that all bread is sold.For the second woman there are three breads left: she buys one anda half and another half leaving the one bread for the third woman.For the first woman there are seven breads left: she buys three and ahalf and another half leaving the three breads for the third woman.The baker has sold seven loafs of bread.

  • Solutions to Problems 162

    Problem 29(c)A quarter of an hour has 15 60 = 900 seconds. The stamp tool printnumbers 0 to 899 in the first to the 900th second. The sequence 0,1,. . . , 99 contains 10+10=20 ones. The sequence 100, 101, . . . , 199contains 120 ones. In total, the stamp tool prints 280 ones.

  • Solutions to Problems 163

    Problem 30(a)For the number n of campainers we have n mod 2 = 1, n mod 3 = 2,. . .n mod 10 = 9. And the chinese remainder theorem produces n =2519, s.a.www.arndt-bruenner.de/mathe/scripts/chinesischerRestsatz.htm

  • Solutions to Problems 164

    Problem 30(b)Let S and B be the number of sisters and brothers resp.

    S 1 = B, S = 2(B 1) B = 3, S = 4.

  • Solutions to Problems 165

    Problem 30(c)Let A and B be the age of the first and the second sister resp. Then,we have

    AB = 4, A3 B3 = 988 = (AB)(A2 +AB +B2) A2 +AB +B2 = A2 +A(A 4) + (A 4)2 = 247 3A2 12A 231 = 0 A2 4A 77 = 0 A = 11, B = 7.

  • Solutions to Problems 166

    Problem 31(a)There are n cows, n pigs, n horses and n rabbits of which survived 45ncows, 45n pigs,

    15n horses and r n rabbits. The we have

    514 =

    r n95n+r n

    =r

    95+r

    , hence 9 + 5r = 14r and therefore r = 1, so that no rabbit died.

  • Solutions to Problems 167

    Problem 32(a)Let B be the price of the bottle and W be the price of the wine. Thenwe have 9 = F +W = F + (F + 8) = 2F + 8, i.e. 2F = 1 and henceF = 12 .

  • Solutions to Problems 168

    Problem 32(b)Each son has to get the amount of 13 (10 + 5) = 5 barrels full of wine.Fill half the wine of each of the full barrels into one of the emptybarrels. Then we have 30 half empty barrels and each son gets 10 ofthem.

  • Solutions to Problems 169

    Problem 33(a) The first three Fermat numbers

    F (1) = 221

    + 1 = 5, F (2) = 222

    + 1 = 17, F (3) = 223

    + 1 = 257can easily be verified to be prime. Using calc.exe, a pocket calcula-tor, www.weblearn.hs-bremen.de/risse/MAI/docs/numerics.pdf,etc. also the fourth Fermat number F (4) is verified to be prime.

    F (4) = 224

    + 1 = 65537

    Not until Euler15 it was achieved to factorise the fifth Fermat number

    F (5) = 225

    + 1 = 4294967297 = 641 6700417This and a fortiori factorisation of the sixth Fermat number

    F (6) = 226

    + 1 = 18446744073709551617 = 274177 67280421310721today is conveniently possible using powerful tools like Mathematica,Maple, MATLAB, MuPAD, etc. (cp. /risse/symbolic/)

    15 Leonhard Euler (1707-1783) www-history.mcs.st-and.ac.uk/Biographies/Euler.html

  • Solutions to Problems 170

    Problem 34(a)

    For example,E(41) = 1681 = 412

    and similarlyE(42) = 1763 = 41 43.

    To carry on s.a. www.weblearn.hs-bremen.de/risse/MAI/,www.cs.unb.ca/profs/alopez-o/math-faq/math-faq.pdf

  • Solutions to Problems 171

    Problem 35(a)

    Namely, M(11) = 2047 = 23 89.The Lucas16-Lehmer17-test, s. e.g. (3.2.8 What is the current statuson Mersenne primes?) ofwww.cs.unb.ca/profs/alopez-o/math-faq/math-faq.pdf tests ef-ficiently whether a Mersenne number is prime or not. 1999 a record inthe Great Internet Mersenne Prime Search (GIMPS), was establishedshowing that M(6972593) a number with 2098960 digits is prime.

    Everybody can provide idle cycles of PCs to compute prime Mersennenumbers, s. Great Internet Mersenne Prime Search (GIMPS)

    GIMPS runs many more projects of distributed computing.

    16Francois E.A. Lucas (1842-1891) www-history.mcs.st-and.ac.uk/Biographies/Lucas.html17Derrick N. Lehmer (1867-1938) www.math.berkeley.edu/publications/newsletter/2000/lehmer.html

  • Solutions to Problems 172

    Problem 36(a)

    It is the (n mod 7)th day of the week if we arrange the days of theweek cyclically numbered from 0 to 6 starting with todays day of theweek.

  • Solutions to Problems 173

    Problem 36(b)

    It is the ((7 (n mod 7)) mod 7)th day of the week if we arrange theseven days of the week cyclically numbered from 0 to 6 starting withtodays day of the week.

  • Solutions to Problems 174

    Problem 36(c)

    E.g. see

    www.cl.cam.ac.uk/~mgk25/iso-time.html

  • Solutions to Problems 175

    Problem 37(a)

    Per definition we have for m,n, r Nn mod m = r n = v m+ r fur ein v N

    n r = v m fur ein v N m|n r n r (mod m)

  • Solutions to Problems 176

    Problem 37(b)

    additivity:

    n1 r1 (mod m) n1 r1 = v1mn2 r2 (mod m) n2 r2 = v2m

    (n1 n2) (r1 r2) (mod m)n1 + n2 (r1 + r2) = (v1 + v2)mmultiplicativity:

    ni ri (mod m){m|n1 r1m|n2 r2

    }{m|r2(n1 r1)m|n1(n2 r2)

    }

    m|r2(n1 r1) + n1(n2 r2) = n1n2 n1r2 + n1r2 r1r2 n1 n2 r1 r2 (mod m)

  • Solutions to Problems 177

    Problem 37(c)

    scalar multiples

    n r (mod m) m|n r m|c(n r) c n c r (mod m)powers either by multiplicativity or directly by induction: p=1

    which leaves us to show np rp(mod m) np+1 rp+1(mod m)n r (mod m)np rp (mod m)

    }{m|n rm|np rp

    }{m|rp(n r)m|n(np rp)

    }

    m|rp(n r) + n(np rp) = np+1 nrp + nrp rp+1 np+1 rp+1 (mod m)

  • Solutions to Problems 178

    Problem 37(d)

    transitivity

    r s (mod m), s t (mod m) m | r s,m | s t m | (r s) + (s t) = r t r t (mod m)

  • Solutions to Problems 179

    Problem 38(a)

    Division by 3: (due to exponentiation)

    10o = 1 1 (mod 3) 10p 1 (mod 3)and (due to multiplicativity)

    zi10i = zi 1 (mod 3) n =

    i=0

    zi10i

    i=0

    zi (mod 3)

    Specially we have

    s(n) 0 (mod 3) n 0 (mod 3)Division by 9: analogously! e.g.

    1234567890 mod 3 = (1 + 2 + . . .+ 9) mod 3 = 45 mod 3 = 01234567890 mod 9 = (1 + 2 + . . .+ 9) mod 9 = 45 mod 9 = 0

    The common tests for divisibility by 2,4 or 5 are deduced correspond-ingly.

  • Solutions to Problems 180

    Problem 38(b)

    Remainders when dividing powers of 10 by 11:

    10o 1 (mod 11)101 10 (mod 11)

    }{

    102i 1 (mod 11)102i+1 10 (mod 11) 1 (mod 11)

    Arithmetic modulo 11 gives

    z2i102i z2i (mod 11) and z2i+1102i+1 z2i+1 (mod 11)

    Together with transititvity we get a test for the divisibility by 11:

    11 |i=o

    (1)izi 11 |i=0

    zi10i

    and e.g.

    1234567890 mod 11 = (1+23+45+67+89+0) mod 11 =5 mod 11 = 6

  • Solutions to Problems 181

    Problem 38(c)

    Some examples may illustrate the procedure:

    Check digit of ISBNumber 1-86197-222 is 1-86197-222-9 because

    11+28+36+41+59+67+72+82+92=174 mod 11=9 mod 11Check digit of ISBNumber 3-933146-67 is 3-933146-67-4 because

    13+29+33+43+51+64+76+86+97=48 mod 11=4 mod 11Check digit of ISBNumber 3-933146-43 is 3-933146-43-7 because

    13+29+33+43+51+64+76+84+93=51 mod 11=7 mod 11Check digit of ISBNumber 0-550-10206 is 0-550-10206-X because

    10+25+35+40+51+60+72+80+96=32 mod 11=10 mod 11

  • Solutions to Problems 182

    Problem 38(d) Remainders when dividing powers of 10 by 7:10o 1(mod 7)101 3(mod 7)102 2(mod 7)103 6(mod 7)104 4(mod 7)105 5(mod 7)106 1(mod 7)

    107i+0 1(mod 7) 6(mod 7)107i+1 3(mod 7) 4(mod 7)107i+2 2(mod 7) 5(mod 7)107i+3 6(mod 7) 1(mod 7)107i+4 4(mod 7) 3(mod 7)107i+5 5(mod 7) 2(mod 7)107i+6 1(mod 7) 6(mod 7)

    Arithmetic modulo 7 implies for each n =i=0 zi10

    i

    ni=0

    (z7i+0+3z7i+1+2z7i+2z7i+33z7i+42z7i+5+z7i+6

    )(mod 7)

    Together with transititvity we get a test for the divisibility by 7:

    7|i=0(z7i+0 + 3z7i+1 + 2z7i+2 z7i+3 3z7i+4 2z7i+5 + z7i+6) 7 | i=0 zi10i

    and e.g. 1234567890 mod 7 = (2 1+3 2+1 3+1 42 53 61 7+2 8+3 9+1 0) mod 7 = (2+6+3+410187+16+27) mod 7 =23 mod 7 = 2

  • Solutions to Problems 183

    Problem 38(e) Parity or Cyclic Redundancy Check, CRC are exam-ples of Error Detecting Codes, EDC or even Error Correcting Codes,ECC. Using them hardenes data against corruption and loss of datawhen transmitting (LAN, wLAN, satellite, ...) or storing (HD, RAID,CD-ROM, DVD ...).

    e.g. Set the parity bit bo for odd or even parity such that the numberof set bits in a bit string b1 . . . bn inclusive parity bit bo is oddor even resp. By a single parity bit single, i.e. 1-bit errors aredetected.

    ni=o

    bi =

    {1 mod 2 fur odd parity0 mod 2 fur even parity

    By the way, odd parity is standard18 for synchrone, even parityfor asynchrone transmission.

    e.g. Obviously it is more demanding to correct errors than only todetect errors. Correspondingly, algorithms to correct errors likeCRC or Reed-Solomon-Codes are more complex.

    18s. z.B. www.its.bldrdoc.gov/projects/t1glossary2000/ parity check.html

  • Solutions to Problems 184

    Explanations to relevant procedures to correct errors can be founde.g. at

    Cyclic Redundancy Codes, CRC, s.ftp.informatik.uni-trier.de/pub/Users-CTVD/sack/ep/CRC.txt

    Reed19-Solomon19-Code, s. www.4i2i.com/reed solomon codes.htm,www.cs.cornell.edu/Courses/cs722/2000sp/ReedSolomon.pdf

    ...

    19Irving Reed (1923-?), Gustave Solomon (1931-1996)hotwired.lycos.com/synapse/feature/97/29/silberman2a 1.html

  • Solutions to Problems 185

    Problem 39(a)

    Let a < b (otherwise there is nothing to do).

    Let b = va+ r with r = b mod a.

    If r = 0 then gcd(a, b) = a and gcd(a, (va) mod a) = gcd(a, 0) = a.

    If r > 0 then for d = gcd(a, r) we have d | a and d | r and thereforealso d | b = va+ r.It remains to show that d is greatest divisor of a and b. Fora d N with d | a and d | b = va + r it follows d | r. Due tod = gcd(a, r) we have d | d.In total gcd(a, r) = d = gcd(a, b) is deduced.

  • Solutions to Problems 186

    Problem 39(b) Recursive version of Euclids algorithm

    gcd(a,b)

    {if (b==0) return a; else return gcd(b,a mod b);

    }The algorithm terminates because the arguments in turns are decre-mented by at least 1 in each step of the recursion.

    gcd( , ) =

    Iterative version of Euclids algorithm

    gcd(a,b)

    {while (b != 0) { tmp=b; b=a mod b; a=tmp; } return a;

    }gcd( , ) =

  • Solutions to Problems 187

    Problem 39(c)

    Proof of FLT see e.g. [25] S.54-55

    If p is prime then G = (Z/pZ) = {1, 2, . . . , p 1} is a multiplicativegroup with p 1 elements (i.e. closed under multiplication modulo pwith unit 1), hence a group of order ord(G) = p 1.Each x G generates a subgroup = {x1, x2, . . .} in G .As G can be represented as disjoint union of the coset classes g (with identical cardinality |g < x> | for all g G) we have as foreach subgroup H of a group G

    ord(x) = ord() | ord(G)For a G, i.e. relative prime to p we have v ord(a) = ord(G) andthus

    ap1 = aord(G) = avord(a) = (aord())v = 1v = 1representing Fermats little theorem.

    ap1 1 (mod p)

  • Solutions to Problems 188

    E.g. m = 11111 is not prime because 211110 10536(mod 11111)since