# Enigmatic Code

Programming Enigma Puzzles

## Tantalizer 412: Consider your verdict

From New Scientist #962, 14th August 1975 [link]

While waiting for the judge to settle his wig, sharpen his quill and pump up his cushion, each member of the jury wondered how the 11 others would vote when it came to the point. Here are their predictions in alphabetical order:

Juror A thought all the others would favour acquittal.

Juror B thought all the others would be for convicting.

Juror C thought exactly one of the others would want to convict.

Juror D thought exactly one of the others would want to acquit.

Juror E thought exactly 10 of the others would want to convict.

Juror F thought exactly 3 of the others would want to acquit.

Juror G thought exactly 8 of the others would want to convict.

Juror H thought exactly 7 of the others would want to acquit.

Juror I thought exactly 4 of the others would want to convict.

Juror J thought exactly 8 of the others would want to convict.

Juror K thought exactly 3 of the others would want to acquit.

Juror L thought exactly 9 of the others would want to convict.

In the event all those whose predictions were incorrect voted for one verdict, whereas those (if any) whose predictions were correct voted for the other.

Which jurors favoured acquittal?

A correction (applied to the text above) was published with Tantalizer 416.

[tantalizer412]

### One response to “Tantalizer 412: Consider your verdict”

1. Jim Randell 12 February 2020 at 7:31 am

This Python considers the possible votes, and then looks for cases where all those that made correct predictions voted one way, and all those that made incorrect predictions voted the other way.

It runs in 123ms.

Run: [ @repl.it ]

```from enigma import subsets, join, printf

# consider actual votes (to acquit or convict)
for vs in subsets("ac", size=12, select="M"):

# count the number of a's and c's
(na, nc) = (vs.count(x) for x in "ac")

# calculate correct/incorrect predictions
(A, B, C, D, E, F, G, H, I, J, K, L) = vs

ts = (
# A: "all the others (i.e. 11) vote to acquit"
na - (A == 'a') == 11,
# B: "all the others (i.e. 11) vote to convict"
nc - (B == 'c') == 11,
# C: "exactly one of the others vote to convict"
nc - (C == 'c') == 1,
# D: "exactly one of the others vote to acquit"
na - (D == 'a') == 1,
# E: "exactly 10 of the others vote to convict"
nc - (E == 'c') == 10,
# F: "exactly 3 of the others vote to acquit"
na - (F == 'a') == 3,
# G: "exactly 8 of the others vote to convict"
nc - (G == 'c') == 8,
# H: "exactly 7 of the others vote to acquit"
na - (H == 'a') == 7,
# I: "exactly 4 of the others vote to convict"
nc - (I == 'c') == 4,
# J: "exactly 8 of the others vote to convict"
nc - (J == 'c') == 8,
# K: "exactly 3 of the others vote to acquit"
na - (K == 'a') == 3,
# L: "exactly 9 of the others vote to convict"
nc - (L == 'c') == 9,
)

# collect the true and false predictions by votes
(Ts, Fs) = (set(), set())
for (t, v) in zip(ts, vs):

# find cases where true predictions vote one way and false predictions the other
if len(Ts) == 1 and len(Fs) == 1 and Ts != Fs:
# output solution
votes = lambda x: join((k for (k, v) in zip("ABCDEFGHIJKL", vs) if v == x), sep=" ")
printf("acquit = {As}; convict = {Cs}; true = {t}; false = {f}", As=votes('a'), Cs=votes('c'), t=Ts.pop(), f=Fs.pop())
```

Solution: F, G, J, K voted to acquit.

A, B, C, D, E, H, I, L voted to convict.

Those that voted to acquit made correct predictions. Those that voted to convict made incorrect predictions.

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