Answers to last issue's Brain Teasers 1. You are on your way to visit your Grandma, who lives at the end of the valley. It's her birthday, and you want to give her the cakes you've made. Between your house and her house, you have to cross 7 bridges, and as it goes in the land of make believe, there is a troll under every bridge! Each troll, quite rightly, insists that you pay a troll toll. Before you can cross their bridge, you have to give them half of the cakes you are carrying, but as they are kind trolls, they each give you back a single cake. How many cakes do you have to leave home with to make sure that you arrive at Grandma's with exactly 2 cakes? Ans: Exactly 2 cakes! Once I give you this answer, it seems obvious, because you can check back and see if this is correct. For instance, if you start out with two cakes, at the 1st bridge, you give half of your 2 cakes which is one cake to the troll, and then the troll gives you back one cake. So you are again left with 2 cakes. At the second bridge, the same happens: half of your 2 cakes is one, and the troll gives you back one cake, so you are left with 2. So also at the 3rd, 4th, 5th, 6th, and 7th bridges, so in the end, you are left with 2 cakes and that's what you bring to Grandma's house. But suppose we didn't know this answer? How can we get this? In the usual way: start by saying that you have X cakes. At the first bridge, you give X/2 cakes to the troll and he gives one back, so you have X/2+1=(x+2)/2 cakes left. At the second bridge, you give away half of this and get back one cake, so you have (X+2)/4 + 1 = (X+2+4)/4. You can see that, at successive bridges, you will have (X+2+4+8)/8 (third bridge), (X+2+4+8+16)/16 (fourth), (X+2+4+8+16+32)/32 (fifth), (X+2+4+8+16+32+64)/64 (sixth), and (X+2+4+8+16+32+64+128)/128 (seventh) cakes left. After the seventh bridge, you must have exactly two cakes left, so (X+2+4+8+16+32+64+128)/128=2; simplifying, (X+254)/128=2 or X=2. So you simply started with two cakes and also ended with two. 2. I have a machine which has four sequential cog wheels in constant mesh. The largest cog has 81 teeth and the others have 52, 36 and 20 respectively. What is the fewest number of revolutions the largest cog must make so that all of the cogs are back in their starting position? Ans: 260 revolutions. There are a number of ways of getting this solution. When the second cog goes around once, it has engaged only 52 of the 81 teeth of the bigger one. If it goes around twice, then 52*2=104, and it has gone once around the bigger cog, plus (104-81)=23, so it has overshot. So we let it go around again, and again, until the time when both exactly come back to their starting positions. Let us say that the big cog has gone around R number of times so that, after R times, both cogs have come back to its starting position. We can extend this argument to every pair of cogs. Hence the first step is to realise that the total number of teeth moved by cog 1 will be wholly divisible by each cog in turn, therefore: Revolutions of Cog 1 / Revolutions of Cog2 is an integer; Revolutions of Cog 1 / Revolutions of Cog3 is an integer; Revolutions of Cog 1 / Revolutions of Cog4 is an integer. Then 81xR/52, 81xR/36, and 81xR/20 must all be integers. An easy way to do this would be to multiply by 52 x 36 x 20 = 37,440 revolutions, which would be a correct answer, but not necessarily the smallest answer. A better way is to break each cog down into its prime factors, where Cog 1 has the largest number of teeth: Cog 1: 81 = 3 x 3 x 3 x 3 Cog 2: 52 = 2 x 2 x 13 Cog 3: 36 = 2 x 2 x 3 x 3 Cog 4: 20 = 2 x 2 x 5 So (3x3x3x3)R/(2x2x13), (3x3x3x3)R/(2x2x3x3), and (3x3x3x3)R/(2x2x5), all need to be integers. Simplifying, (3x3x3x3)R/(2x2x13), (3x3)R/(2x2), and (3x3x3x3)R/(2x2x5), all need to be integers. The least common multiple is (2x2x13x5)=260; hence we need at least R=260 to make each of these terms integers. Hence we need 260 revolutions before they all come back to the starting point.