mscroggs.co.uk
mscroggs.co.uk
Click here to win prizes by solving the mscroggs.co.uk puzzle Advent calendar.
Click here to win prizes by solving the mscroggs.co.uk puzzle Advent calendar.

subscribe

Blog

 2024-12-22 
I showed off and part-solved a prototype version of this puzzle with Katie Steckles in the fifteenth Finite Group livestream. You can watch a recording of this stream, and watch our future streams if you sign up to our Patreon.
I clearly haven't already made enough Christmas puzzles this year, so I've made another one. If you've used regular expressions before, head straight to mscroggs.co.uk/regexmas to try the puzzle. If you've not, read on...

What is a regular expression

Regular expressions are strings of characters that can be used in multiple programming languages to validate text. Regular expressions are usually written between two / characters. Between the slashes, characters have the following meaning:

The puzzle

My regular expression Christmas puzzle is shown below. You can either solve it on this page or at mscroggs.co.uk/regexmas using the buttons or your keyboard, or you can download this PDF of the puzzle.
In the grid below, write r, g, b, c, m, y, k, or w in every square so that:
The squares containing an r will be coloured red, those containing a g will be coloured green, those containing a b will be coloured blue, those containing a c will be coloured cyan, those containing an m will be coloured magenta, those containing a y will be coloured yellow, those containing a k will be coloured black, and those containing a w will be left white.
r g b c m y k w
/^w+yw+$/
/^([kw]+)[^kw]\1$/
/^(g|wwwg|gww)+.$/
/^wy?g*y+w+$/
/^((w|gg)(ww|g)){3}$/
/^[wg](w|g)[gw](.)\2+\1{2}$/
/^.g*[^y]$/
/^([gk][gk][gk])\1\1$/
/^yw+kw+y$/
/^w*b(bb)+w*$/
/^(w+)w?(bb?)\2\2\1$/
/^(www|bbb)+$/
/^w+gyw+$/
/^[wg]*y[wg]*$/
/^.*gwg.*gwb.*$/
/^[^g]+g+[^g]+$/
/^y?g+y?g+k?b+$/
/^[w]+g*w[^w]+$/
/^w+g+wg+[^g]+$/
/^w*yw*g+w*$/
/^w*y?g?y?w*$/
                        
(Click on one of these icons to react to this blog post)

You might also enjoy...

Comments

Comments in green were written by me. Comments in blue were not written by me.
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

Allowed HTML tags: <br> <a> <small> <b> <i> <s> <sup> <sub> <u> <spoiler> <ul> <ol> <li> <logo>
To prove you are not a spam bot, please type "v" then "e" then "c" then "t" then "o" then "r" in the box below (case sensitive):
 2024-12-04 
As usual, I spent some time this November, designing this year's Chalkdust puzzle Christmas card (with some help from TD).
The card contains 10 puzzles. By splitting the answers into pairs of digits, then drawing lines between the dots on the cover for each pair of digits (eg if an answer is 201304, draw a line from dot 20 to dot 13 and another line from dot 13 to dot 4), you will reveal a Christmas themed picture. Colouring any region containing an even number of unused dots green and colour any region containing an odd number of unused dots red or blue will make the picture even nicer.
If you're in the UK and want some copies of the card to send to your maths-loving friends, you can order them at mscroggs.co.uk/cards.
If you want to try the card yourself, you can download this printable A4 pdf. Alternatively, you can find the puzzles below and type the answers in the boxes. The answers will automatically be used to join the dots and the appropriate regions coloured in...
×9      ×8      ×4      ×5      ×5
(Click on one of these icons to react to this blog post)

You might also enjoy...

Comments

Comments in green were written by me. Comments in blue were not written by me.
Matt, great card this year! Problems 1 and 2 are slightly ambiguous though in that you did not specify that each digit could only be used once.

I initially thought the answers were simply 44×44 = 1936 and 99×99999999 = 9899999901, respectively ????
Dan Whitman
×1      ×1           Reply
I find that I can enter seven correct answers without issue. however, an eighth answer causes the entire tree to vanish.

I'm using Firefox on Windows 11.
hakon
                 Reply
@HJ: I can't reproduce that error on Firefox or Chrome on Ubuntu - although I did notice I'd left some debug outputting on, which I've now removed. Perhaps that was causing the issue.

If anyone else hits this issue, please let me know.
Matthew
                 Reply
On my machine (Mac, using either Firefox or Chrome, including private mode so no plugins) the puzzle disappears when I complete the answers for 1, 3 and 9. I'm presuming my answers are correct -- the pattern they create is pretty clear and looks reasonable.
HJ
                 Reply
I fond this card quite amusing. If I were clever enogh, I cold solve more of the problems! - Cheers from the USA
mitch
                 Reply
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

Allowed HTML tags: <br> <a> <small> <b> <i> <s> <sup> <sub> <u> <spoiler> <ul> <ol> <li> <logo>
To prove you are not a spam bot, please type "rotcev" backwards in the box below (case sensitive):
 2024-11-21 
The mscroggs.co.uk Advent Calendar is back for its tenth 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 logic puzzle:
It's nearly Christmas and something terrible has happened: there's been a major malfunction in multiple machines in Santa's toy factory, and not enough presents have been made. Santa has a backup warehouse full of wrapped presents that can be used in the case of severe emergency, but the warehouse is locked. You need to help Santa work out the code to unlock the warehouse so that he can deliver the presents before Christmas is ruined for everyone.
The information needed to work out the code to the warehouse is known by Santa and his three most trusted elves: Santa is remembering a three-digit number, and each elf is remembering a one-digit and a three-digit number. If Santa and the elves all agree that the emergency warehouse should be opened, they can work out the code for the door as follows:
But this year, there is a complication: the three elves are on a diplomatic mission to Mars to visit Martian Santa and cannot be contacted, so you need to piece together their numbers from the clues they have left behind.
Behind each day (except Christmas Day), there is a puzzle with a three-digit answer. Each of these answers forms part of a clue about Santa's and the elves' numbers. You must use these clues to work out the code for the warehouse. You can use this page to try opening the door. If you enter an incorrect code three times, the door mechanism locks until the following day.
Ten randomly selected people who solve all the puzzles, open the warehouse, and fill in the entry form behind the door on the 25th will win prizes!
The prizes will include an mscroggs.co.uk Advent 2024 T-shirt. If you'd like one of the T-shirts from a previous Advent, they are available to order at merch.mscroggs.co.uk.
The winners will be randomly chosen from all those who submit the entry form before the end of 2024. 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!
As you solve the puzzles, your answers will be stored. To share your stored answers between multiple devices, enter your email address below the calendar and you will be emailed a magic link to visit on your other devices.
To win a prize, you must submit your entry before the end of 2024. Only one entry will be accepted per person. If you have any questions, ask them in the comments below, on Bluesky, or on Mastodon. If you'd like to chat with other solvers, we'll be discussing the Advent Calendar in the #scroggs-advent-calendar channel in the Finite Group Discord: you can join the Discord by following the link in this post on Patreon (you'll need to become a free member on Patreon to unlock the post).
So once December is here, get solving! Good luck and have a very merry Christmas!
×9      ×2                  ×2
(Click on one of these icons to react to this blog post)

You might also enjoy...

Comments

Comments in green were written by me. Comments in blue were not written by me.
@Ben: Thanks, I've added the "before"
Matthew
   ×2              Reply
I am so appreciative that you continue to make these puzzles every year. I think I started doing them in 2017 and always enjoy them. Thank you!
Jessica
×1                 Reply
Thanks Scroggs - first time I've done this and very much enjoyed the days and also the meta-puzzling. Brilliant!!. If you run in future years I have one request for a tiny tweak - I find the numbers on the advent calendar for the days very small for my ageing eye-sight - any chance of a bigger font? And last suggestion - when it gets to the end, provide a link to your "buy me a cup of tea" page as this is more than worth a few £s :-). Thanks again :-)
Justin
×1                 Reply
@Seth Cohen: Thanks Seth, I solved it by looking at the 5×5 picture and thinking harder. Thanks to Matthew for another enjoyable set of puzzles. I look forward to reading the proper solution.
Reza
                 Reply
Had a great time doing this puzzles again this year! 23 was particularly fun :) Thanks for taking the time to make this!
Bill V.
                 Reply
I enjoyed working the advent puzzles. Thank you for providing such fun entertainment and math challenges! Attempted most without any programming help but some begged for a programming solution. Refreshed some former Python skills to happily solve a few puzzles. Looking forward to math solutions. Merry Christmas and Happy Holidays!
Tony
×1                 Reply
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

Allowed HTML tags: <br> <a> <small> <b> <i> <s> <sup> <sub> <u> <spoiler> <ul> <ol> <li> <logo>
To prove you are not a spam bot, please type "b" then "i" then "s" then "e" then "c" then "t" in the box below (case sensitive):
 2024-01-07 
Welcome to 2024 everyone! Now that the Advent calendar has disappeared, it's time to reveal the answers and announce the winners. But first, some good news: with your help, the machine was fixed in time for Santa to deliver presents and Christmas was saved!
Now that the competition is over, the questions and all the answers can be found here. Before announcing the winners, I'm going to go through some of my favourite puzzles from the calendar and a couple of other interesting bits and pieces.

Highlights

My first highlight is the puzzle from 4 December. I like this puzzle, because at first it looks really difficult, and the size of the factorial involved is impossibly large, but the way of solving it that I used essentially just ignores the factorial leading to a much easier question.

4 December

If \(n\) is 1, 2, 4, or 6 then \((n!-3)/(n-3)\) is an integer. The largest of these numbers is 6.
What is the largest possible value of \(n\) for which \((n!-123)/(n-123)\) is an integer?

Show answer


My next pair of highlights are the puzzles from 6 and 7 December. I always enjoy a surprise appearance of the Fibonacci sequence, and a double enjoyed a double appearance in two contexts that at first look completely different.

6 December

There are 5 ways to tile a 4×2 rectangle with 2×1 pieces:
How many ways are there to tile a 12×2 rectangle with 2×1 pieces?

Show answer

7 December

There are 8 sets (including the empty set) that contain numbers from 1 to 4 that don't include any consecutive integers:
\(\{\}\), \(\{1\}\), \(\{2\}\), \(\{3\}\), \(\{4\}\), \(\{1,3\}\), \(\{1,4\}\), \(\{2, 4\}\)
How many sets (including the empty set) are there that contain numbers from 1 to 14 that don't include any consecutive integers?

Show answer & extension


My next highlight is the puzzle from 13 December. I love a good crossnumber, and had a lot of fun making this small one up. (If you enjoyed this one, you should check out the crossnumbers I write for Chalkdust.)

13 December

Today's number is given in this crossnumber. No number in the completed grid starts with 0.

Show answer


My final highlight is the puzzle from 22 December. I enjoy that you can use one of the circle theorems to solve this, despite there being no circles directly involved in the question.

22 December

There are 4 ways to pick three vertices of a regular quadrilateral so that they form a right-angled triangle:
In another regular polygon with \(n\) sides, there are 14620 ways to pick three vertices so that they form a right-angled triangle. What is \(n\)?

Show answer

Hardest and easiest puzzles

Once you've entered 24 answers, the calendar checks these and tells you how many are correct. I logged the answers that were sent for checking and have looked at these to see which puzzles were the most and least commonly incorrect. The bar chart below shows the total number of incorrect attempts at each question.
It looks like the hardest puzzles were on 23 and 12 December; and the easiest puzzles were on 1, 3, 5, and 11 December.

Fixing the machine

To finish the Advent calendar, you were tasked with fixing the machine. The answers to all the puzzles were required to be certain of which combination of parts were needed to fix the machine, but it was possible to reduce the number of options to a small number and get lucky when trying these options. This graph shows how many people fixed the machine on each day:

The winners

And finally (and maybe most importantly), on to the winners: 180 people managed to fix the machine. That's slightly fewer than last year:
From the correct answers, the following 10 winners were selected:
Congratulations! Your prizes will be on their way shortly.
The prizes this year include 2023 Advent calendar T-shirts. If you didn't win one, but would like one of these, I've made them available to buy at merch.mscroggs.co.uk alongside the T-shirts from previous years.
Additionally, well done to 100118220919, Aaron, Adam NH, Aidan Dodgson, AirWrek, Alan Buck, Alejandro Villarreal, Alek2ander, Alex, Alex Hartz, Allan Taylor, Andrew Roy, Andrew Thomson, Andrew Turner, Andy Ennaco, Ashley Jarvis, Austin Antoniou, Becky Russell, Ben, Ben Boxall, Ben Reiniger, Ben Tozer, Ben Weiss, Bill Russ, Bill Varcho, Blake, Bogdan, Brian Wellington, Carl Westerlund, Carmen, Carnes Family, Cathy Hooper, Chris Eagle, Chris Hellings, Colin Brockley, Connors of York, Corbin Groothuis, Dan Colestock, Dan May, Dan Rubery, Dan Swenson, Dan Whitman, Daphne, David and Ivy Walbert, David Ault, David Berardo, David Fox, David Kendel, David Mitchell, Deborah Tayler, Diane, Donald Anderson, Duncan S, Dylan Madisetti, Ean, Elise Raphael, Emelie, Emily Troyer, Emma, Eric, Eric Kolbusz, Ewan, Frank Kasell, Fred Verheul, Gabriella Pinter, Gareth McCaughan, Gary M, Gary M. Gerken, George Witty, Gert-Jan, Grant Mullins, Gregory Wheeler, Guillermo Heras Prieto, Heerpal Sahota, Helen, Herschel, Iris Lasthofer, Ivan Molotkov, Jack, Jack H, Jacob Y, James Chapman, Jan Z, Jay N, Jean-Sébastien Turcotte, Jen Sparks, Jenny Forsythe, Jessica Marsh, Jim Ashworth, Joe Gage, Johan, Jon Palin, Jonathan Chaffer, Jonathan Thiele, Jorge del Castillo Tierz, K Brooks, Kai, Karen Climis, Kevin Docherty, Kevin Fray, Kirsty Fish, Kristen Koenigs, lacop, Lazar Ilic, Lewis Dyer, Lisa Stambaugh, Lise Andreasen, Lizzie McLean, Louis, Magnus Eklund, Marco van der Park, Mark Fisher, Mark Stambaugh, Martijn O., Martin Harris, Martin Holtham, Mary Cave, Matthew Schulz, Max, Merrilyn, Mihai Zsisku, Mike Hands, Miles Lunger, Mr J Winfield, Nadine Chaurand, Naomi Bowler, Nathan Whiteoak, Nick C, Nick Keith, Niji Ranger, Pamela Docherty, Pierce R, Qaysed, Rashi, Ray Arndorfer, rea, Reuben Cheung, Riccardo Lani, Richard O, Rob Reynolds, Robby Brady, Roger Lipsett, Roni, Rosie Paterson, RunOnFoot, Ruth Franklin, Ryan Wise, Sage Robinson, Sam Dreilinger, Sarah, Scott, Sean Henderson, Seth Cohen, Shivanshi, Shreevatsa, Stephen Cappella, Steve Blay, TAS, Tehnuka, The Johnston Family, Tina, Tony Mann, Trent Marsh, tripleboleo, Valentin VĂLCIU, Vinny R, William Huang, Yasha, and Yuliya Nesterova, who all also completed the Advent calendar but were too unlucky to win prizes this time or chose to not enter the prize draw.
See you all next December, when the Advent calendar will return.
×8      ×10      ×5      ×5      ×5
(Click on one of these icons to react to this blog post)

You might also enjoy...

Comments

Comments in green were written by me. Comments in blue were not written by me.
In your solution for the 12th, I think there's still a little work to do: to check that the answer is the smallest integer that works. For that, because 241 is prime, you only have a handful of values to check.
Ben Reiniger
×4   ×4   ×4   ×4   ×4     Reply
(you've left the "drones" in at the beginning of the Winners section)
Ben Reiniger
×2   ×2   ×3   ×1   ×2     Reply
On the 6th and 7th, there's also a direct bijection: in the tiling, horizontal tiles must occur in aligned pairs (else they split left/right into odd number of 1x1 blocks). Encode a tiling with the set of horizontal locations of the left ends of the horizontal-tile-pairs.
Ben Reiniger
×2   ×2   ×2   ×2   ×2     Reply
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

Allowed HTML tags: <br> <a> <small> <b> <i> <s> <sup> <sub> <u> <spoiler> <ul> <ol> <li> <logo>
To prove you are not a spam bot, please type "s" then "e" then "g" then "m" then "e" then "n" then "t" in the box below (case sensitive):
 2023-12-08 
In November, I spent some time (with help from TD) designing this year's Chalkdust puzzle Christmas card.
The card looks boring at first glance, but contains 10 puzzles. By colouring in the answers to the puzzles on the front of the card in the colours given (each answer appears four time), you will reveal a Christmas themed picture.
If you're in the UK and want some copies of the card to send to your maths-loving friends, you can order them at mscroggs.co.uk/cards.
If you want to try the card yourself, you can download this printable A4 pdf. Alternatively, you can find the puzzles below and type the answers in the boxes. The answers will automatically be found and coloured in...
13 36 8 13 32 34 18 18 81 81 32 7 11 1 20 40 75 12 94 36 2 2 11 20 7 1 34 11 10 18 64 88 94 60 94 64 94 88 88 60 88 64 2 64 43 2 43 40 49 49 12 60 75 10 49 32 81 18 49 20 34 36 32 40 75 12 43 40 43 12 60 75 36 34 4 11 20 7 10 10 8 7 13 13 4 8 8 1 4 4 1 81
×21      ×15      ×7      ×8      ×13
(Click on one of these icons to react to this blog post)

You might also enjoy...

Comments

Comments in green were written by me. Comments in blue were not written by me.
Incorrect answers are treated is correct.

Looking at the JavaScript code, I found that any value that is a key in the array "regions" is treated as correct for all puzzles.
Lars Nordenström
×4   ×4   ×4   ×4   ×4     Reply
My visual abilities fail me - managed to solve the puzzles but cannot see what the picture shows
Gantonian
×4   ×4   ×4   ×4   ×4     Reply
@nochum: It can't, so the answer to that one probably isn't 88.
Matthew
×4   ×5   ×5   ×5   ×5     Reply
how can a dodecagon with an area of 88 fit inside anything with an area of 62.83~?
nochum
×4   ×4   ×4   ×4   ×2     Reply
 Add a Comment 


I will only use your email address to reply to your comment (if a reply is needed).

Allowed HTML tags: <br> <a> <small> <b> <i> <s> <sup> <sub> <u> <spoiler> <ul> <ol> <li> <logo>
To prove you are not a spam bot, please type "ddo" backwards in the box below (case sensitive):

Archive

Show me a random blog post
 2024 

Dec 2024

A regular expression Christmas puzzle
Christmas card 2024

Nov 2024

Christmas (2024) is coming!

Feb 2024

Zines, pt. 2

Jan 2024

Christmas (2023) is over
 2023 
▼ show ▼
 2022 
▼ show ▼
 2021 
▼ show ▼
 2020 
▼ show ▼
 2019 
▼ show ▼
 2018 
▼ show ▼
 2017 
▼ show ▼
 2016 
▼ show ▼
 2015 
▼ show ▼
 2014 
▼ show ▼
 2013 
▼ show ▼
 2012 
▼ show ▼

Tags

statistics bubble bobble royal baby finite group tennis python oeis crochet rhombicuboctahedron dinosaurs flexagons edinburgh braiding national lottery weak imposition machine learning reddit stickers christmas graphs matrix of cofactors ucl numbers data visualisation curvature interpolation inline code propositional calculus hexapawn approximation phd draughts numerical analysis reuleaux polygons games folding paper latex captain scarlet golden spiral asteroids gather town christmas card preconditioning final fantasy sorting london underground mathslogicbot folding tube maps harriss spiral squares pi approximation day tmip news ternary european cup accuracy data raspberry pi polynomials royal institution trigonometry misleading statistics sobolev spaces mathsteroids sport error bars weather station signorini conditions matrices menace speed pascal's triangle computational complexity zines bodmas radio 4 manchester fractals databet dataset live stream coins realhats matrix of minors binary game show probability chess guest posts stirling numbers pythagoras noughts and crosses pi a gamut of games regular expressions mathsjam javascript football books london arithmetic advent calendar hyperbolic surfaces pac-man 24 hour maths graph theory matrix multiplication wave scattering logic frobel big internet math-off convergence go map projections crossnumber video games logo mean estimation dates light anscombe's quartet cambridge palindromes simultaneous equations youtube boundary element methods recursion triangles chalkdust magazine wool runge's phenomenon platonic solids nine men's morris dragon curves exponential growth errors chebyshev datasaurus dozen newcastle hats countdown puzzles electromagnetic field golden ratio people maths world cup plastic ratio quadrilaterals manchester science festival logs martin gardner sound craft determinants finite element method gerry anderson gaussian elimination game of life hannah fry bempp matt parker correlation pizza cutting geometry programming probability fonts php the aperiodical geogebra cross stitch talking maths in public fence posts standard deviation rugby turtles inverse matrices bots

Archive

Show me a random blog post
▼ show ▼
© Matthew Scroggs 2012–2024