Enigmatic Code

Programming Enigma Puzzles

Category Archives: misc

Grid puzzle

I drew a 2×2 grid with the numbers 1-4 in it, odd numbers on the top row, even numbers on the bottom row, as below:

Starting at 1 and moving to adjacent squares (diagonal moves are allowed). There are 6 paths that visit all the squares in the grid:

(1, 2, 3, 4), (1, 2, 4, 3), (1, 3, 2, 4), (1, 3, 4, 2), (1, 4, 2, 3), (1, 4, 3, 2).

I then extended my grid to 2×8 grid, as shown:

How many paths are there on the new grid? (Each path must start at 1, and by moving to adjacent squares visit every square in the grid exactly once).

And how many paths are there on a 2×20 grid?

Pizza Puzzle

This puzzle is inspired by a combinatorial problem that surfaced in the Feedback section of New Scientist in early 2011. (See issues #2794 and  #2798), and was brought to my attention by Hugh Casement. [link]

Here is the puzzle:

When ordering a pizza from the Enigmatic Pizza Company you can specify the toppings on your pizza. There are 34 possible toppings to choose from, and you can have up to 11 toppings on your pizza. But you can have no more than three helpings of any individual topping.

The most basic pizza available would be one with no toppings at all. And a fully loaded veggie pizza might have 3 helpings of cherry tomatoes, 3 helpings of mixed peppers, 3 helpings of jalapeño peppers and 2 helpings of mozzarella cheese, using up all 11 toppings.

What is the total number of different pizza combinations that are available?

Singapore School Logic Puzzle

This puzzle has been getting a lot of attention recently, for example on the Guardian and BBC websites. It is quite similar to some of the Enigma puzzles published here.

Here it is slightly paraphrased to improve readability:

Albert and Bernard have just become friends with Cheryl, and they want to know when her birthday is.

Cheryl gives them a list of 10 possible dates, one of which is her birthday:

May 15, May 16, May 19,
June 17, June 18,
July 14, July 16,
August 14, August 15, August 17.

Cheryl then says she is going to tell the month of her birthday to Albert (but not to Bernard), and the day of her birthday to Bernard (but not to Albert). She does this.

The following conversation then took place:

Albert: I don’t know when Cheryl’s birthday is, but I know that Bernard does not know either.
Bernard: I didn’t know when Cheryl’s birthday is, but now I do.
Albert: Then I also know when Cheryl’s birthday is.

So, assuming they are all telling the truth and are all perfect logicians and have no further information, when is Cheryl’s birthday.

%d bloggers like this: