# Enigmatic Code

Programming Enigma Puzzles

## Tantalizer 13: Balls

From New Scientist #563, 21st September 1967 [link]

Take a red, a blue and a green bucket. Ask a friend to put into them three red, three blue and three green balls in such a way that:

1. There are three balls in each bucket.
2. There is a blue ball in each bucket.
3. There are no green balls in the green bucket.

Now point to a bucket (without looking inside it) and have him throw you one ball from it at random. Repeat the process until you have collected one red, one blue and one green ball.

What is the smallest number of balls collected in this way which cannot fail to include the selection required?

A variation of this puzzle appears in the book Tantalizers (1970) under the title “Billiard Balls”.

[tantalizer13]

## Tantalizer 12: Aunts

From New Scientist #562, 14th September 1967 [link]

“Be a dear”, said Aunt Agatha, “and write to that nice man about the things”.

“The man who collects beetles about the hymn-books”, replied my aunt without hesitation. “Here’s his address:

Ernest Baggins,
Mallards,
Appleton,
Kent”.

“That doesn’t sound right, dear”, interrupted Aunt Maud. “I’m sure he’s not Baggins. Where’s my book? Yes, here we are:

Ernest Boggins,
Halyards,
Surrey”.

“That’s not what I’ve got”, put in Aunt Jobiska. “I’ve got:

Edward Biggins,
Haystacks,
Cuxham,
Surrey”.

“Not Biggins, Jobiska, Boggins”, this from Aunt Kate.

“Edward Boggins,
Pollards,
Appleton,
Sussex”.

“Stuff!”, said Aunt Tabitha rudely, “He is called Ernest Buggins, poor man, and his address is:

Willows,
Surrey”.

As no Aunt was willing to give way, I had to ring the vicar and he, it turned out, was both deaf and loquacious. However, I got the name and address in the end and found that each aunt had been right in exactly two out of her five particulars.

What is his name and address?

A version of this puzzle appears in the book Tantalizers (1970) under the title “Aunt Maud”.

[tantalizer12]

## Tantalizer 11: Night-watchman

From New Scientist #561, 7th September 1967 [link]

Old Charlie is night-watchman at the Kite Company. His parish consists of 12 buildings and a gatehouse. laid out thus:

His orders are to inspect all 12 buildings during the night. He is to inspect each building the same number of times, beginning with No 1, keeping to the paths shown and ending up finally at the gatehouse. Having inspected a building, he must inspect at least one other (or the gatehouse, which he may inspect as often as he likes) before inspecting that building again. Each stretch of path is 100 yards long, except 1-6 and 1-11, which are 200 yards.

Old Charlie has a conscience and rheumatism so he carries out his orders faithfully but walks not one yard further than he need.

How far must he walk in the night?

This puzzle appears in the book Tantalizers (1970).

[tantalizer11]

## Tantalizer 10: The case of the mangled millionaire

From New Scientist #560, 31st August 1967 [link]

“An inelegant crime”, observed Holmes, surveying the wrecked library. The mangled body of Sir Plutus Gnome sprawled on the rug and beside it lay the hammer and sickle which had produced its present unpleasing condition. Pocketing his magnifying glass, Holmes turned to the five police inspectors.

“Well, gentlemen, what does the evidence tell us of the culprit?”

The first inspector cleared his throat: “We are looking”, he said, “for an unmarried right-handed woman who is shorter than the deceased.”

“No”, said the second, “for an ambidextrous married communist the same height as the deceased.”

“No”, declared the third, “for a married man who is an anti-communist and taller than the deceased.”

“No”, put in the fourth, “for an unmarried, left-handed, female communist.”

“I disagree”, remarked the fifth, “we want a right-handed man, taller than the deceased, who has no feelings about communism either for or against.”

Holmes gave them a glance both penetrating and scornful. “You have done very well, gentlemen” he pronounced. “Each of you is right in exactly two particulars. Now, it is clear that there are only four possible suspects; George Crabtree, the victim’s bachelor nephew, Miss Pringle, his secretary, Henry Hetherington, his accountant, or Henry’s wife, Mary. You will no doubt be able to determine which of the four perpetrated the deed.”

Who mangled the millionaire?

This puzzle appears in the book Tantalizers (1970) under the title “The Mangled Millionaire”.

[tantalizer10]

## Tantalizer 9: Digweed

From New Scientist #559, 24th August 1967 [link]

Now that our school has introduced the personalised time-table, it is no fun being a housemaster. Take Digweed, for instance.

He has two years to go before A-level and must take exactly three subjects in each year. He is to do Geography for at least one year and English for exactly one year. If he does English in the second he must take French in the second. If he does English in the first, he must take Geography in the first. If he does not do French in the second, he may not do Geography in the first.

If he does not do History in the first, he may not do Geography in the second. If he does not do French in the first, he is to do History in the second. His first year may not include both French and Geography; nor his second both French and History.

Digweed tells me with a smirk on his face that his time-table is impossible. But he has forgotten that I can force him to do Latin, if need be.

What subjects will he be doing in each year?

This puzzle does not appear in the book Tantalizers (1970), but a similar puzzle appeared as Enigma 260.

[tantalizer9]

## Tantalizer 8: The church afloat

From New Scientist #558, 17th August 1967 [link]

When the old destroyer, Fantastic, was turned into a floating missionary chapel, instead of being scrapped, the following worthies were present at her re-launching:

The Bishops of:

Armuth
Bangor
Cone

Sir Desmond Drake
Sir Evelyn Easy
Sir Francis Fish
Sir Gregory Grogg
Sir Harry Hornpipe.

Afterwards they repaired to the wardroom to drink the toast of “The Church Afloat”. It was no thimble-sized toast and presently the eight dignitaries were arm in arm on the deck and singing lustily. Everyone, I regret to report, was wearing someone else’s hat. This is what the bishops sang, each topped with a cockaded nautical tile:

Armuth:
My hat is on the head of a man,
whose hat is on Sir Desmond.
Bangor:
My hat is on the head of a man,
whose hat is on the head of a man,
whose hat is on Sir Evelyn.
Cone:
My hat is on the head of man,
whose hat is on the head of a man,
whose hat is on the head of a man,
whose hat is on Sir Francis.

Sir Harry Hornpipe, resplendent in episcopal mitre, then opened fire:

Hornpipe:
My hat is on the head of a man,
whose hat is on the head of a man,
whose hat is on the head of a man,
whose hat is on the head of a man,
whose hat I’m proudly wearing.

Luckily it started to rain at this point, before anything worse befell. It thus only remained to restore the hats to their rightful owners.

Who was wearing whose?

A variation on this puzzle appears in the book Tantalizers (1970) under the title “The Sailor’s Puzzle”.

[tantalizer8]

## Tantalizer 7b: Three men in a boat

From New Scientist #557, 10th August 1967 [link]

When George, Harris and I go on the river, we take it in turns to row, steer and cook. With George rowing and Harris steering the boat goes slower than with Harris rowing and me steering but faster than with me rowing and George steering.

We have found that the boat’s speed is a simple sum of a rowing element (in knots) and a steering element (in knots) and that each of us makes a measurable contribution at the oars or the helm. George is the best helm or the worst oar or both.

Each of us is the best of us in one department — I mean rowing, steering or cooking — and the worst in another.

Which of us is the best cook?

Both this puzzle and the one published the previous week were Tantalizer 7.

This puzzle appears in the book Tantalizers (1970).

[tantalizer7b] [tantalizer7]

## Tantalizer 7a: Professors in conflict

From New Scientist #556, 3rd August 1967 [link]

The courtyard at Jude’s College is paved with large regular hexagons (as shown).

Professor Xerxes is at present stationed on No. 1 and his old enemy, Professor Youthful, on No. 7. To settle their latest scholars’ feud, they have agreed to a contest under these terms:

1. They will take it in turns to move.
2. Each will move at any turn only to a hexagon he “commands”.
3. Each commands at any time all and only those hexagons which lie in a straight line across any side of the hexagon he is then standing on. (Thus X now commands 2, 3, 4, 12, 11, 10; but not 13, 15, 7).
4. Neither may move to or across any hexagon commanded by the other.
5. Whoever is first unable to move will be deemed the loser.

Xerxes has won the toss. Should he move first? If so, what is his winning strategy? If not, what is his winning strategy after Youthful’s move?

Both this puzzle and the one published the following week were Tantalizer 7.

In the book Tantalizers (1970) a modified version of this puzzle appears as “Battle of Minds”.

[tantalizer7a] [tantalizer7]

## Tantalizer 6: Pets

From New Scientist #555, 27th July 1967 [link]

Five old bachelors live together at Nag’s End, where they are thoroughly overrun by their pets. Each pet is a perfectly normal specimen of its kind. The pets have between them 10 heads and 30 legs. The only quadrupeds are cats or dogs and there are more dogs than cats. The two dog owners keep at least one cat each.

Arthur keeps a budgie but no dogs. Brian owns six legs (including his own two). Charlie and Dan keep the same number of pets and their pets have, collectively, the same number of legs. Edward has had some trouble in training his pets not to follow him upstairs at night.

Who keeps what?

In the book Tantalizers (1970) a reworded version of this puzzle appears.

[tantalizer6]

## Tantalizer 5: Afternoon sun

From New Scientist #554, 20th July 1967 [link]

George and Mabel, who live at one of the 24 towns shown on this map of the island of Angula, have been planning their summer motoring holiday.

George proposed that they should motor along every road shown once and once only. Mabel agreed this was a feasible plan but thought the town they would finish at was a horrible dump. She proposed instead that they should seek the afternoon sun, never motoring north, east or north-east. George agreed and they have also agreed upon their destination. They are now arguing which of the eight possible routes they will take to get there.

Where do they live and where will they be spending their holiday?

In the book Tantalizers (1970) a reworded version of this puzzle appears under the title: “The Beggerman’s puzzle”.

[tantalizer5]

## Tantalizer 4: In the arena

From New Scientist #553, 13th July 1967 [link]

One of the best loved sights of the Roman Arena was a duel to the death between a Gladiator and a Retiarius. The Gladiator, being in armour and carrying a sword, was slow in movement but lethal at close quarters. The Retiarius, having no armour but carrying a net and trident, was most deadly at a distance.

Those who wish to test where the odds lay for themselves will, in these softer days, have to make do with a diagram.

Let us suppose that Gladiator starts at 32 and Retiarius at 1 and that they move in turn. Gladiator moves three circles at each turn and Retiarius four. Both must always move along the lines but can change direction or double back during their move. The duel is won by whoever first lands on top of his opponent at the end of a turn.

Can either player be sure of winning? If so, who?

In the book Tantalizers (1970) a reworded version of this puzzle appears under the title: “The Lion and The Unicorn”.

[tantalizer4]

## Tantalizer 3: Café de Gaulle

From New Scientist #552, 6th July 1967 [link]

My friend Jones has food poisoning, which serves him right. Last night he thought he would impress two girls by taking them to dinner at the newly opened Café de Gaulle. Since the girls have survived the ordeal, we may assume that the trouble lay in a dish which Jones ate and they did not.

Potage Tiede … 1s
Haricots sur Toast … 2s
Coctaile de Crevettes … 3s

Bulle et Couic … 4s
Crapeau dans le Trou … 5s
Trotteurs de Cochon … 6s

Fromage Souriciere … 2s
Morceau Singulier Gallois … 3s
Becasse Ecossaise … 4s

Jones tells me that each of them ate one item from each course and that, not counting tips etc., he paid eight shillings for himself, nine shillings for Polly and 10s for Gladys. No dish eaten by Polly was also eaten by Gladys.

He was in fact able to recall what the girls had eaten and so even though he had forgotten what he ate himself, we could deduce what had poisoned him. The offending dish can, however, be deduced merely from the information given so far plus the information that someone had Becasse Ecossaise.

Which is it?

In the book Tantalizers (1970) a reworded version of this puzzle appears under the title: “Café des Gourmets”.

[tantalizer3]

## Tantalizer 2: A chess puzzle

From New Scientist #551, 29th June 1967 [link]

Frank French, our local chess secretary, was writing out the results of our all-against-all tournament, when in popped Barbara Bocardo, the well-known logician.

“What gives?”, she asked, pouncing on the score sheet, which looked like this:

“The half points are draws”, he explained. “I’ve filled in all there were and next I shall record the 1’s (wins) and 0’s (losses)”.

“Don’t do that. Let me guess. How did you do yourself?”

“Well, I drew in four of the five rounds, as you see. But alas, I finally shared bottom place with Alapin, my opponent in the first round.”

“A lot of draws, surely?”

“Yes. At least one in every round. Each of us drew in at least two consecutive rounds.”

“Did the winners (I see there must have been two of them), meet in the second round?”

“No”.

“Good. It is now possible to deduce whom they played in the last round.”

Can you perform this logical feat?

[tantalizer2]

## Tantalizer 1: Publish or perish

From New Scientist #550, 22nd June 1967 [link]

Kappa, Lambda, Mu and Omicron are at present uneasily seated in the Warden’s study at Jude’s College, awaiting summonses from the committee which will appoint one of them to the vacant Fellowship in Greek Literature. Each is hugging his only published work and each suspects that the post will go to the author of the longest, irrespective of all possible merit.

From their stilted but cunning conversation, the following facts have so far emerged:

Each book has a whole number of pages over 100.

Only Lambda’s book and Mu’s book have the same number of pages.

The total number of pages in all four books is 500.

Mu then asked Omicron whether the number of his (Omicron’s) pages was a perfect square. From Omicron’s answer Mu and Kappa made silent and independent deductions with impeccable logic. Mu deduced that Omicron’s book was the longest. And Kappa, who was not a perfect square, deduced that Omicron’s answer was not the truth.

How many pages are there in each man’s book?

This was the first Tantalizer puzzle published in New Scientist. It was accompanied by the following introduction:

This is the first of a series of logical puzzles compiled by Martin Hollis. No mathematical knowledge is required for their solution. A new puzzle will appear each week, and the answer will be printed in the following week’s issue.

[tantalizer1]

## Tantalizer 313: La Dolce Vita

Seven couples rented a villa for the week in Majorca. They arrived on a Monday and dived beneath the sheets. They didn’t see much of the ocean but devoted a fabulous week to musical beds instead.

Partners were changed daily. Angela, for instance, spent Monday with Tommy, Tuesday with Upton, Wednesday with Vaughan, and Thursday with William.

Barbara kicked off with Xerxes followed by Yvan, Upton, and Zeno in that order. Cutie partnered with Tommy on Wednesday, Xerxes on Thursday, and William on Friday.

Delia spent Monday with Vaughan, Wednesday with William, Friday with Xerxes, and Saturday with Yvan. Yvan devoted Thursday to Esther and Monday to Fiona, whose partner on Thursday was Upton. Esther and Xerxes spent Saturday together, as did Fiona and Tommy. Esther and William made their whoopee on Monday.

These facts are kindly supplied by Gillian, who adds demurely that Sunday’s pairs were all decently married to one another. This was not only proper but also necessary for all possible mixed pairs to have had a day’s delight by the end of the holiday.

Who is married to whom?

[tantalizer313]

From New Scientist #863, 13th September 1973 [link]

Old George was recalling the long defunct West Wessex Railway in the snug at the Railway Arms the other night. There were nine stations – Axle, Bundle, Cordwain, Dawdle, Egdon, Foxfair, Gudgeon, Hangover and Inkwell – all exactly one mile apart in alphabetical order in a straight line.

George was the ticket inspector and took his duties seriously. He used to board the early train at Hangover and thereafter alight at a station every so often and wait for another train from there. It was a long, grimy day, since, of each pair of stations more than two miles apart, he boarded a train at one and got off it at the other. Each of these pairs, however, were only so used once during the day and only in one direction. Nevertheless he was glad to step out of the final station and into the snug of the Railway Arms.

Where is the Railway Arms?

[tantalizer312]

## Tantalizer 311: Mind and body

From New Scientist #862, 6th September 1973 [link]

To keep fit the monks and novices of the monastery of St Tantalus play a vicious game in the cloisters called Guide the Missal. The rules are simple – mainly a matter of each side trying to stuff a missal by fair means or foul through a porticulum at the opponent’s end. But it is exercise almost as tough as the spiritual kind, as the winners are the first to score 21 goals.

By tradition it is monks versus novices. The novices play from the Refectory end and the monks from the Miserere end. But it has recently been proved that it is three times as easy to score from the Refectory end and a custom has grown up of changing ends at the halfway stage. To be precise the change over occurs when the novices have scored 11 goals. Eleven being more than half 21, the monks are wont to regard this as an indulgence to the still soft novices. And it is certainly true that the monks usually win.

You may well wonder why. Is it that extra prayer has toughened the monks? Or does the new custom need changing and, if so, by how much?

[tantalizer311]

## Tantalizer 310: Miss Prism

From New Scientist #861, 30th August 1973 [link]

Miss Prism, being duly sworn, was asked for her age but remained mulishly silent.

“Come, come, my good woman”, snapped the judge, “you must answer the court’s questions”.

Counsel intervened smoothly. “I understand, M’Lud, that she is certainly over 40 and under 50, if it pleases you, M’Lud”.

“It does not please me, Sir Ambrose; I am thinking of having her committed”.

This threat overcame some of Miss Prisms reticence and she hastily deposed as follows: “When I stop speaking, I shall have made exactly two true statements. My age is divisible by 2. It is a perfect square. It is not 42. It is a prime number. It is divisible by three”. At this point she stopped speaking.

“Perjury, I fancy”, sniffed the judge.

“With respect, M’Lud, I fancy she has answered the question, if Your Lordship will attend carefully to the various possibilities”.

[tantalizer310]

## Tantalizer 309: Mystery tour

From New Scientist #860, 23rd August 1973 [link]

If you ever visit Ratselheim, you will no doubt want to see the Stephankirche and the Volksmuseum. Moreover you may be tempted to travel from one to the other by subway. Don’t!

The map shows all lines and stations, each stretch of clear line being 1 km. But not every train stops at every station it passes through. So, by a triumph of absurdity, the distance between Stephanskirche and Volksmuseum by subway is a preposterous 16 km, involving several changes of train but never taking you over the same stretch of line twice.

Whereas if you walk it, the direct distance is … well, how far?

[tantalizer309]

## Tantalizer 308: From the horses’ mouths

From New Scientist #859, 16th August 1973 [link]

Wanting a sure thing for the 2:30, I nipped around to the paddock to ask the only three horses running. “Psst!” I hissed, “what gives?”

Lightning laughed. “Merryman is an ant”, he said. “Ninepin is a bee”.

Merryman snorted. “The ant will not win”, he said. “It is going to rain”.

Ninepins snickered. “Lightning is a crow”, he said. “Lightning will beat Merryman”.

You will find this all a bit foxing, unless you know that “ant” is horse-talk for an invariable liar, “bee” for a horse invariably truthful and “crow” for one who alternates between true and false (or false and true). The three horses included one of each.

How did they finish?

[tantalizer308]