# Blog

## Archive

Show me a Random Blog Post**2017**

### Nov 2017

Christmas (2017) is Coming!MENACE at Manchester Science Festival

### Jun 2017

Big Ben Strikes Again### Mar 2017

The End of Coins of Constant WidthDragon Curves II

### Feb 2017

The Importance of Estimation Error### Jan 2017

Is MEDUSA the New BODMAS?**2016**

**2015**

**2014**

**2013**

**2012**

## Tags

folding paper folding tube maps london underground platonic solids london rhombicuboctahedron raspberry pi weather station programming python php inline code news royal baby probability game show probability christmas flexagons frobel coins reuleaux polygons countdown football world cup sport stickers tennis braiding craft wool emf camp people maths trigonometry logic propositional calculus twitter mathslogicbot oeis matt parker pac-man graph theory video games games chalkdust magazine menace machine learning javascript martin gardner reddit national lottery rugby puzzles game of life dragon curves fractals pythagoras geometry triangles european cup dates palindromes chalkdust christmas card ternary bubble bobble asteroids final fantasy curvature binary arithmetic bodmas statistics error bars estimation accuracy misleading statistics pizza cutting captain scarlet gerry anderson light sound speed manchester science festival manchester**2017-11-28**

## Christmas (2017) is Coming!

This year, the front page of mscroggs.co.uk will once again feature an advent calendar, just like last year and the year before. Behind each door, there will be a puzzle with a three digit solution. The solution to each day's puzzle forms part of a logic puzzle:

It's nearly Christmas and something terrible has happened: Santa and his two elves have been cursed! The curse has led Santa to forget which present three children—Alex, Ben and Carol—want and where they live.

The elves can still remember everything about Alex, Ben and Carol, but the curse is causing them to lie. One of the elves will lie on even numbered days and tell the truth on odd numbered days; the other elf will lie on odd numbered days and tell the truth on even numbered days. As is common in elf culture, each elf wears the same coloured clothes every day.

Each child lives in a different place and wants a different present. (But a present may be equal to a home.) The homes and presents are each represented by a number from 1 to 9.

Santa has called on you to help him work out the details he has forgotten. Behind each day (except Christmas Day), there is a puzzle with a three-digit answer. Each of these answers forms part of a fact that one of the elves tells you. You must work out which combination of clothes each elf wears, which one lies on each day, then put all the clues together to work out which presents need delivering to Alex, Ben and Carol, and where to deliver them.

Ten randomly selected people who solve all the puzzles and submit their answers to the logic puzzle using the form behind the door on the 25th will win prizes! A selection of the prizes are shown below, and will be added to throughout December.

The ten winners will also will one of these winners' medals:

As you solve the puzzles, your answers will be stored. This year, there is a new feature allowing you to synchronise your answers between multiple computers: simply enter your email address below the calendar, and you will be emailed a magic link to visit on your other devices.

Behind the door on Christmas Day, there will be a form allowing you to submit your answers. The winner will be randomly chosen from all those who submit the correct answer on Christmas Day. Runners up will then be chosen from those who submit the correct answer on Christmas Day, then those who submit the correct answer on Boxing Day, then the next day, and so on. Each day's puzzle (and the entry form on Christmas Day) will be available from 5:00am GMT. But as the winners will be selected randomly, there's no need to get up at 5am on Christmas Day to enter!

To win a prize, you must submit your entry before the end of 2017. Only one entry will be accepted per person. If you have any questions, ask them in the comments below or on Twitter.

So once December is here, get solving! Good luck and have a very merry Christmas!

### Similar Posts

Christmas (2016) is Over | Christmas Card 2016 | Christmas (2016) is Coming! | Christmas (2015) is Over |

### Comments

Comments in green were written by me. Comments in blue were not written by me.

**2017-12-18**

Alex

**2017-12-15**

Matthew

**2017-12-15**

EliK

**2017-12-13**

Matthew

**Add a Comment**

**2016-12-28**

## Christmas (2016) is Over

More than ten correct solutions to this year's Advent calendar puzzle competition were submitted on Christmas Day, so the competition is now over.
(Although you can still submit your answers to get me to check them.) Thank-you to everyone who took part in the puzzle, I've had a lot of
fun watching your progress and talking to you on Twitter, Reddit, etc. You can find all the puzzles and answers (from 1 January) here.

The (very) approximate locations of all the entries I have received so far are shown on this map:

This year's winners have been randomly selected from the 29 correct entries on Christmas Day. They are:

1 | Jack Jiang |

2 | Steve Paget |

3 | Joe Gage |

4 | Tony Mann |

5 | Stephen Cappella |

6 | Cheng Wai Koo |

7 | Demi Xin |

8 | Lyra |

9 | David Fox |

10 | Bob Dinnage |

Your prizes will be on their way in early January.

Now that the competition has ended, I can give away a secret. Last year, Neal
suggested that it would be fun if a binary picture was hidden in the answers. So this year I hid one. If you write all the answers in binary, with
each answer below the previous and colour in the 1s black, you will see this:

I also had a lot of fun this year making up the names, locations, weapons and motives for the final murder mystery puzzle. In case you missed them these were:

# | Murder suspect | Motive |

1 | Dr. Uno (uno = Spanish 1) | Obeying nameless entity |

2 | Mr. Zwei (zwei = German 2) | To worry others |

3 | Ms. Trois (trois = French 3) | To help really evil elephant |

4 | Mrs. Quattro (quattro = Italian 4) | For old unknown reasons |

5 | Prof. Pum (pum = Welsh 5) | For individual violent end |

6 | Miss. Zes (zes = Dutch 6) | Stopping idiotic xenophobia |

7 | Lord Seacht (seacht = Irish 7) | Suspect espied victim eating newlyweds |

8 | Lady Oito (oito = Portuguese 8) | Epic insanity got him today |

9 | Rev. Novem (novem = Latin 9) | Nobody in newsroom expected |

# | Location | Weapon |

1 | Throne room | Wrench (1 vowel) |

2 | Network room | Rope (2 vowels) |

3 | Beneath reeds | Revolver (3 vowels) |

4 | Edge of our garden | Lead pipe (4 vowels) |

5 | Fives court | Neighbour's sword (5 vowels) |

6 | On the sixth floor | Super banana bomb (6 vowels) |

7 | Sparse venue | Antique candlestick (7 vowels) |

8 | Weightlifting room | A foul tasting poison (8 vowels) |

9 | Mathematics mezzanine | Run over with an old Ford Focus (9 vowels) |

Finally, well done to Scott,
Matthew Schulz,
Michael Gustin,
Daniel Branscombe,
Kei Nishimura-Gasparian,
Henry Hung,
Mark Fisher,
Jon Palin,
Thomas Tu,
Félix Breton,
Matt Hutton,
Miguel,
Fred Verheul,
Martine Vijn Nome,
Brennan Dolson,
Louis de Mendonca,
Roni,
Dylan Hendrickson,
Martin Harris,
Virgile Andreani,
Valentin Valciu,
and Adia Batic for submitting the correct answer but being too unlucky to win prizes this year. Thank you all for taking part and I'll see you
next December for the next competition.

### Similar Posts

Christmas (2017) is Coming! | Christmas Card 2016 | Christmas (2016) is Coming! | Christmas (2015) is Over |

### Comments

Comments in green were written by me. Comments in blue were not written by me.

**2017-02-03**

Steve Paget

**2017-01-19**

Thanks for setting this all up; I had a lot of fun solving the puzzles every day (and solving half them again when my cookie for the site somehow got deleted). I'll be sure to participate next time too!

SC

**2016-12-28**

Jack

**Add a Comment**

**2016-12-20**

## Christmas Card 2016

Last week, I posted about the Christmas card I designed on the Chalkdust blog.

The card looks boring at first glance, but contains 12 puzzles. Converting the answers to base 3, writing them in the boxes on the front, then colouring the 1s green and 2s red will reveal a Christmassy picture.

If you want to try the card yourself, you can download this pdf. Alternatively, you can find the puzzles below and type the answers in the boxes. The answers will be automatically converted to base 3 and coloured...

# | Answer (base 10) | Answer (base 3) | ||||||||

1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

5 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

7 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

9 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

10 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

11 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | |

12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |

- The square number larger than 1 whose square root is equal to the sum of its digits.
- The smallest square number whose factors add up to a different square number.
- The largest number that cannot be written in the form \(23n+17m\), where \(n\) and \(m\) are positive integers (or 0).
- Write down a three-digit number whose digits are decreasing. Write down the reverse of this number and find the difference. Add this difference to its reverse. What is the result?
- The number of numbers between 0 and 10,000,000 that do not contain the digits 0, 1, 2, 3, 4, 5 or 6.
- The lowest common multiple of 57 and 249.
- The sum of all the odd numbers between 0 and 66.
- One less than four times the 40th triangle number.
- The number of factors of the number \(2^{756}\)×\(3^{12}\).
- In a book with 13,204 pages, what do the page numbers of the middle two pages add up to?
- The number of off-diagonal elements in a 27×27 matrix.
- The largest number, \(k\), such that \(27k/(27+k)\) is an integer.

### Similar Posts

Christmas (2017) is Coming! | Christmas (2016) is Over | Christmas (2016) is Coming! | Christmas (2015) is Over |

### Comments

Comments in green were written by me. Comments in blue were not written by me.

**2016-12-20**

Dan Whitman

**2016-12-20**

Matthew

**2016-12-20**

Dan Whitman

**Add a Comment**

**2016-11-27**

## Christmas (2016) is Coming!

This year, the front page of mscroggs.co.uk will feature an advent calendar, just like last year. Behind each door, there will be a puzzle with a three digit solution. The solution to each day's puzzle forms part of a murder mystery logic puzzle in which you have to work out the murderer, motive, location and weapon used: the answer to each of these murder facts is a digit from 1 to 9 (eg. The murderer could be 6, the motive 9, etc.).

As you solve the puzzles, your answers will be stored in a cookie. Behind the door on Christmas Day, there will be a form allowing you to submit your answers. The winner will be randomly chosen from all those who submit the correct answer on Christmas Day. Runners up will then be chosen from those who submit the correct answer on Christmas Day, then those who submit the correct answer on Boxing Day, then the next day, and so on. As the winners will be chosen randomly,

**there is no need to get up at 5am on Christmas Day this year**!The winner will win this array of prizes:

I will be adding to the pile of prizes throughout December. Runners up will get a subset of the prizes. The winner and runners up will also win an mscroggs.co.uk 2016 winners medal:

To win a prize, you must submit your entry before the end of 2016. Only one entry will be accepted per person. Once ten correct entries have been submitted, I will add a note here and below the calendar. If you have any questions, ask them in the comments below or on Twitter.

So once December is here, get solving! Good luck and have a very merry Christmas!

Edit: added picture of this year's medals.

Edit: more than ten correct entries have been submitted, list of prize winners can be found here.
You can still submit your answers but the only prize left is glory.

### Similar Posts

Christmas (2017) is Coming! | Christmas (2016) is Over | Christmas Card 2016 | Christmas (2015) is Over |

### Comments

Comments in green were written by me. Comments in blue were not written by me.

**2016-12-27**

Matthew

**2016-12-27**

Another Matthew

**2016-12-25**

Lyra

**2016-12-25**

Louis

**2016-12-25**

Matthew

**Add a Comment**

**2016-07-04**

## Solving the Cross Diagonal Cover Problem

In five blog posts
(1,
2,
3,
4,
5)
Gaurish Korpal present the Cross diagonal cover problem, some ideas about how to solve it and some conjectures.
In this post, I will present my solution to this problem. But first, the problem itself:

Draw with an \(m\times n\) rectangle, split into unit squares. Starting in the top left corner, move at 45° across
the rectangle. When you reach the side, bounce off. Continue until you reach another corner of the rectangle:

How many squares will be coloured in when the process ends?

### Restating the Problem

When I first saw this problem, it reminded me of Rebounds, a puzzle I posted here
in 2014. To restate the problem in a similar way, we place a point in the centre of each unit square,
then creating a second grid. I will call this the dual grid. The original problem is equivalent to asking, if a line bounces
around the dual grid, how many corners will it pass through.

It it worth noting here that the dual grid is \(n-1\times m-1\): each side is one shorter than the original grid.

A corner cannot be travelled over more than twice: otherwise, the line would be retracing its past path; to do this requires it to have
already hit a corner of the rectangle. Therefore we can calculate the number of distinct corners travelled to using:

$$\text{Distinct corners visited} = \text{Corners visited}-\text{Corners visited twice}$$
### Introducing Mirrors

When I solved Rebounds, I imagined the line passing through mirror images of the rectange, rather then bouncing.
For our example above, it would look like this:

Looking at the puzzle in this way, it can be seen that the line will travel through \(\mathrm{lcm}(n-1,m-1)\) squares, and so hit \(\mathrm{lcm}(n-1,m-1)+1\)
corners (the \(+1\) appears due to fence panels and fence posts).
We have shown that:

$$\text{Corners visited}=\mathrm{lcm}(n-1,m-1)+1$$
### Collisions in the Mirror

To solve the problem, we need to work out how many corners are visited twice; or the number of times the line crosses itself in the rectangle.

To do this, imagine the mirror images of the red line in the mirrors. Ignoring the images parallel to the red line, and terminating
the lines when they hit the red line gives the following diagram:

I have added extra rectangles to the diagram so that all the reflections that hit the red line and their starting points can be seen.
The diagonal black line has been added because all lines outside that clearly cannot intersect the red line.
We now need to justify two claims:

- Each intersection of a red line and a green line corresponds to the line bouncing off the side of the rectangle or crossing itself (in the dual rectangle). Each bounce or crossing matches with exactly one red-green intersection.
- The green lines starting on the outer border are those that correspond to the bounces.

The first claim can be seen by reflecting the green lines and the parts of the red line they hit back into the top left rectangle.

The second claim can be shown in two parts:

First, each line starting from the border will meet the red line on the edge of a rectangle:
this is because the green lines all start a multiple of two rectangles away, and meet at half this distance away (and half a multiple of two
is a whole number).

Conversely, if a red line meets a green line at the edge of a rectangle, then the reflection of the red line in the edge (ie. the green line)
must go back to a starting point on the boundary.

These two claims show that the points where the line crosses itself in the dual rectangle match up one-to-one with the interior points
at which the green lines start. So if we can count these points, we can solve the problem.

### Counting the Interior Points

The green lines will start from all points that are a multiple of two rectangles (in both directions) away from the top left. The reason for
this can be seen by reflecting the first little bit of the red line in all the mirrors:

We see that the perpendicular green lines that we are interested in, plus many other irrelevant lines, start from a grid of points on the
corner of every other rectangle. To count these points, we will extend them into the full square:

To make for clearer counting, I have not drawn the unit squares.

Alternatively, this square can be thought of as being made up from two copies of the triangle.

We next notice that these points can never lie on the diagonal (the diagonal drawn in the diagram): a green point lying on the diagonal would imply
that the red line met a corner before it did. Taking out the lines on which the green dots never lie, we get:

We can now count the green dots. In the square above, there are
\(\displaystyle\frac{\mathrm{lcm}(m-1,n-1)}{m-1}\) rectangles vertically and
\(\displaystyle\frac{\mathrm{lcm}(m-1,n-1)}{n-1}\) rectangles horizontally.
Therefore there are
\(\displaystyle\frac{\mathrm{lcm}(m-1,n-1)}{m-1}-1\) columns of green dots and
\(\displaystyle\frac{\mathrm{lcm}(m-1,n-1)}{n-1}-1\) rows of green dots. (Again, we take one due to fence posts and fence panels.)

Of these green dots, half are in the triangle of interest, so:

$$\text{Corners visited twice} = \frac12\left(\frac{\mathrm{lcm}(m-1,n-1)}{m-1}-1\right)\left(\frac{\mathrm{lcm}(m-1,n-1)}{n-1}-1\right)$$
### Putting it together

We can now put the two parts together to get:

$$\text{Distinct corners visited} = \mathrm{lcm}(m-1,n-1)+1 - \frac12\left(\frac{\mathrm{lcm}(m-1,n-1)}{m-1}-1\right)\left(\frac{\mathrm{lcm}(m-1,n-1)}{n-1}-1\right)$$
And we have solved the problem.

#### Example

For the \(4\times6\) rectangle given, our formula gives:

$$\text{Distinct corners visited} = \mathrm{lcm}(3,5)+1 - \frac12\left(\frac{\mathrm{lcm}(3,5)}{3}-1\right)\left(\frac{\mathrm{lcm}(3,5)}{5}-1\right)$$
$$= 15+1 - \frac12(5-1)(3-1)$$
$$= 16 - 4 = 12$$
This is correct:

### Disproving the Conjecture

In Gaurish's most recent post, he gave the following
conjecture:
The highest common factor (or greatest common divisor) of \(m\) and \(n\) always divides the number of coloured squares.

After trying to prove this for a while, I found that me attempted proof
required that \(\mathrm{hcf}(n-1,m-1)^2-1\) is a multiple of \(\mathrm{hcf}(n,m)\).
However this is not in general true (eg. 15,5).

In fact, 15,5 provides us with a counterexample to the conjecture:

In this diagram, 26 squares are coloured. However \(\mathrm{hcf}(15,5)=5\)
and 5 is not a factor of 26.

### Similar Posts

Christmas (2017) is Coming! | Christmas (2016) is Over | Christmas Card 2016 | Christmas (2016) is Coming! |

### Comments

Comments in green were written by me. Comments in blue were not written by me.

**Add a Comment**

2017-12-18