Enigmatic Code

Programming Enigma Puzzles

Puzzle 87: Football: letters for digits

From New Scientist #1139, 25th January 1979 [link]

Three football teams (A, B & C) are to play each other once. After some (or perhaps all) of the games had been played a table giving some details of the matches played, won, lost and so on was drawn up. But unfortunately Uncle Bungle has been at it again and he decided to replace the digits by letters. Each letter stands for the same digit (from 0 to 9) whenever it appears and different letters stand for different digits.

The table looked like this:

Puzzle 87

(Two points are given for a win, and one point to each side in a drawn match).

Find the score in each match.

[puzzle87]

Enigma 1138: Pedal power

From New Scientist #2294, 9th June 2001

Jane left the campsite and cycled north at her own steady speed. At the same time Mark left the campsite and cycled south at a speed one mile per hour faster than Jane.

An hour later I realised that they had left without their packed lunches. So, at my own steady speed of 10 miles an hour, I cycled after Jane, gave her a packed lunch, turned round and cycled after Mark, gave him a packed lunch, and then turned round and cycled back to the campsite.

The round trip took me 5 hours. How long would it have taken if I had cycled to Mark first and then to Jane?

[enigma1138]

Enigma 373: Date the painting

From New Scientist #1522, 21st August 1986 [link]

Enigma 373

(R = Red, B = Blue, G = Green, Y = Yellow)

You will no doubt have recognised this as the latest masterpiece by the artist Pussicato, which has just gone on display at the National Gallery. I visited Pussicato in his studio at the end of March, just before he began work on the picture. He showed me the canvas divided into 36 squares which were numbered 1 to 36. He planned to paint the squares in order, one per day starting with square 1 on 1 April, using the four colours in strict rotation. He had numbered the squares so that from one day to the next he always moved to an adjacent square either horizontally or vertically; also, squares 1 and 36 were similarly adjacent. As I looked at the canvas, I pointed to two horizontally adjacent squares and remarked that the right-hand one contained a number which was 8 times the number in the left-hand square. Pussicato had no reply.

On what date did Pussicato paint the top left hand square of the picture?

[enigma373]

Tantalizer 497: My pretty maid

From New Scientist #1048, 21st April 1977 [link]

“How are you travelling, my pretty maid?”
“Not to the South, good sir”, she said.

“Tell you the truth, pray, my pretty maid?”
“Thrice by the end of our song”, she said.

“Then how are you travelling, my pretty maid?”
“East, Sir, or West, kind Sir”, she said.

“But tell you the truth, pray, my pretty maid?”
“Once by the end of our song”, she said.

“And how are you travelling, my pretty maid?”
“West, Sir, or South, dear Sir”, she said.

“And tell you the truth, pray, my pretty maid?”
“Four times by the end of our song”, she said.

“So how are you travelling, my pretty maid?”
“Not North nor South, poor Sir”, she said.

He stood and pondered what she meant.
Can you deduce which way she went?

[tantalizer497]

Enigma 1139: A simple addition

From New Scientist #2295, 16th June 2001

enigma-1139

The simple addition, 0 + 2 + 7 + 11 = 20, may also be written as shown in the diagram where different letters stand for different digits and the same letter stands for the same digit.

What is the value of NIL?

[enigma1139]

Enigma 372: Letter by letter

From New Scientist #1521, 14th August 1986 [link]

In this division sum, each letter stands for a different digit.

enigma-372

Rewrite the sum with letters replaced by digits.

[enigma372]

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?

Enigma 1140: A long, long road

From New Scientist #2296, 23rd June 2001

George lives in a long road in which the houses are numbered from one with no numbers missing. He has calculated that the total of all the house numbers less than his is equal to the total of all the house numbers greater than his.

George’s brothers, Dave, Ernest and Fred, live in shorter roads than George, but they can each make the same claim regarding house numbers. The brothers’ four house numbers have different numbers of digits.

Hearing this story, George’s drinking friend scribbled on a beer mat for a while, then he asked: “George, does your road have nearly 10,000 houses?”

“No, not nearly that many,” George replied.

How many houses are there in total in the four roads? And what answer would the man in the pub have given to that question before being corrected?

[enigma1140]

Enigma 371: No last words

From New Scientist #1520, 7th August 1986 [link]

1. There is at least one true sentence and at least two false sentences here, and the number of the first true sentence added to the number of the second false one gives the number of a sentence which is false.

2. There is at least one false sentence and at least two true sentences here, and the number of the first false sentence added to the number of the second true one gives the number of a sentence which is true.

3. This Enigma would still have a unique answer if the very last of the number of sentences were deleted.

4. There are more true sentences than false sentences in this list.

5. Sentences 1 and 2 are equally true.

How many of the sentences are false?

[enigma371]

Puzzle 88: Sergeant Simple in verse

From New Scientist #1140, 1st February 1979 [link]

I am Sergeant Simple and I keep the notes and diaries,
Of my boss Professor Knowall, magic name;
I do all the donkey work and help in the inquiries,
So the Prof. can close his eyes and use his brain.

But it is not only crime which occupies his mind,
For we also follow soccer here and there,
And I will tell you now of a most important find
Which made a nonsense problem crystal clear.

This is soccer for a few,
By a method which is new,
Ten and five are points awarded for a win and for a draw,
And a point for every goal that has been scored.

If you ask what this is for
I reply that that’s the law

And more goals will be obtained as the reward.

Four teams all played each other, it does not matter when,
A and C got eight points each and B nineteen, and then
One more got fifty seven. And there’s a problem rich
For one teams points are incorrect. I must not tell you which.

But Professor Knowall knows and he says this:
“If I give the information that you can discover which,
Why then you will be able so to do”.

The Professor, as we know, is good at many things,
But he has not got the fantasy that gives a poet wings.
Two bits of information that will help you in your approach
And you can then the puzzle solve. For when
A match is played at least one goal is scored by both,
But they never scored together more than ten.

Which figure was wrong? And what information can you give about the score in each match?

[puzzle88]

Enigma 1141: Powers of two

From New Scientist #2297, 30th June 2001

In the following statements digits have been consistently replaced by capital letters, different letters being used for different digits:

TWO is a prime number,
FOUR is a perfect square,
EIGHT is a [perfect] cube.

You should assume that neither TWO nor FOUR nor EIGHT starts with a zero.

Find the number represented by EIGHT.

[enigma1141]

Enigma 370: Cosmic distractions

From New Scientist #1519, 31st July 1986 [link]

In the subtraction sum below, each of the digits from 0 to 9 has been replaced by a letter wherever it occurs. Different letters stand for different digits. You are asked to reproduce the original sum. Leading zeros are not allowed. M is bigger than R, and C is bigger than E.

enigma-370

[enigma370]

Tantalizer 498: Check list

From New Scientist #1049, 28th April 1977 [link]

Keen to do their bit for the nation, Aspex Ltd., the aspirin company, have decided to sponsor a chess tournament. There will be four prizes and 13 players will compete on the usual all-against-all basis, with 1 point for each win and ½ for each draw. The prizes will be divisible. Thus if 3 players tie for 1st place they will share the top 3 prizes; if 3 players tie for 3rd place, they will share the 3rd and 4th prizes; and so on.

As you see, there is no telling in advance how many players will end up with a share in the prizes. But my friend George is determined to be among them. Not for him a cliff-hanging struggle for top place, which might leave him prizeless, if boldness does not pay! What he wants to know is exactly how few points he needs to collect from his 12 games to be absolutely sure of featuring on the prize list.

Can you help him?

[tantalizer498]

Enigma 1142: Policies with strings

From New Scientist #2298, 7th July 2001

Harry used to work for Smallprint, Wriggle, and Payless, a large insurance company. He recalls that every policy number (including some with leading “0”s) had the same number of digits, which was fewer than 20.

He also recalls being passed a neat list of the numbers of five policies for review, and being astonished to find that each number below the first on the list had exactly twice the value of the one above it, and could be obtained from the number above it merely by moving the last digit of that number to its front.

What was the bottom number on his list of five numbers?

[enigma1142]

Enigma 369: A safe number

From New Scientist #1518, 24th July 1986 [link]

“My memory is poor, but accurate,” said Mooncalf. “I remember just enough of the characteristics of my safe combination to enable me to reconstruct the number when I forget it. It contains a pair of 1s separated by one digit, a pair of 2s separated by two digits, a pair of 3s separated by three digits and so on, there being twice as many digits in the number as the value of the highest digit. Yet I can’t even remember the highest pair of digits.”

“There must be many such numbers,” I opined, reaching for my notepad. “For example, 312132. That has two 1s separated by one digit, two 2s separated by two digits and two 3s separated by three digits.”

“Yes. But what makes my safe number unique is that it is the highest number that can be formed in this way. As an aide-mémoire, I have written part of it on a card. If anyone stumbles across it he is unlikely to tumble to its true significance. First I write the safe number backwards. Then, starting from the right I discard from this number, one by one, as many digits as I can, consistent with there occurring at least once in the number which remains each digit of the original number. This final number is my aide-mémoire.”

“You mean if it were 41312432 you would be left with 23421 on the card?”

“Exactly. But I have locked it away in the safe, and I want you to help me to deduce my combination so I can open the safe and retrieve it.”

Scratching my head, I got down to work. In no time at all I had deduced the number and had retrieved Mooncalf’s card.

What was the number inscribed on it?

[enigma369]

Puzzle 89: Division: figures all wrong

From New Scientist #1141, 8th February 1979 [link]

In the following, obviously incorrect, division sum the pattern is correct, but all the figures are wrong.

Puzzle 89

The correct division comes out exactly. The digits in the answer are only 1 out, but all the other digits may be incorrect by any amount.

Find the correct figures.

[puzzle89]

Enigma 1143: Count and count

From New Scientist #2299, 14th July 2001

You will need a large sheet of lined paper. Draw 9 vertical lines to divide the sheet into 10 columns. On the first line write the headings of the columns, 0, 1, 2, …, 8, 9. On the second line write your own choice of digits 0 to 9, one digit in each column, subject to the conditions that the digits are not all the same and they are not all different. Fill in line 3 as follows. Count how many 0’s there are in line 2 and put the answer on line 3 in the 0 column. Count how many 1’s there are in line 2 and put the answer on line 3 in the 1 column. Repeat for the other digits. In the same way that line 3 was filled in using line 2, so you fill in line 4 using line 3. Continue in this way filling in, in turn, lines 5, 6, 7, …

What are the possible lines of digits the might be on line 1000 of your sheet of paper?

[enigma1143]

Enigma 368: What’s the truth

From New Scientist #1517, 17th July 1986 [link]

Each of the following six statements is either true or false.

1. Statements 2 and 3 are both true or both false.
2. Exactly one of statements 4 and 5 is true.
3. Exactly one of statements 4 and 6 is true.
4. Exactly one of statements 1 and 6 is true.
5. Statements 1 and 3 are both true or both false.
6. Exactly one of statements 2 and 5 is true.

Which of the six statements are true?

[enigma368]

Tantalizer 499: Kid’s stuff

From New Scientist #1050, 5th May 1977 [link]

Professor Plato once introduced two strangers to each other by saying, “Mrs. Um, I’d like you to meet Mrs. Er, seeing that you are both perfect logicians and mothers with 9 or 10 children between you.”

“How many children do you have?” asked Mrs. Um.
“How many do you have?” Mrs. Er countered.
“How many do you have?” Mrs. Um repeated.
“How many do you have?” retorted Mrs. Er.
“How many do you have?” Mrs. Um persisted.
“How many do you have?” Mrs. Er returned.
“How many do you have?” inquired Mrs. Um.
“How many do you have?” reposted Mrs. Er.

The ladies now fell silent, since, as everyone knows, perfect logicians do not ask questions which they can already answer.

If at least one lady had an even number of children, how many did each have?

[tantalizer499]

Enigma 1144: Isaac Newton (?-1727)

From New Scientist #2300, 21st July 2001 [link]

Enigma 1144

Isaac Newton, 1642-1727? or 1643-1727? The discrepancy of course is due to the overlap of the Julian and Gregorian calendars and to avoid any controversy I have omitted his birth year altogether in the given multiplications, leaving only 1727 as shown. All other digits have been replaced by letters and asterisks.

However, the mechanistic laws of motion attributed to this great scientists provide another clue and this is given by the simple equation: F = m × A.

In the multiplications and the clue, different capital letters stand for different digits and the same capital letter stands for the same digit. Asterisks and the lower-case letter, m, can be any digit.

What is the value of SCIENTIST?

[enigma1144]