Solution of the Week #498 - Three Week Odyssey

Say I walked x miles on the first day. In the first week I will have walked 7x+21 miles. In the second week, 7x+70 miles. In the third week, 7x+119 miles.

These distances need to form a right angles triangle, so we can use Pythagoras Theorem:

(7x+21)^2 + (7x+70)^2 = (7x+119)^2

49x^2+294x+441 + 49x^2+980x+4900 = 49x^2+1666x+14161

49x^2-392x-8820=0

x^2-8x-180=0

(x+10)(x-18)=0

So the distance travelled on the first day was either -10 miles or 18 miles. Since the distance needs to be positive the answer is 18 miles. In total I walked 147+196+245 = 588 miles.

A shortcut to the solution would be to note that the difference between week 2 and week 1 is the same as the difference between week 3 and week 2: 49. So we are looking for a scaled up version of a primitive Pythagorean triple in arithmetic progression. Since 3,4,5 is the only such triangle we need only scale this up by a factor of 49 to find our distances.

Solution of the Week #496 - Four Towns

Since Gunton is due north of Kipton and Lawton is due east, Gunton-Kipton-Lawton form a right angle. Since we don’t know the speed we can’t yet directly equate the given times and the given distances. Let’s say we are travelling at ‘s’ miles per minute. We can create the following diagram:

We can use the law of cosines to give an expression for cos(a) and cos(90-a) in terms of s:

 Cos(a) = (15^2+(78s)^2–(102s-15)^2)/(2*15*78s)

Cos(a) = (17-24s)/13

Cos(90-a) = (16^2+(78s)^2–(82s-16)^2)/(2*16*78s)

Cos(90-a) = (41-10s)/39

 But, cos(90-a) is also expressible as sin(a), and (sin(a))^2+(cos(a))^2=1

 (51-72s)^2+(41-10s)^2 = 39^2

5284s^2-8164s+2761=0

 s can be 1/2 or 2761/2642

 If we use this second figure and plot the resulting distances, Torton would be way to the north-west, not generally north-east as stated, so the speed is 1/2 mile/minute or 30mph. The distance between Kipton and Torton is therefore 39 miles.

 

Solution of the Week #495 - Smallest Triangle

If we call the base b, and the other sides a and c, such that a>c (a can’t be equal to c as the mirror line would be parallel with the base). We want a and c to be as close as possible, so that the angle of the mirror line is as shallow as possible. Since they are integers the smallest difference is 1, so let’s say a-1=c. With that being the case the length that we want to be 45 will be bc (in general it would be bc/(a-c)). To minimise the perimeter we want b to be roughly double c. If we had said we wanted the dashed line to be 50 instead of 45, we could achieve that exactly with b=10, c=5 and a=6.

Here the closest is b=9, c=5, a=6, with a perimeter of 20, and area of 10*sqrt(2).

Solution of the Week #494 - Five Dice

The fact that none of the rearrangements are even means that each individual roll is odd.

The fact that we are told that b>d and we are expected to figure out the entire sequence must mean that there are four rolls of one number and one roll of a second number.

The gives few enough possibilities for trial and error. We need to try each of five rearrangements of 13333, 15555, 31111, 35555, 51111, 53333 for divisibility by 7.

The only one that is never divisible by 7 is 35555, therefore the sequence of dice rolls was 55535.

 

For completeness, the sequences that are never divisible by 7 are:

11111 and its multiples 22222 33333 44444 55555 66666

11112 and its multiples 22224 33336

The result of subtracting those three from 77777: 66665 55553 44441

Every other sequence of dice rolls can be arranged to be a multiple of 7.

Solution of the Week #493 - Grid Fill 3

As we are told that there are 5 black squares that limits the possible arrangements. Since each of the four edges of the grid must contain an even number of black squares, they must appear in an odd number of corners. That leaves just seven distinct arrangements of black squares: four with one black corner and three with three black corners. One of the seven arrangements of black squares leads to a symmetrical solution. Five more arrangements don’t lead to any solutions.

Here is the asymmetrical solution:

And if you’re interested, here are the other 18 solutions I found:

Solution of the Week #491 - Grid Fill

These are (I believe) the only distinct solutions for a 7x7 grid.

In general, a solution can always be found that involves one large rectangle or square which contacts all four sides of the grid. Neither of the edges of this rectangle can be a multiple of 3, hence why for the first solution, the main rectangle is 2x5, as 2 and 5 are the only pair of numbers adding to 7 that don’t involve a multiple of 3.

Solution of the Week #490 - Inheritance

Let’s start with the brothers having equal amounts, work backwards to the will, and forwards again to the alternative situation.

Let’s say they ended with £x each. The final round is Adam’s, so immediately prior to that they would have:

A 2x

B x/2

C x/2

Then Barnaby’s share is doubled and the other two decrease by the 1/2 of what Barnaby had:

A 7x/4

B x

C x/4

Then Charles:

A 13x/8

B 7x/8

C x/2

 

To check we haven’t gone wrong, at each stage the amount should add up to 3x, since we are only moving money between the brothers.

 

Next we need to move forward from this point with the alternative order.

 

First Adam splits his share such that his share is halved and 1/4 of what Adam had is added to each of the others:

A 13x/16

B 41x/32

C 29x/32

Then Barnaby splits his share:

A 145x/128

B 41x/64

C 157x/128

And finally Charles:

A 737x/512

B 485x/512

C 157x/256

 

We are told that in this scenario Adam ends up with £19881 more than Charles, so:

737x/512 – 157x/256 = 19881

x(737-314) = 19881*512

x = 24064

 

Then going back to the will scenario (13x/8 etc) we can say that the will granted the following amounts:

Adam: £39,104

Barnaby: £21,056

Charles: £12,032

 

Solution of the Week #488 - Tournament

Firstly the fact that the matches are drawn between rounds as opposed to the entire draw being set at the start of the tournament is immaterial. To reach the final, team 5 needs to be the highest ranked team on their side of the draw.

So the chance that the other seven teams in the same side of the draw are ranked lower than fifth is:

11/15*10/14*9/13*8/12*7/11*6/10*5/9

This cancels down neatly to 2/39, which is just over 5%.

Alternatively, you could ensure that the best four teams are all in the other side of the draw to team 5:

8/15*7/14*6/13*5/12

Which again cancels down to 2/39.

Solution of the Week #487 - How Many Ways

Obviously the final digit needs to be a 5. For the first two digits to be divisible by 3, they simply need to sum to a multiple of 3. Without the 5 there are three ways (1,2; 2,4; 3,6) and their reversals.

For the third and fourth digits to make a number divisible by 4, either the fourth digit is a multiple of 4 and the third digit is even, or the fourth digit is an even number not divisible by 4 and the third digit is odd. The fifth digit is whatever is left. Since at least one of the remaining three numbers will be odd, we have the same situation as before where if one arrangement is possible, a second is also possible. (See POTW #484).

So overall we have 3 pairs for the first two digits, doubled as they can be reversed, and doubled again for the remaining three digits.

12 possibilities in all:

126435

123645

216435

213645

241635

243615

421635

423615

361245

362415

631245

632415

 

 

Solution of the Week #486 - Not a Square

I start just over 12.5 miles from the south pole, let’s say 12.54 miles.

After walking south I am 2.54 miles away from the pole.

Walking east I am still 2.54 miles from the pole, but have travelled around 225.7 degrees around it.

Heading north, directly away from the pole, I end up 12.54 miles from the pole.

Finally heading west I reverse the direction around the pole, but this time by about 45.7 degrees, ending up roughly opposite where I started, but around 25.08 miles from it.

In fact if I’d started a little more than 12.54 miles from the south pole my final position would be even further away, but would depend on the curvature of the earth, but even assuming local flatness it’s no more than about 25.23 miles.

The exact maths of ending up opposite where you started is that you would start 10+10*(sqrt(pi*(4+pi))-pi)/(2*pi)=12.53863… miles away from the South Pole. The distance between start and end are then just double that.

The overall maximisation is beyond my abilities.

Solution of the Week #485 - Best Bet

You’d be forgiven for thinking 3 would be the best choice, as a third of three digit numbers are divisible by 3, however any number that isn’t a multiple of 3 can’t be rearranged to become one.

In fact of the 6^3=216 possible rolls, 72, exactly a third, are a multiple of 3.

For 5, all you would need is for at least one of the rolls to be a 5, and for you to place that at the end of the number. There are 91/216, around 42% would win for you, so a better bet than 3.

However there is only one choice of ‘n’ that gives you a better than evens chance of winning the bet, and that is 7. Of the 216 rolls, 126 are, or can be rearranged to form, a multiple of 7, giving you a win percentage of over 58%.

Listed below are all of the possible winning numbers. Any with three different digits can be rolled in six different ways, and any with a repeated digit, in three ways:

112  126  133  154  161  224  231  245  252  266  315  322

336  343  364  413  434  441  455  462  511  525  532  546

553  616  623  644  651  665

 

And below in the winning percentage for the first few odd primes (a composite number couldn’t be the best bet as will always be at least equalled by its prime factors) :

 

3      33.3%

5      42.1%

7      58.3%

11     22.2%

13     36.1%

17     23.6%

19     26.4%

23     16.7%

 

 

Solution of the Week #484 - Twin Numbers

Consider three types of digit:

A=odd = 1,3,5,7,9

B=even but not divisible by 4 = 2,6

C=divisible by 4 = 4,8

For the three digit number to be divisible by 4, it is sufficient that the number formed by the final two digits is divisible by 4. So if it ends on a C digit the middle digit has to be even (B or C), but if it ends on a B digit the middle digit must be odd (A).

So we must end with AB, BC or CC.

The possible arrangements with at least one odd digit are therefore:

AAB

BAB

CAB

ABC

ACC

A number of the form of ABC can be rearranged to one of the form CAB and vice versa. For each of the other cases, simply swap the position of the two digits of the same type to find the alternative number. For example 128 pairs with 812, 132 with 312, 216 with 612, and 748 pairs with 784.

Solution of the Week #483 - Trailing Zeroes

The number of trailing zeroes is determined by how many time the number is divisible by 10, which in turn is determined by how many times the number is divisible by 2 and how many times it is divisible by 5, with the lesser of those determining how many times the number is divisible by 10.

The number we seek will be made up of 2, 3, 5 and 7, each raised to a different power. Let’s call them 2^a*3^b*5^c*7^d

For instance, to satisfy the first part, b, c and d need to be even and a needs to odd, so that when the number is multiplied by 2, all four powers will be even, and the number will be a perfect square.

From the second part, a, c and d need to be divisible by 3, and b needs to be one less than a multiple of 3.

From the third part, a, b and d need to be divisible by 5, and c needs to be one less than a multiple of 5.

From the last part, a, b and c need to be divisible by 7, and d needs to be one less than a multiple of 7.

For the trailing zeroes we are only interested in the values of a and c.

a is an odd number that is divisible by 3, 5 and 7. The smallest such number is 3*5*7=105.

c is divisible by 2, 3 and 7, and one less than a multiple of 5. 2*3*7 = 42. So c needs to be a multiple of 42. 84 is 42*2 and one less than a multiple of 5, so therefore c=84.

The lesser of 105 and 84 is 84, so therefore the number has 84 trailing zeroes.

If you’re interested the values of b and d would be 140 and 90 respectively. The result is a number with 234 digits, the last 84 of which are indeed all 0.

Solution of the Week #482 - Number Triangle 2

As an aside, the ‘couple of observations’ I referred to are: that the 15 must be on the bottom row, since it can’t be the difference between any other two numbers in the range; and that you only have to define the numbers on the bottom row, and the rest of the grid is defined, at which point you just need to check for duplicates. (This give (14!/10!)*5/2 = 60060 possibilities).

Wherever we have the top and one of the other numbers in a mini triangle, the other number could be the sum (unless it’s over 15) or the difference of the given two, unless the top number is greater, in which case it must be the sum.

Therefore you can place the 14 and the 9 straight away.

On the face of it the number completing the 7,8 triangle could be 1 or 15, however as we have observed the 15 must be on the bottom row, so it must be the 1.

‘e’ might be 13 or 15. ‘a’ could be 3 or 11.

‘c’ will either be 4 or 12, depending on what ‘a’ turns out to be, however since 4 is already taken, c must be 12 and a must be 11.

If e was 13, f would be 1, however, since we’ve already used 1, e must be 15, and f must be 3.

Finally b must be 2, d is 10 (since 14 is already taken), and g must be 13.

In case you’re interested, this 15 cell triangle is the largest than can exist with each number the difference of the two below.

Solution of the Week #479 - 100 Card Shuffle

You can split the question into two parts: that the subsequent four cards will all be greater than 34, and that those four cards will be in ascending order.

The probability that the second card is greater than 34 is 66/99, then subsequent cards have a probability of 65/98, 64/97 and 63/96.

A lot of factors cancel, leaving an overall probability of 130/679 that the other four cards will be greater than the first.

Secondly, those four cards can be in any one of 4! Orders, only 1 of which is ascending, giving a factor of 1/24.

Combining these two probabilities we get an overall probability of 65/8148, which is about 1 in 125. Interestingly, this is slightly less than the probability if we were unaware of the number of the first card, which of course is 1 in 120.