Enigmatic Code

Programming Enigma Puzzles

Enigma 194: The plot thickens

From New Scientist #1340, 13th January 1983 [link]

“So what did you think of that?” smiled George, pulling on his coat as the titles drifted up the screen.

“I don’t know,” said Edith, still sitting with a dazed expression. “These modern films do get so involved.”

“How do you mean?”

“Well, for example, I still don’t know why they had to strangle that world famous neurosurgeon while he was in the shower.”

“That was because of the conversation he had with Boris and the heroine’s solicitor when they were flying in that damaged jet.”

“Boris was the blond chap who later watched in horror as that psychopathic psychiatrist fellow took the fatal plunge from the multi-story inferno …”

“No, no, that was Charlie.”

“So who was the bald one who was running away from that UFO thingy?”

“Oh, he was the one who was savaged by the giant shark after falling out of the boat.”

“And that was Derek, wasn’t it?”

“Wrong again, love. Derek was the man from the CIA who was peering through the eyes of that Rembrandt when somebody stabbed the chap who was mistaken for the solicitor.”

“That means,” said Edith thinking hard, “that the one who lived happily ever after must have been Alvin, the drug-smuggling baseball player.”

“My love, you’re getting very confused. Remember, Alvin snuffed it shortly after the visit from Charlie’s widow.” There was a brief silence. “So … how did Eric fit into all this?”

Since Eric was one of only five men being described in the conversation, I’m sure you can answer that, and also work out the sequence in which the characters met their fates!

[enigma194]

Advertisements

2 responses to “Enigma 194: The plot thickens

  1. Jim Randell 26 May 2014 at 7:39 am

    I think this puzzle is flawed, in that the information given is not sufficient to arrive at a unique answer.

    Here’s a Python program that narrows down the possibilities. It runs in 34ms.

    # the information we have is:
    #
    # 1. The neurosurgeon was strangled [in the shower]
    # 2. The neurosurgeon is not Boris
    # 3. Boris is not the solicitor
    # 4. Charlie is not bald
    # 5. Charlie is not the psychiatrist
    # 6. The psychiatrist fell [from a burning building]
    # 7. The psychiatrist died before Charlie.
    # 8. A bald man was savaged [by a shark] [so from 4 it's not Charlie]
    # 9. Derek is the CIA agent
    # 10. Derek was not savaged
    # 11. Derek was not stabbed
    # 12. Whoever was stabbed died before Derek
    # 13. The solicitor was not stabbed
    # 14. Alvin is the baseball player
    # 15. Alvin died
    # 16. Charlie died before Alvin
    
    from itertools import product, permutations
    from enigma import irange, printf
    
    # names (used to index the arrays)
    (A, B, C, D, E) = irange(0, 4)
    
    # order of death (5 survives)
    orders = list(irange(1, 5))
    
    # method of death
    methods = ('strangled', 'fell', 'savaged', 'stabbed', 'survived')
    
    # occupations
    jobs = ('neurosurgeon', 'solicitor', 'psychiatrist', 'CIA agent', 'baseball player')
    
    # possible jobs permutations
    for job in permutations(jobs):
    
      # [3] B is not the solicitor
      if job[B] == 'solicitor': continue
    
      # [14] A is the baseball player
      if job[A] != 'baseball player': continue
    
      # then choose an assignment for the methods of death
      for method in permutations(methods):
    
        # [4][8] C was not savaged
        # [10] D was not savaged
        if method[C] == 'savaged': continue
        if method[D] == 'savaged': continue
    
        # [15] A did not survive
        if method[A] == 'survived': continue
    
        # [1] the neurosurgeon was strangled, [2] and he was not B
        strangled = method.index('strangled')
        if strangled == B or job[strangled] != 'neurosurgeon': continue
    
        # [6] the psychiatrist fell, [5] and he was not C
        psychiatrist = job.index('psychiatrist')
        if method[psychiatrist] != 'fell': continue
    
        # [13] the solicitor wasn't stabbed
        stabbed = method.index('stabbed')
        if job[stabbed] == 'solicitor': continue
    
        # finally choose an ordering
        for order in permutations(orders):
    
          # the final character survives
          survived = method.index('survived')
          if order[survived] != 5: continue
    
          # [7] the psychiatrist died before C
          if not(order[psychiatrist] < order[C]): continue
    
          # [9] D is the CIA agent, [11] and he was not stabbed
          if job[D] != 'CIA agent' or method[D] == 'stabbed': continue
    
          # [12] whoever was stabbed died before D
          if not(order[stabbed] < order[D]): continue
    
          # [16] A was visited by C's widow
          if not(order[C] < order[A]): continue
    
          ## [??] E was alive when A was killed
          #if not(order[A] < order[E]): continue
    
          for (i, p) in sorted(enumerate(order), key=lambda x: x[1]):
            printf("{p}. {n}: {j} {m}", n='ABCDE'[i], j=job[i], m=method[i])
          printf('')
    

    I can derive information about each of the characters:

    Alvin is the drug-smuggling baseball player, who is stabbed (in mistake for Eric, the solicitor).
    Boris is the psychopathic psychiatrist, who fell to his death from the multi-story inferno.
    Charlie is the world famous blond neurosurgeon, who was strangled in the shower.
    Derek is the CIA agent, who survives.
    Eric is the bald solicitor, who was savaged by a shark after falling out of a boat.

    And a partial order for the deaths.

    Boris died before Charlie, and Charlie died before Alvin. Derek is the sole survivor at the end of the film.

    But I can’t see how to place the death of Eric in the timeline. The only possibility I can see is that we take the fact that Alvin was killed in mistake for Eric to mean that Eric was still alive at the time Alvin was killed and thus the order of the deaths is:

    Boris, Charlie, Alvin, Eric. With Derek surviving.

    And this is, in fact, the published answer:

    Solution: Eric is the bald solicitor who was savaged by a shark after falling from the boat. The order of deaths is: Boris, then Charlie, then Alvin, then Eric. (Derek survives).

    This condition can be added to the above program by including the code commented out at line 87, and then a single solution is produced.

    I think it would have been better to say something like: “Derek was the man from the CIA who was peering through the eyes of that Rembrandt when the solicitor stabbed someone”. That would have given us the required facts unambiguously (D is the CIA agent. Neither D nor the solicitor were stabbed. Both D and the solicitor were alive at the time of the stabbing).

    Also, I’m slightly worried about the “later” that appears in the sentence: “Boris was the blond chap who later watched in horror as that psychopathic psychiatrist fellow took the fatal plunge from the multi-story inferno …”. As that could be taken to imply that the fall took place after the strangling, but the information we are given requires that the fall occurs before the strangling. (In fact the fall is the earliest of the deaths we can order).

    • Jim Olson 27 May 2014 at 4:04 am

      When I did this enigma I thought it was rather straightforward and arrived at the ” published solution” without any trouble. I interpreted the information that the wrong man had been snuffed out in the mistaken belief that he was the solicitor meant that the solicitor was still alive and therefore Eric was the last man killed.
      Thanks for pointing out the danger in so blithely making assumptions that may not be accurate.

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: