### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,393)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (61)
- site news (62)
- tantalizer (105)
- teaser (7)
- today (1)

### Site Stats

- 244,211 hits

Programming Enigma Puzzles

27 May 2020

Posted by on **From New Scientist #951, 29th May 1975** [link]

Professor Pfiffelsammler has been looking into the motivation of cinemagoers. Recently he accosted a line of middle-aged men waiting patiently in the rain to get into “The Way of All Flesh”. The man at the head of the queue said: “There are 39 men behind me. The man at the rear is only here for the smut”. Each other man said: “I am here for the sake of the film’s aesthetic merits. The man in front of me is only here for the smut”.

One tenth of the queue having been admitted, the new front man declared: “There are 71 men behind me”. One ninth of those still waiting were then let in and the new front man said: “There are 15 men behind me”. One eighth of those still waiting were then admitted and the new front man asserted: “There are 27 men behind me”. There were less than 100 men in the queue at the start of the investigation and no one had joined or left (except those admitted into the cinema). Naturally, all and only those there for the aesthetics had spoken the truth. No one, of course, came both for the aesthetics and the smut.

Exactly how man men were there in the queue originally?

There are now 100 *Tantalizer* puzzles on the site. This means there is a complete archive of *New Scientist* puzzles from May 1975 – February 1990 and from December 1997 – December 2013, giving a total of about 1569 puzzles on the site. There are 414 *Enigma* puzzles remaining to fill in the gap from 1990 – 1997, and there are about 220 remaining *Tantalizer* puzzles in the *Google Books* archive.

[tantalizer401]

%d bloggers like this:

Initially there are

10nmen in the queue, so1 ≤ n < 10.After one tenth of the queue were admitted, there were

9nremaining. Then one ninth of the remaining queue were admitted, leaving8n. Then one eighth of the remaining queue were admitted, leaving7nin the queue. At each stagenmen are admitted.So the statements made are:

Each man also claims the one in front of him (or at the very end for the first man in the queue) is a liar. So the queue must be composed of alternating truthers and liars.

If

nis odd, then the characteristic of the men questioned at the head of the queue must also alternate, so the statements are either T, F, T, F or F, T, F, T. But neither of these possibilities gives a consistent value forn.So

nmust be even, and the men questioned all have the same characteristic. So the statements are either T, T, T, T (not possible) or F, F, F, F.This leaves 6 as the only possible value for

n.Solution:There were 60 men in the queue originally.And the 1st, 3rd, 5th, … men in the original queue must be liars, and the 2nd, 4th, 6th, … must tell the truth.

Here’s a short program that follows the same steps:

Run:[ @repl.it ]