Brain-Teaser 486: [Counting cards]
From The Sunday Times, 20th September 1970 [link]
So as to encourage my four children to practise their arithmetic I have invented a game played with a standard pack of playing-cards. For scoring purposes an Ace counts as 1; Jack, Queen and King as 11, 12 and 13 respectively; and each other card by its numerical value.
To make matters a little complicated, I decided that Hearts should count at face value, Clubs at double value, Diamonds at triple value, and Spades at quadruple value. Before each deal, one card is extract from the pack, and a Joker, valued at 50 points, is substituted.
The cards are then dealt in the normal manner, and each child then counts up the points value of his or her hand. There is a small reward for the child who most rapidly correctly counts up his points, but the winner is the child with the highest total.
At the conclusion of one such game, each of the totals was an exact multiple of 7, and the winner, Bert, had scored 42 more than Amy, who had beaten Don by 35. Poor Clara came last with 14 points fewer than Don.
Which card had been replaced by the Joker?
This puzzle was originally published with no title.
[teaser486]
Jim Randell 9:01 am on 14 July 2019 Permalink |
The scores in order from lowest to highest are:
So the total number of points is:
and C must be divisible by 7.
This program creates a set of cards, and then looks at replacing one of the cards with a Joker (value 50), to find possible values for C (and hence A, B, D).
It runs in 79ms.
Run: [ @repl.it ]
from enigma import irange, update, div, printf # multipliers mul = dict(H=1, C=2, D=3, S=4) # map each card to the corresponding score score = dict() for v in irange(1, 13): score.update(((v, k), m * v) for (k, m) in mul.items()) # one card is replaced with a 50 for k in score.keys(): s = update(score, [(k, 50)]) # total number of points t = sum(s.values()) # score for C (= 7x) x = div(t - 154, 28) if x is None: continue # calculate the scores C = 7 * x (B, A, D) = (C + 91, C + 49, C + 14) printf("k={k} t={t}, A={A} B={B} C={C} D={D}")Solution: The card replaced by the Joker is the Jack of Clubs.
This is the only card which gives a viable value for C.
The scores are: B = 287; A = 245; D = 210; C = 196 (being 41×; 35×; 30×; 28× 7).
We can get the program to additionally look for a way of dealing the cards that achieves the required scores. Fortunately there are many ways of dealing the cards. Here is one of them:
A = 5♠ + 6♥ + 6♣ + 6♦ + 7♥ + 7♣ + 7♦ + 7♠ + 8♥ + 8♣ + 8♠ + X♦ + J♦ = 20 + 6 + 12 + 18 + 7 + 14 + 21 + 28 + 8 + 16 + 32 + 30 + 33 = 245 B = 8♦ + 9♥ + 9♣ + X♥ + X♣ + X♠ + J♥ + J♠ + Q♥ + Q♣ + Q♦ + K♥ + K♣ = 24 + 9 + 18 + 10 + 20 + 40 + 11 + 44 + 12 + 24 + 36 + 13 + 26 = 287 C = A♥ + A♣ + A♦ + A♠ + 2♥ + 2♣ + 2♦ + 2♠ + 3♥ + 6♠ + Q♠ + K♦ + K♠ = 1 + 2 + 3 + 4 + 2 + 4 + 6 + 8 + 3 + 24 + 48 + 39 + 52 = 196 D = 3♣ + 3♦ + 3♠ + 4♥ + 4♣ + 4♦ + 4♠ + 5♥ + 5♣ + 5♦ + 9♦ + 9♠ + JK 6 + 9 + 12 + 4 + 8 + 12 + 16 + 5 + 10 + 15 + 27 + 36 + 50 = 210LikeLike