Brain-Teaser 687: Fair deal
From The Sunday Times, 15th September 1974 [link]
From a normal pack of playing cards, Bill, George, Harry and Joe were each dealt an Ace, a King, a Queen, a Jack and a ten.
Harry’s five cards were in three different suits and consisted of three red and two black cards.
Joe’s five cards were also in three different suits, his Ace being in the same suit as his Queen, and his King in the same suit as his Jack.
George held more than one black card.
Bill’s five cards were all in the same suit.
Harry held the King of spades, and Joe the ten of diamonds.
What were the cards in George’s hand?
This puzzle is included in the book The Sunday Times Book of Brain-Teasers: Book 2 (1981). The puzzle text above is taken from the book.
[teaser687]










Jim Randell 9:45 am on 12 April 2022 Permalink |
I used the [[
SubstitutedExpression]] solver from the enigma.py library to fill out the suits of the cards.Here is the run file:
#! python3 -m enigma -rr # assign values 0-3 (S=0; C=1; H=2; D=3) to: # # A K Q J X # B: a b c d e # G: f g h i j # H: k m n p q # J: r s t u v SubstitutedExpression --base=4 --distinct="afkr,bgms,chnt,dipu,ejqv" # red cards and black cards --code="red = lambda x: x > 1" --code="black = lambda x: x < 2" # H's cards were in 3 different suits "len({{k}, {m}, {n}, {p}, {q}}) == 3" # 3 red [and 2 black] "icount([{k}, {m}, {n}, {p}, {q}], red) == 3" # J's cards were in 3 different suits "len({{r}, {s}, {t}, {u}, {v}}) == 3" # suit of A is the same as Q "{r} = {t}" # suit of K is the same as J "{s} = {u}" # G has more than 1 black card "icount([{f}, {g}, {h}, {i}, {j}], black) > 1" # B's cards are in the same suit "{a} = {b}" "{b} = {c}" "{c} = {d}" "{d} = {e}" # H held KS (i.e. m = S = 0) --assign="m,0" # J held XD (i.e. v = D = 3) --assign="v,3"And then I wrote a short Python program to output the hands dealt.
The whole thing runs in 64ms.
Run: [ @replit ]
from enigma import (SubstitutedExpression, join, printf) # load the run-file p = SubstitutedExpression.from_file("teaser687.run") # solve the puzzle for s in p.solve(verbose=0): # output hands printf(" A K Q J X") hand = lambda xs: join(("SCHD"[s[x]] for x in xs), sep=" ") printf("B: {h}", h=hand("abcde")) printf("G: {h}", h=hand("fghij")) printf("H: {h}", h=hand("kmnpq")) printf("J: {h}", h=hand("rstuv")) printf()Solution: George held: A♣, K♦, Q♣, J♠, 10♠.
The complete set of hands is fully determined:
LikeLike