Of the 715 possible hands, only four have a score equal to the total of the face falues:
hand score
1 1 1 3 6
1 2 2 3 8
3 3 3 3 12
5 5 5 5 20
The hand with all threes cannot be one of the original hands, as at least one of the other two would have to be one containing an additional three, and there aren't five threes in the deck. So the hands are the first, second and last of the four hands listed above, which means there are four 1's, two 2's, two 3's and four 5's for the reshuffle.
The hands consisting of 1's, 2's, 3's and 5's, in which the total of the face values is a multiple (greater than 1) of the score are:
hand face tot. score
1 1 3 3 8 4
1 1 3 5 10 2
1 1 5 5 12 4
1 2 2 5 10 2
1 3 3 5 12 2
1 3 5 5 14 2
1 5 5 5 16 8
2 2 3 5 12 2
3 3 5 5 16 4
Of these, a set of three needs to be made containing four 1's, two 2's, two 3's and four 5's, in which each score is different. There are only three possible scores: 2, 4 and 8, and only one hand has the 8, so that must be one of them. This uses up three 5's, so only one more 5 is allowable, so one of the hands must lack a 5 altogether: that's the first one, with a score of 4. The remaining hand must have a score of 2 and consist of the remaining numbers: 1, 2, 2, 5.
So the set is:
hand score
1 1 3 3 4
1 2 2 5 2
1 5 5 5 8
DECLARE FUNCTION score! (a!, b!, c!, d!)
CLS
' First step's table
FOR a = 1 TO 10
FOR b = a TO 10
FOR c = b TO 10
FOR d = c TO 10
handCt = handCt + 1
IF score(a, b, c, d) = a + b + c + d THEN
hitCt = hitCt + 1
PRINT a; b; c; d, a + b + c + d
END IF
NEXT
NEXT
NEXT
NEXT
PRINT handCt, hitCt
' Second step's table
handCt = 0: hitCt = 0
FOR a = 1 TO 5
FOR b = a TO 5
FOR c = b TO 5
FOR d = c TO 5
IF a <> 4 AND b <> 4 AND c <> 4 AND d <> 4 THEN
handCt = handCt + 1
IF score(a, b, c, d) > 0 THEN
f = (a + b + c + d) / score(a, b, c, d)
IF f = INT(f) AND f > 1 THEN
hitCt = hitCt + 1
PRINT a; b; c; d; TAB(20); a + b + c + d, score(a, b, c, d)
num(hitCt, 1) = a
num(hitCt, 2) = b
num(hitCt, 3) = c
num(hitCt, 4) = d
sc(hitCt) = score(a, b, c, d)
END IF
END IF
END IF
NEXT
NEXT
NEXT
NEXT
PRINT handCt, hitCt
'Solution table
FOR i = 1 TO hitCt - 2
FOR j = i + 1 TO hitCt - 1
FOR k = j + 1 TO hitCt
REDIM nCt(5)
FOR l = 1 TO 4
nCt(num(i, l)) = nCt(num(i, l)) + 1
nCt(num(j, l)) = nCt(num(j, l)) + 1
nCt(num(k, l)) = nCt(num(k, l)) + 1
NEXT
IF nCt(1) = 4 AND nCt(2) = 2 AND nCt(3) = 2 AND nCt(5) = 4 THEN
IF sc(i) <> sc(j) AND sc(j) <> sc(k) AND sc(i) <> sc(k) THEN
FOR l = 1 TO 4
PRINT num(i, l);
NEXT
PRINT , sc(i)
FOR l = 1 TO 4
PRINT num(j, l);
NEXT
PRINT , sc(j)
FOR l = 1 TO 4
PRINT num(k, l);
NEXT
PRINT , sc(k)
PRINT
END IF
END IF
NEXT
NEXT
NEXT
FUNCTION score (a, b, c, d)
' requires a,b,c,d be in ascending sequence
IF b = a + 1 AND c = b + 1 AND d = c + 1 THEN
s = 4
ELSE
s = 0
IF b = a + 1 AND c = b + 1 OR c = b + 1 AND d = c + 1 THEN s = 3
IF c = a + 1 AND d = c + 1 THEN s = s + 3
IF b = a + 1 AND d = b + 1 THEN s = s + 3
END IF
IF a = b THEN s = s + 2
IF a = c THEN s = s + 2
IF a = d THEN s = s + 2
IF b = c THEN s = s + 2
IF b = d THEN s = s + 2
IF c = d THEN s = s + 2
IF a + b + c + d = 15 THEN s = s + 2
IF a + b + c = 15 THEN s = s + 2
IF a + b + d = 15 THEN s = s + 2
IF a + c + d = 15 THEN s = s + 2
IF b + c + d = 15 THEN s = s + 2
IF a + b = 15 THEN s = s + 2
IF a + c = 15 THEN s = s + 2
IF a + d = 15 THEN s = s + 2
IF b + c = 15 THEN s = s + 2
IF b + d = 15 THEN s = s + 2
IF c + d = 15 THEN s = s + 2
score = s
END FUNCTION
Cribbed from Enigma No. 1433, by Susan Denham, New Scientist 10 March 2007.
|