Enigmatic Code

Programming Enigma Puzzles

Tantalizer 477: Precognition

From New Scientist #1028, 25th November 1976 [link]

I overheard Professor Foresight discussing the results of a small precognition test the other day. It emerged that he had tossed a penny five times, inviting the thirteen members of his class to write down what was coming before each throw. Six students had done better than the rest, all scoring the same number, although no two had produced identical lists of guesses. Nor had any two of the remaining students produced identical lists.

It also emerged that the penny had not come up Heads all five times. Nor was the actual series Head, Tail, Tail, Tail, Head. Nor was it Tail, Tail, Head, Tail, Tail. At this point the discussion broke up and I was left wondering just what the actual series was. Given that each of these series just mentioned was the guess of one of the unsuccessful seven, can you oblige?



2 responses to “Tantalizer 477: Precognition

  1. Jim Randell 5 July 2017 at 9:47 am

    Six students scored better than the remaining seven, and they all had different sequences of guesses.

    There’s only one way to get all 5 outcomes wrong (or right, C(5, 0) = C(5, 5) = 1), and only 5 ways to get exactly one outcome wrong (or right, C(5, 1) = C(5, 4) = 5).

    So it follows that six of the students got 3 right (C(5, 2) = C(5, 3) = 10) and seven of them got at most 2 right (at least 3 wrong).

    This Python program runs in 43ms.

    from itertools import product
    from enigma import printf
    # sequences mentioned
    seqs = ( 'HHHHH', 'HTTTH', 'TTHTT' )
    # count the matches in two sequences
    def match(s1, s2):
      return sum(a == b for (a, b) in zip(s1, s2))
    # choose the sequence
    for s in product('HT', repeat=5):
      # each of the mentioned sequences scores less than 3
      if all(match(s, x) < 3 for x in seqs):
        printf("seq = {s}")

    Solution: The sequence is: Tails, Heads, Tails, Heads, Tails.

  2. Hugh Casement 5 July 2017 at 12:47 pm

    I did a trial with random numbers and reckoned to find that there’s only about a 1-in-2400 probability of this result occurring by chance: six with three right, the other seven with fewer, and no two with the same sequence.  Can that be so, or did I make a mistake in the calculation?

    Either way, I don’t believe it shows students are good at predicting the future.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: