Enigmatic Code

Programming Enigma Puzzles

Tantalizer 401: The way of all flesh

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.


One response to “Tantalizer 401: The way of all flesh

  1. Jim Randell 27 May 2020 at 10:07 am

    Initially there are 10n men in the queue, so 1 ≤ n < 10.

    After one tenth of the queue were admitted, there were 9n remaining. Then one ninth of the remaining queue were admitted, leaving 8n. Then one eighth of the remaining queue were admitted, leaving 7n in the queue. At each stage n men are admitted.

    So the statements made are:

    1st: n = 4
    2nd: n = 8
    3rd: n = 2
    4th: n = 4

    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 n is 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 for n.

    So n must 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 ]

    from enigma import irange, printf
    # consider values for n
    for n in irange(1, 9):
      # indices of the participants questioned
      qs = list(irange(0, 3 * n, step=n))
      # consider index parities for truthers/liars
      for ps in [(0, 1), (1, 0)]:
        # verify all the statements
        if not all((n == k) == ps[i % 2] for (i, k) in zip(qs, [4, 8, 2, 4])): continue
        # output solution
        printf("n={n} [ps={ps}]")

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: