Solution of the Week #449 - Swap Grid

The reason the number grid takes 20 swaps is that it can be split into five cycles of 5 (for instance, 1,8,15,17,24 is a cycle). A cycle of n cells can be solved in n-1 swaps, so each of the cycles takes 4 swaps to solve.

In the letter grid, you want to find smaller cycles if possible. It turns out you can find four cycles of 2 letters each (where a single swap would solve both letters), three cycles of 3 letters, and two cycles of 4 letters, as coloured below. This will take 16 swaps in total.

To advance the solution, swaps should only be made within those minimum cycles (in the number grid, since 1 and 15 were in the same cycle, swapping them advanced the solution, without solving either letter in the swap, although it did change a 5-cycle into a 2-cycle and a 3-cycle).

In the letter grid, if any swaps were made within the 2-cycles or 3-cycles, letter would be solved, so we need to look only at the 4-cycles. Swapping one pair within each of the two 4-cycles as shown will turn each 4-cycle into two 2-cycles, advancing the solution without solving any letters, so the answer to the bonus question is 2.

 

Solution of the Week #445 - Functional Equation

As we’re hoping to evaluate f(4) we might try letting x = 4 initially:

2*f(-3) – f(4) = 540

But now we need to know the value of f(-3), so:

2*f(1/2) - f(-3)= -405

We plough on:

2*f(6/5) - f(1/2) = 135/2

2*f(5/3) - f(6/5) = 162

2*f(9/4) - f(5/3) = 225

And just as we start to lose hope:

2*f(4) - f(9/4) = 1215/4

 

So now we have 6 equations in 6 unknowns, let’s multiply the second equation by 2, the next by 4, the next by 8 etc:

 

2*f(-3) - f(4) = 540

4*f(1/2) - 2*f(-3) = -810

8*f(6/5) - 4*f(1/2) = 270

16*f(5/3) - 8*f(6/5) = 1296

32*f(9/4) - 16*f(5/3) = 3600

64*f(4) - 32*f(9/4) = 9720

 

Adding all of these together cancels out all of the f() terms except for f(4):

 

63*f(4) = 14616

Therefore:

f(4) = 232

 

 

 

Solution of the Week #443 - Find the Value

(2x+3)(3x+4)(4x+5)=11

You could of course multiply the backets together and solve the resulting cubic, but I’m going to use a different method:

I note that the coefficients of x are 2, 3 and 4, and the least common multiple of those is 12, so I will multiply each bracket in order that those coefficients match (and multiply the right side by the same amount to retain equality):

(12x+18)(12x+16)(12x+15)=11*6*4*3

Next I’m going to change the variable by letting u=12x+18

u(u-2)(u-3)=11*9*8

Note I also re-factorised the right-hand side to match the format, which allows me to say that u=11. Since we are only looking for one real solution, we are now on the way to finding it:

12x+18=11

12x=-7

x=-7/12

Putting that value back through the equation confirms that this is the correct value.

 

Solution of the Week #442 - Triangle on a Square

A trial and error method is a good way to approach this particular puzzle, plugging in different potential values for DE, calculating DF from the similar triangles DEF and CEB, then calculating the area and perimeter of DEF. You will soon find that DE=8, DF=6, and the area and perimeter of DEF is 24.

For a more systematic approach, I used the nice fact, easily proved, that a triangle has the same area and perimeter if and only if the radius of its incircle is equal to 2. So putting in place a coordinate system where B is the origin, I place a circle of radius 2 at (22,26). Then, because I need EFB will be tangent to this circle, I construct another circle, centred on (11,13) and passing through the origin. Using the formulae of the two triangles to work out where they coincide*, I can find the point on line EFB has position (20.4,27.2). This enables me to find the position of point E to be (24,32), and the area and perimeter of triangle DEF to be 24.

Solution of the Week #441 - Puzzle 441

Each number from 1 to 441 must pair with two other valid numbers to add to two of target sums 321, 442 or 763, as the sequence goes to a number and then away from it again. For example, 13 would pair with 308, 429 and 750 to form the target sums. 750 is outside of the range of numbers in the sequence, so therefore 308 and 429 must be either side of 13 in the sequence. This is true for every number except for the numbers at the very ends of the sequence, which can only for a valid pair adding to ONE of the target sums. These are 321, which would pair with 0, 121 and 442 to form the target sums, and only 121 is in the range 1-441. At the other end of the sequence will be 221, which pairs with 100, 221 or 542. 542 is outside of the range, and 221 is the same number again, so 100 must be adjacent to 221. So 221 and 321 are at the ends of the sequence.

It's not obvious, and I won’t go into the reasons here, but at the exact middle of the sequence will be the average of those two end numbers, 271.

 

Solution of the Week #440 - Semicircles in a Hexagon

Let’s look at a general case where the previous radius is a/b and we wish to find the next radius x.

Using the cosine rule on the triangle shown, and taking advantage of the fact that cosine of 120 degrees is -0.5, we get:

 (a/b + x)^2 = (a/b)^2 + (1-x)^2 + a/b(1-x)

 (a/b)^2 + 2ax/b + x^2 = (a/b)^2 + 1 - 2x + x^2 + a/b – ax/b

 2ax/b = 1 - 2x + a/b – ax/b

 (2 + 3a/b)x = 1 + a/b

 x = (1 + a/b)/(2 + 3a/b) = (a+b)/(3a+2b)

 so assuming a and b are integers, x will be a rational number.

 We can repeatedly use this formula starting from Ra = 1/2.

Rb = 3/7, Rc is 10/23, Rd = 33/76 and finally Re = 109/251. If you are curious, these fractions are converging on a value of

(sqrt(13)-1)/6.

 

Solution of the Week #437 - Rugby Scores part 2

To begin with, since we are only interested in the parity, we can calculate each subsequent value modulo 2, returning a 0 for an even number and a 1 for an odd number:

1,0,0,1,0,1,1,1,0, etc (let’s call this sequence b(n)).

Since each value only depends on the previous 6 values, we can return a 7 digit binary number for each value (using the fact that b of negative n is 0, to calculate the first few):

0000001, 0000010, 0000100, 0001001, 0010010, 0100101, etc

And then convert these into their decimal equivalents:

1,2,4,9,18,37,75,23,etc (let’s call this sequence c(n)).

Since whenever a particular number appears in this sequence it will be followed by the same number, and since there are only 128 possible values, from 0 to 127, using the pigeonhole principle, we know that the sequence must develop into a repeating loop, and in at most 128 steps.

We know that c(0)=1, and it doesn’t take much work on a spreadsheet or even by hand, to show that c(63)=1 also. So the sequence c(n), and therefore also the sequence b(n), repeats every 63 steps.

All that remains is to look at 63 consecutive values in b(n) and count how many are 0 and how many are 1.

31 are 1 and 32 are 0, and so the proportion of numbers in the a(n) Rugby sequence that are odd is exactly 31/63, or about 49.2%.

Solution of the Week #436 - Rugby Scores

There are a couple of ways to approach this. The most obvious way is to find all of the combinations of 3,5,7 can add to 23, then work out how many permutations there are of each. There are only 4 combinations: (7,7,3,3,3), (7,5,5,3,3), (5,5,5,5,3), (5,3,3,3,3,3,3).

The first combination has 5 numbers, split into 2 of one and 3 of another, so the number of permutations is 5!/(2!3!), which is 10. Doing the same for the other combinations, you get 30, 5 and 7 permutations respectively, so 52 ways in total.

A nice clever spreadsheet shortcut that I discovered is to let a(0)=1 and for anything else a(n)=a(n-7)+a(n-5)+a(n-3).

This recursive relationship very quickly reveals that 1,2 and 4 are impossible, that a(8)=2, that a(23)=52.

To see why this works, consider the score of 23. The scores that make it up must end with either 3, 5, or 7, and so before that final score is added, you would have a score of either 16, 18 or 20. And so the number of ways of making 23 must be the sum of the number of ways of making 16, 18 or 20.

As an interesting footnote, the smallest n for which a(n) requires a further digit follows an interesting pattern:

a(16)=10

a(26)=102

a(36)=1045

a(46)=10806

a(56)=112131

a(66)=1164641

a(76)=12098938

a(86)=125695132

But that’s where the pattern ends, as a(95) gives a ten-digit number of ways.

Solution of the Week #435 - A Satisfying Cancellation

The complicated expression turns out to have the value of precisely 3.

Call the sum of the two square roots ‘S’, and the difference ‘D’, the expression becomes S*sqrt(D/S)

Although S*D doesn’t appear anywhere in the expression, we will evaluate it in case it becomes useful later.

(sqrt(11)+sqrt(2))* (sqrt(11)-sqrt(2)) = 11+sqrt(22)–sqrt(22)-2 = 9.

If we look at the fraction under the square root, we can multiply top and bottom by D without changing its value. The top becomes D^2 and the bottom becomes 9. Then the square root (D^2/9) means that the whole square root expression can be replaced with D/3. Then the entire expression is just S*D/3, which of course is just 9/3 = 3.

Alternatively, change the left hand term S into the square root of S^2. Then you can combine the two square roots so that the overall expression is sqrt(S^2*D/S) or sqrt(S*D). As we saw above S*D is just 9, so sqrt(S*D)=3.

 

Solution of the Week #434 - Four Guesses

Your first guess is 2. Assuming you’re not correct, I had 1, 3 or 4. I must change to 2, 3 or 4.

Your second guess is 3. If your guess was incorrect, I was at either 2 or 4 and so must change to 1 or 3.

You guess 3 again. You either guessed correctly or I was at 1. I must now change to 2.

You guess 2. Checkmate!

By symmetry your guesses might have been 3,2,2,3 instead.

Solution of the Week #433 - Scores

The number denotes the alphabetical position of the first letter in alphabetical order that appears in the team name. For example Leicester City doesn’t contain a or b but does contain a c, hence their score is 3.

Therefore Everton beat Arsenal 5-1.

I’d love tickets to Luton Town versus Portsmouth!