You are currently browsing the category archive for the ‘puzzles’ category.

**Further investigation of the Mordell Equation**

This post carries on from the previous post on the Mordell Equation – so make sure you read that one first – otherwise this may not make much sense. The man pictured above (cite: Wikipedia) is Louis Mordell who studied the equations we are looking at today (and which now bear his name).

In the previous post I looked at solutions to the difference between a cube and a square giving an answer of 2. This time I’ll try to generalise to the difference between a cube and a square giving an answer of k. I’ll start with the same method as from the previous post:

In the last 2 lines we outline the 2 possibilities, either b = 1 or b = -1. First let’s see what happens when b = 1:

This will only provide an integer solution for a if we have:

Which generates the following first few values for k when we run through m = 1, 2,3..:

k = 2, 11, 26, 47

We follow the same method for b = -1 and get the following:

Which generates the following first few values for k when we run through m = 1, 2,3…:

k = 4, 13, 28, 49

These are the values of k which we will be able to generate solutions to. Following the same method as in the previous post this generates the following solutions:

Let’s illustrate one of these results graphically. If we take the solutions for k = 13, which are (17,70) and (17,-70), these points should be on the curve x cubed – y squared = 13.

This is indeed the case. This graph also demonstrates how all solutions to these curves will have symmetrical solutions (e, f) and (e, -f).

We can run a quick computer program to show that this method does not find all the solutions for the given values of k, but it does ensure solutions will be found for the k values in these lists.

In the code solutions above, results are listed k, x, y, x cubed, y squared. We can see for example that in the case of k = 11 our method did not find the solution x = 3 and y = 4 (though we found x = 15 and y = 58). So, using this method we now have a way of finding *some* solutions for *some* values of k – we’ve not cracked the general case, but we have at least made a start!

**The Mordell Equation [Fermat’s proof]**

Let’s have a look at a special case of the Mordell Equation, which looks at the difference between an integer cube and an integer square. In this case we want to find all the integers x,y such that the difference between the cube and the square gives 2. These sorts of problems are called Diophantine problems and have been studied by mathematicians for around 2000 years. We want to find integer solution to:

First we can rearrange and factorise, using the property of imaginary numbers.

Next we define alpha and beta such that:

For completeness we can say that alpha and beta are part of an algebraic number field:

Next we use an extension of the Coprime Power Trick, which ensures that the following 2 equations have solutions (if our original equation also has a solution). Therefore we define:

We can then substitute our definition for alpha into the first equation directly above and expand:

Next we equate real and imaginary coefficients to give:

This last equation therefore requires that either one of the following equations must be true:

If we take the case when b = 1 we get:

If we take the case when b = -1 we get

Therefore our solution set is (a,b): (1,1), (1,-1), (-1,1), (-1,-1. We substitute these possible answers into our definition for y to give the following:

We can then substitute these 2 values for y into the definition for x to get:

These therefore are the only solutions to our original equation. We can check they both work:

We can see this result illustrated graphically by plotting the graph:

and then seeing that we have our integer solutions (3,5) and (3,-5) as coordinate on this curve.

This curve also clearly illustrates why we have a symmetrical set of solutions, as our graph is symmetrical about the x axis.

This particular proof was first derived by Fermat (of Fermat’s Last Theorem fame) in the 1600s and is an elegant example of a proof in number theory. You can read more about the Mordell Equation in this paper (the proof above is based on that given in the paper, but there is a small mistake in factorization so that y = 7 and y = -7 is erroneously obtained)

**Hollow Cubes investigation**

Hollow cubes like the picture above [reference] are an extension of the hollow squares investigation done previously. This time we can imagine a 3 dimensional stack of soldiers, and so try to work out which numbers of soldiers can be arranged into hollow cubes.

Therefore what we need to find is what numbers can be formed from a^{3}-b^{3}

**Python code**

We can write some Python3 code to find this out (this can be run here):

for k in range(1,200):

```
``` for a in range(0, 100):

for b in range(0,100):

if a**3-b**3 == k :

print(k,a,b)

This gives the following: (the first number is the number of soldiers and the 2 subsequent numbers are the 2 cubes).

1 1 0

7 2 1

8 2 0

19 3 2

26 3 1

27 3 0

37 4 3

56 4 2

61 5 4

63 4 1

64 4 0

91 6 5

98 5 3

117 5 2

124 5 1

125 5 0

127 7 6

152 6 4

169 8 7

189 6 3

We could perhaps investigate any patterns in these numbers, or explore how we can predict when a hollow cube has more than one solution. I’ll investigate which numbers can be written as both a hollow square and also a hollow cube.

**Hollow squares and hollow cubes**

```
```list1=[]

for a in range(2, 50):

for b in range(2,50):

if a**2-b**2 !=0:

if a**2-b**2 > 0:

list1.append(a**2-b**2)

list2=[]

for j in list1:

for c in range(2,50):

for d in range(2,50):

if c**3-d**3 == j:

list2.append(c**3-d**3)

print(list2)

This returns the following numbers which can all be written as both hollow squares and hollow cubes.

[56, 91, 19, 117, 189, 56, 208, 189, 217, 37, 279, 152, 117, 448, 513, 504, 448, 504, 387, 665, 504, 208, 875, 819, 936, 817, 61, 999, 988, 448, 728, 513, 189, 1216, 936, 784, 335, 469, 1323, 819, 1512, 1352, 1197, 992, 296, 152, 1519, 1512, 1197, 657, 1664, 1323, 1647, 1736, 1701, 1664, 936, 504, 2107, 1387, 1216, 1027, 91, 2015, 279, 2232]

**Hollow squares, cubes and hypercubes**

Taking this further, can we find any number which can be written as a hollow square, hollow cube and hollow hypercube (4 dimensional cube)? This would require our soldiers to be able to be stretch out into a 4th dimensional space – but let’s see if it’s theoretically possible.

Here’s the extra code to type:

```
```list1=[]

for a in range(2, 200):

for b in range(2,200):

if a**2-b**2 !=0:

if a**2-b**2 > 0:

list1.append(a**2-b**2)

list2=[]

for j in list1:

for c in range(2,200):

for d in range(2,200):

if c**3-d**3 == j:

list2.append(c**3-d**3)

print(list2)

for k in list2:

for e in range(2,200):

for f in range(2,200):

if k == e**4-f**4:

print(k)

Very pleasingly this does indeed find some solutions:

9919: Which can be formed as either 100^{2}-9^{2} or 22^{3}-9^{3} or 10^{4}-3^{4}.

14625: Which can be formed as either 121^{2}-4^{2} or 25^{3}-10^{3} or 11^{4}-2^{4}.

Given that these took some time to find, I think it’ll require a lot of computer power (or a better designed code) to find any number which is a hollow square, hollow cube, hollow hypercube *and* hollow 5-dimensional cube, but I would expect that there is a number out there that satisfies all criteria. Maybe you can find it?

**Waging war with maths: Hollow squares**

The picture above [US National Archives, Wikipedia] shows an example of the hollow square infantry formation which was used in wars over several hundred years. The idea was to have an outer square of men, with an inner empty square. This then allowed the men in the formation to be tightly packed, facing the enemy in all 4 directions, whilst the hollow centre allowed the men flexibility to rotate (and also was a place to hold supplies). It was one of the infantry formations of choice against charging cavalry.

So, the question is, what groupings of men can be arranged into a hollow square? This is a current Nrich investigation, so I thought I’d do a mini-investigation on this.

We can rethink this question as asking which numbers can be written as the difference between 2 squares. For example in the following diagram (from the Nrich task Hollow Squares)

We can see that the hollow square formation contains a larger square of 20 by 20 and a smaller hollow square of 8 by 8. Therefore the number of men in this formation is:

20^{2}-8^{2} = 336.

The first question we might ask therefore is how many numbers from 1-100 can be written as the difference between 2 squares? These will all be potential formations for our army.

I wrote a quick code on Python to find all these combinations. I included 0 as a square number (though this no longer creates a hollow square, rather just a square!). You can copy this and run it in a Python editor like Repl.it.

for k in range(1,50):

```
```

` for a in range(0, 100):`

for b in range(0,100):

if a**2-b**2 == k :

print(k,a,b)

This returned the following results:

1 1 0

3 2 1

4 2 0

5 3 2

7 4 3

8 3 1

9 3 0

9 5 4

11 6 5

12 4 2

13 7 6

15 4 1

15 8 7

16 4 0

16 5 3

17 9 8

19 10 9

20 6 4

21 5 2

21 11 10

23 12 11

24 5 1

24 7 5

25 5 0

25 13 12

27 6 3

27 14 13

28 8 6

29 15 14

31 16 15

32 6 2

32 9 7

33 7 4

33 17 16

35 6 1

35 18 17

36 6 0

36 10 8

37 19 18

39 8 5

39 20 19

40 7 3

40 11 9

41 21 20

43 22 21

44 12 10

45 7 2

45 9 6

45 23 22

47 24 23

48 7 1

48 8 4

48 13 11

49 7 0

49 25 24

Therefore we can see that the numbers with no solutions found are:

2,6,10,14,18,22,26,30,34,38,42,46,50

which are all clearly in the sequence 4n-2.

Thinking about this, we can see that this can be written as 2(2n-1) which is the product of an even number and an odd number. This means that all numbers in this sequence will require an odd factor in each of their factor pairs:

eg. 50 can be written as 10 (even) x 5 (odd) or 2 (even) x 25 (odd) etc.

But with a^{2}-b^{2} = (a+b)(a-b), due to symmetries we will always end up with (a+b) and (a-b) being both even or both odd, so we can’t create a number with a factor pair of one odd and one even number. Therefore numbers in the sequence 4n-2 can’t be formed as the difference of 2 squares. There are some nicer (more formal) proofs of this here.

**A battalion with 960 soldiers**

Next we are asked to find how many different ways of arranging 960 soldiers in a hollow square. So let’s modify the code first:

for a in range(0, 1000):

for b in range(0,1000):

if a**2-b**2 == 960 :

print(a,b)

Which gives us the following solutions:

31 1

32 8

34 14

38 22

46 34

53 43

64 56

83 77

122 118

241 239

**General patterns**

We can notice that when the number of soldiers is 1,3,5,7,9,11 (2n-1) we can always find a solution with the pair n and n-1. For example, 21 can be written as 2n-1 with n = 11. Therefore we have 10 and 11 as our pair of squares. This works because 11^{2}-10^{2} = (11+10)(11-10) returns the factor pair 21 and 1. In general it always returns the factor pair, 2n-1 and 1.

We can also notice that when the number of soldiers is 4,8,12,16,20 (4n) we can always find a solution with the pair n+1 and n-1. For example, 20 can be written as 4n with n = 5. Therefore we have 6 and 4 as our pair of squares. This works because 6^{2}-4^{2} = (6+4)(6-4) returns the factor pair 10 and 2. In general it always returns the factor pair, 2n and 2.

And we have already shown that numbers 2,6,10,14,18,22 (4n-2) will have no solution. These 3 sequences account for all the natural numbers (as 2n-1 incorporates the 2 sequences 4n-3 and 4n-1).

So, we have found a method of always finding a hollow square formation (if one exists) as well as being able to use some computer code to find other possible solutions. There are lots of other avenues to explore here – could you find a method for finding all possible combinations for a given number of men? What happens when the hollow squares become rectangles?

**Normal Numbers – and random number generators**

Numberphile have a nice new video where Matt Parker discusses all different types of numbers – including “normal numbers”. Normal numbers are defined as irrational numbers for which the probability of choosing any given 1 digit number is the same, the probability of choosing any given 2 digit number is the same etc. For example in the normal number 0.12345678910111213141516… , if I choose any digit in the entire number at random P(1) = P(2) = P(3) = … P(9) = 1/10. Equally if I choose any 2 digit number at random I have P(10) = P(11) = P(12) = P(99) = 1/100.

It is incredibly hard to find normal numbers, but there is a formula to find some of them.

In base 10, we are restricted to choosing a value of c such that 10 and c are relatively prime (i.e share no common factors apart from 1). So if we choose c = 3 this gives:

We can now put this into Wolfram Alpha and see what number this gives us:

So we can put the first few digits into an online calculator to find the distributions

*0.000333333444444444444448148148148148148148148148148148148148148149382716049382716049382716049382716049382716049382716049382716049382716049382716049382716049382716049382716049382716049382716049827160493827160493827160479423863312 7572016460905349794238683127572016460905349794238683127572016460 9053497942386831275720164609053497942386831275720164609053497942*

4: 61

1: 41

8: 40

3: 38

0: 36

2: 33

7: 33

9: 33

6: 32

5: 10

We can see that we are already seeing a reasonably similar distribution of single digits, though with 4 and 5 outliers. As the number progressed we would expect these distributions to even up (otherwise it would not be a normal number).

One of the potential uses of normal numbers is in random number generators – if you can use a normal number and specify a digit (or number of digits) at random then this should give an equal chance of returning each number.

To finish off this, let’s prove that the infinite series:

does indeed converge to a number (if it diverged then it could not be used to represent a real number). To do that we can use the ratio test (only worry about this bit if you have already studied the Calculus Option for HL!):

We can see that in the last limit 3 to the power n+1 will grow faster than 3 to the power n, therefore as n increases the limit will approach 0. Therefore by the ratio test the series converges to a real number.

**Is pi normal?**

Interestingly we don’t know if numbers like e, pi and ln(2) are normal or not. We can analyse large numbers of digits of pi – and it looks like it will be normal, but as yet there is no proof. Here are the distribution of the first 100,000 digits of pi:

1: 10137

6: 10028

3: 10026

5: 10026

7: 10025

0: 9999

8: 9978

4: 9971

2: 9908

9: 9902

Which we can see are all very close to the expected value of 10,000 (+/- around 1%).

So, next I copied the first 1 million digits of pi into a character frequency counter which gives the following:

5: 100359

3: 100230

4: 100230

9: 100106

2: 100026

8: 99985

0: 99959

7: 99800

1: 99758

6: 99548

This is even closer to the expected values of 100,000 with most with +/- 0.25 %.

Proving that pi is normal would be an important result in number theory – perhaps you could be the one to do it!

**IB Revision**

If you’re already thinking about your coursework then it’s probably also time to start planning some revision, either for the end of Year 12 school exams or Year 13 final exams. There’s a really great website that I would strongly recommend students use – you choose your subject (HL/SL/Studies if your exam is in 2020 or Applications/Analysis if your exam is in 2021), and then have the following resources:

The Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and each area then has a number of graded questions. What I like about this is that you are given a difficulty rating, as well as a mark scheme and also a worked video tutorial. Really useful!

The Practice Exams section takes you to ready made exams on each topic – again with worked solutions. This also has some harder exams for those students aiming for 6s and 7s and the Past IB Exams section takes you to full video worked solutions to every question on every past paper – and you can also get a prediction exam for the upcoming year.

I would really recommend everyone making use of this – there is a mixture of a lot of free content as well as premium content so have a look and see what you think.

**Volume optimization of a cuboid**

This is an extension of the Nrich task which is currently live – where students have to find the maximum volume of a cuboid formed by cutting squares of size x from each corner of a 20 x 20 piece of paper. I’m going to use an n x 10 rectangle and see what the optimum x value is when n tends to infinity.

First we can find the volume of the cuboid:

Next we want to find when the volume is a maximum, so differentiate and set this equal to 0.

Next we use the quadratic formula to find the roots of the quadratic, and then see what happens as n tends to infinity (i.e we want to see what the optimum x values are for our cuboid when n approaches infinity). We only take the negative solution of the + – quadratic solutions because this will be the only one that fits the initial problem.

Next we try and simplify the square root by taking out a factor of 16, and then we complete the square for the term inside the square root (this will be useful next!)

Next we make a u substitution. Note that this means that as n approaches infinity, u approaches 0.

Substituting this into the expression gives us:

We then manipulate the surd further to get it in the following form:

Now, the reason for all that manipulation becomes apparent – we can use the binomial expansion for the square root of 1 + u^{2} to get the following:

Therefore we have shown that as the value of n approaches infinity, the value of x that gives the optimum volume approaches 2.5cm.

So, even though we start with a pretty simple optimization task, it quickly develops into some quite complicated mathematics. We could obviously have plotted the term in n to see what its behavior was as n approaches infinity, but it’s nicer to prove it. So, let’s check our result graphically.

As we can see from the graph, with n plotted on the x axis and x plotted on the y axis we approach x = 2.5 as n approaches infinity – as required.

**An m by n rectangle.**

So, we can then extend this by considering an n by m rectangle, where m is fixed and then n tends to infinity. As before the question is what is the value of x which gives the maximum volume as n tends to infinity?

We do the same method. First we write the equation for the volume and put it into the quadratic formula.

Next we complete the square, and make the u substitution:

Next we simplify the surd, and then use the expansion for the square root of 1 + u^{2}

This then gives the following answer:

So, we can see that for an n by m rectangle, as m is fixed and n tends to infinity, the value of x which gives the optimum volume tends to m/4. For example when we had a 10 by n rectangle (i.e m = 10) we had x = 2.5. When we have a 20 by n rectangle we would have x = 5 etc.

And we’ve finished! See what other things you can explore with this problem.

**IB Revision**

If you’re already thinking about your coursework then it’s probably also time to start planning some revision, either for the end of Year 12 school exams or Year 13 final exams. There’s a really great website that I would strongly recommend students use – you choose your subject (HL/SL/Studies if your exam is in 2020 or Applications/Analysis if your exam is in 2021), and then have the following resources:

The Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and each area then has a number of graded questions. What I like about this is that you are given a difficulty rating, as well as a mark scheme and also a worked video tutorial. Really useful!

The Practice Exams section takes you to ready made exams on each topic – again with worked solutions. This also has some harder exams for those students aiming for 6s and 7s and the Past IB Exams section takes you to full video worked solutions to every question on every past paper – and you can also get a prediction exam for the upcoming year.

I would really recommend everyone making use of this – there is a mixture of a lot of free content as well as premium content so have a look and see what you think.

**Narcissistic Numbers**

Narcissistic Numbers are defined as follows:

An n digit number is narcissistic if the sum of its digits to the nth power equal the original number.

For example with 2 digits, say I choose the number 36:

3^{2} + 6^{2} = 45. Therefore 36 is not a narcissistic number, as my answer is not 36.

For example with 3 digits, say I choose the number 124:

1^{3} + 2^{3} + 4^{3} = 73. Therefore 124 is not a narcissistic number as my answer is not 124.

The question is how to find all the narcissistic numbers less than 1000, without checking 1000 different numbers? Let’s start with 1 digit numbers.

**1 digit numbers**

0^{1} = 0

1^{1} = 1

2^{1} = 2 etc.

Therefore all numbers from 0-9 are narcissistic.

**2 digit numbers**

For 2 digit numbers in the form ab we need the following:

a^{2} + b^{2} = 10a + b.

Therefore

a^{2} – 10a + b^{2} – b = 0.

Next if we choose a = 1,2,3,4,5 we get the following simultaneous equations:

b^{2} – b -16 = 0

b^{2} – b -21 = 0

b^{2} – b -24 = 0

b^{2} – b -25 = 0

None of these factorise for integer solutions, therefore there are no 2 digit solutions from 11 to 59. Trying a = 6,7,8,9 we find that we get the same as the first four equations. This is because a and 10-a give equivalent solutions. In other words, when a = 1 we get the equation b^{2} – b -9 = 0 and when a = 9 we also get the equation b^{2} – b -9 = 0. This is because:

for:

a^{2} – 10a

if we substitute a = (10 – a) we get

(10 – a)^{2} – 10(10 – a) = a^{2} – 10a.

Therefore we prove that there are no 2 digit narcissistic numbers.

**3 digit numbers**

First we list the cube numbers:

1^{3} = 1, 2^{3} = 8, 3^{3} = 27, 4^{3} = 64, 5^{3} = 125, 6^{3} = 216, 7^{3} = 343, 8^{3} = 512, 9^{3} = 729.

and then consider 3 digit numbers of the form 1bc first. We need:

1^{3}+ b^{3} + c^{3} = 100 + 10b + c.

If our first digit is 1, then b^{3} + c^{3} need to add up to give us a number in the one hundreds, therefore:

99 ≤ ^{ }b^{3} + c^{3}≤ 198.

We can then check the cube numbers and see that the only possible combinations for a and b are 0 5, 5 0, 1 5, 5 1, 2 5, 5 2, 3 5, 5 3, 4 4, 4 5, 5 4. We can check these (only have to use the calculator for half as the reversed numbers give equivalent answers) and find that for 153 we do indeed get a narcissistic number i.e:

1^{3}+ 5^{3} + 3^{3} = 153.

Next we consider 3 digit numbers of the form 2bc first. We need:

192 ≤ ^{ }b^{3} + c^{3}≤ 292

This gives the following possibilities for b and c: 6 0, 0 6, 6 1, 16, 2 6, 6 2, 6 3, 3 6, 6 4, 4 6.

None of these give narcissistic numbers.

Next we consider 3 digit numbers of the form 3bc first. We need:

273 ≤ ^{ }b^{3} + c^{3}≤373

This gives the following possibilities for b and c: 6 4, 4 6, 6 5, 5 6, 7 1, 1 7, 7 2, 2 7, 7 3, 3 7, 7 0, 0 7.

Checking these we find 2 more narcissistic numbers:

370 = 3^{3}+ 7^{3} + 0^{3}

371= 3^{3}+ 7^{3} + 1^{3}

Using the same method, we can find that the only possibilities for 4bc are: 5 6, 6 5, 7 1, 1 7, 7 2, 2 7, 7 3, 3 7, 7 4, 4 7, 7 0, 0 7. Checking these gives us 1 more narcissistic number:

407= 4^{3}+ 0^{3} + 7^{3}

We can carry on with this method checking up to the form 9ab (it gets easier as there are less combinations possible, but will find no more narcissistic numbers. Therefore we have all the narcissistic numbers less than 1000:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 153, 370, 371, 407.

**Is there a limit to how many narcissistic numbers there are?**

Surprisingly there is a limit – there are exactly 88 narcissistic numbers in base 10. To see why we can consider the following:

In 3 digits the biggest number we can choose is 999. That would give 9^{3}+ 9^{3} + 9^{3} (or 3(9)^{3}). This needs to give a number in the hundreds (10^{2}) otherwise it would be impossible to achieve a narcissistic number. Therefore with an n digit number the largest number we can make is n(9)^{n} and if we can’t make a number in the 10^{n-1}, then a narcissistic number is not possible. If we can prove that the inequality:

n(9)^{n} < 10^{n-1}

is true for some values of n, then there will be an upper bound to the narcissistic numbers we can make. We could simply plot this directly, but let’s see if we can convince ourselves it’s true for some n without using graphical software first. Let’s see if we can find an equality:

n(9)^{n} = 10^{n-1}

First we take log base 10 of both sides

log n(9)^{n} = n-1

log(n) + nlog(9) = n-1

n(log9 -1) + logn +1 = 0

Next we make the substitution logn = u and therefore 10^{u} = n. This gives:

10^{u}(log9 -1) + u + 1 = 0.

Now we can clearly see that 10^{u} will grow much larger than u + 1, so any root must be for u is small. Let’s see, when u = 1 we get a positive number (as log9 -1 is a negative number close to 0), but when u = 2 we get a negative number. Therefore we have a root between u = 1 and u = 2. Given that we made the substitution logn = u, that means we have found the inequality n(9)^{n} < 10^{n-1} will hold for n somewhere between 10^{1} and 10 ^{2}.

Using Wolfram we can see that the equality is reached when u = 1.784, i.e when n = 10^{1.784} or approx 60.8. Therefore we can see that when we have more than 60 digit numbers, it is no longer possible to make narcissistic numbers.

**IB Revision**

If you’re already thinking about your coursework then it’s probably also time to start planning some revision, either for the end of Year 12 school exams or Year 13 final exams. There’s a really great website that I would strongly recommend students use – you choose your subject (HL/SL/Studies if your exam is in 2020 or Applications/Analysis if your exam is in 2021), and then have the following resources:

The Questionbank takes you to a breakdown of each main subject area (e.g. Algebra, Calculus etc) and each area then has a number of graded questions. What I like about this is that you are given a difficulty rating, as well as a mark scheme and also a worked video tutorial. Really useful!

The Practice Exams section takes you to ready made exams on each topic – again with worked solutions. This also has some harder exams for those students aiming for 6s and 7s and the Past IB Exams section takes you to full video worked solutions to every question on every past paper – and you can also get a prediction exam for the upcoming year.

I would really recommend everyone making use of this – there is a mixture of a lot of free content as well as premium content so have a look and see what you think.

This is a nice example of using some maths to solve a puzzle from the mindyourdecisions youtube channel (screencaptures from the video).

**How to Avoid The Troll: A Puzzle**

In these situations it’s best to look at the extreme case first so you get some idea of the problem. If you are feeling particularly pessimistic you could assume that the troll is always going to be there. Therefore you would head to the top of the barrier each time. This situation is represented below:

**The Pessimistic Solution:**

Another basic strategy would be the optimistic strategy. Basically head in a straight line hoping that the troll is not there. If it’s not, then the journey is only 2km. If it is then you have to make a lengthy detour. This situation is shown below:

**The Optimistic Solution:**

The expected value was worked out here by doing 0.5 x (2) + 0.5 x (2 + root 2) = 2.71.

The question is now, is there a better strategy than either of these? An obvious possibility is heading for the point halfway along where the barrier might be. This would make a triangle of base 1 and height 1/2. This has a hypotenuse of root (5/4). In the best case scenario we would then have a total distance of 2 x root (5/4). In the worst case scenario we would have a total distance of root(5/4) + 1/2 + root 2. We find the expected value by multiply both by 0.5 and adding. This gives 2.63 (2 dp). But can we do any better? Yes – by using some algebra and then optimising to find a minimum.

**The Optimisation Solution:**

To minimise this function, we need to differentiate and find when the gradient is equal to zero, or draw a graph and look for the minimum. Now, hopefully you can remember how to differentiate polynomials, so here I’ve used Wolfram Alpha to solve it for us. Wolfram Alpha is incredibly powerful -and also very easy to use. Here is what I entered:

and here is the output:

So, when we head for a point exactly 1/(2 root 2) up the potential barrier, we minimise the distance travelled to around 2.62 miles.

So, there we go, we have saved 0.21 miles from our most pessimistic model, and 0.01 miles from our best guess model of heading for the midpoint. Not a huge difference – but nevertheless we’ll save ourselves a few seconds!

This is a good example of how an exploration could progress – once you get to the end you could then look at changing the question slightly, perhaps the troll is only 1/3 of the distance across? Maybe the troll appears only 1/3 of the time? Could you even generalise the results for when the troll is y distance away or appears z percent of the time?

**IB Revision**

**Zeno’s Paradox – Achilles and the Tortoise**

This is a very famous paradox from the Greek philosopher Zeno – who argued that a runner (Achilles) who constantly halved the distance between himself and a tortoise would never actually catch the tortoise. The video above explains the concept.

There are two slightly different versions to this paradox. The first version has the tortoise as stationary, and Achilles as constantly halving the distance, but never reaching the tortoise (technically this is called the dichotomy paradox). The second version is where Achilles always manages to run to the point where the tortoise was previously, but by the time he reaches that point the tortoise has moved a little bit further away.

**Dichotomy Paradox**

The first version we can think of as follows:

Say the tortoise is 2 metres away from Achilles. Initially Achilles halves this distance by travelling 1 metre. He halves this distance again by travelling a further 1/2 metre. Halving again he is now 1/4 metres away. This process is infinite, and so Zeno argued that in a finite length of time you would never actually reach the tortoise. Mathematically we can express this idea as an infinite summation of the distances travelled each time:

1 + 1/2 + 1/4 + 1/8 …

Now, this is actually a geometric series – which has first term a = 1 and common ratio r = 1/2. Therefore we can use the infinite summation formula for a geometric series (which was derived about 2000 years after Zeno!):

sum = a/(1-r)

sum = 1/(1-0.5)

sum = 2

This shows that the summation does in fact converge – and so Achilles would actually reach the tortoise that remained 2 metres away. There is still however something of a sleight of hand being employed here however – given an *infinite* length of time we have shown that Achilles would reach the tortoise, but what about reaching the tortoise in a *finite* length of time? Well, as the distances get ever smaller, the time required to traverse them also gets ever closer to zero, so we can say that as the distance converges to 2 metres, the time taken will also converge to a finite number.

There is an alternative method to showing that this is a convergent series:

S = 1+ 1/2 + 1/4 + 1/8 + 1/16 + …

0.5S = 1/2+ 1/4 + 1/8 + 1/16 + …

S – 0.5S = 1

0.5S = 1

S = 2

Here we notice that in doing S – 0.5S all the terms will cancel out except the first one.

**Achilles and the Tortoise**

The second version also makes use of geometric series. If we say that the tortoise has been given a 10 m head start, and that whilst the tortoise runs at 1 m/s, Achilles runs at 10 m/s, we can try to calculate when Achilles would catch the tortoise. So in the first instance, Achilles runs to where the tortoise was (10 metres away). But because the tortoise runs at 1/10th the speed of Achilles, he is now a further 1m away. So, in the second instance, Achilles now runs to where the tortoise now is (a further 1 metre). But the tortoise has now moved 0.1 metres further away. And so on to infinity.

This is represented by a geometric series:

10 + 1 + 0.1 + 0.01 …

Which has first time a = 10 and common ratio r = 0.1. So using the same formula as before:

sum = a/(1-r)

sum = 10/(1-0.1)

sum = 11.11m

So, again we can show that because this geometric series converges to a finite value (11.11), then after a finite time Achilles will indeed catch the tortoise (11.11m away from where Achilles started from).

We often think of mathematics and philosophy as completely distinct subjects – one based on empirical measurement, the other on thought processes – but back in the day of the Greeks there was no such distinction. The resolution of Zeno’s paradox by use of calculus and limits to infinity some 2000 years after it was first posed is a nice reminder of the power of mathematics in solving problems across a wide range of disciplines.

**The Chess Board Problem**

The chess board problem is nothing to do with Zeno (it was first recorded about 1000 years ago) but is nevertheless another interesting example of the power of geometric series. It is explained in the video above. If I put 1 grain of rice on the first square of a chess board, 2 grains of rice on the second square, 4 grains on the third square, how much rice in total will be on the chess board by the time I finish the 64th square?

The mathematical series will be:

1+ 2 + 4 + 8 + 16 +……

So a = 1 and r = 2

Sum = a(1-r^{64})/(1-r)

Sum = (1-2^{64})/(1-2)

Sum = 2^{64 }-1

Sum = 18, 446,744, 073, 709, 551, 615

This is such a large number that, if stretched from end to end the rice would reach all the way to the star Alpha Centura and back 2 times.

**IB Revision**

**A geometric proof for the Arithmetic and Geometric Mean**

There is more than one way to define the mean of a number. The arithmetic mean is the mean we learn at secondary school – for 2 numbers a and b it is:

(a + b) /2.

The geometric mean on the other hand is defined as:

(x_{1}.x_{2}.x_{3}…x_{n})^{1/n}

So for example with the numbers 1,2,3 the geometric mean is (1 x 2 x 3)^{1/3}.

With 2 numbers, a and b, the geometric mean is (ab)^{1/2}.

We can then use the above diagram to prove that (a + b) /2 ≥ (ab)^{1/2} for all a and b. Indeed this inequality holds more generally and it can be proved that the Arithmetic mean ≥ Geometric mean.

Step (1) We draw a triangle as above, with the line MQ a diameter, and therefore angle MNQ a right angle (from the circle theorems). Let MP be the length a, and let PQ be the length b.

Step (2) We can find the length of the green line OR, because this is the radius of the circle. Given that the length a+b was the diameter, then (a+b) /2 is the radius.

Step (3) We then attempt to find an equation for the length of the purple line PN.

We find MN using Pythagoras: (MN)^{2} = a^{2} +x^{2}

We find NQ using Pythagoras: (NQ)^{2} = b^{2} +x^{2}

Therefore the length MQ can also be found by Pythagoras:

(MQ)^{2} = (MN)^{2 } + (NQ)^{2}

(MQ)^{2 } = a^{2} +x^{2} + b^{2} +x^{2}

But MQ = a + b. Therefore:

(a + b)^{2 } = a^{2} +x^{2} + b^{2} +x^{2}

a^{2}+ b^{2} + 2ab = a^{2} +x^{2} + b^{2} +x^{2}

2ab = x^{2} +x^{2}

ab = x^{2}

x = (ab)^{1/2}

Therefore our green line represents the arithmetic mean of 2 numbers (a+b) /2 and our purple line represents the geometric mean of 2 numbers (ab)^{1/2}. The green line will always be greater than the purple line (except when a = b which gives equality) therefore we have a geometrical proof of our inequality.

There is a more rigorous proof of the general case using induction you may wish to explore as well.