All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Cribbed Idea (Posted on 2007-04-15) Difficulty: 3 of 5
Three people play a simplified form of cribbage. The picture cards have been discarded, leaving 40 cards in the deck, with the aces counting as 1's.

Each of the three players is dealt 4 cards. The scoring is as follows:

  • Each pair of identical numbers scores 2 points. A given card can be part of more than one such pair. That is, three identical numbers count as three pairs (C(3,2)) and four identical count as six pairs (C(4,2)).
  • Each group of cards adding to 15 scores 2 points. Again, a given card can be part of more than one such group, as well as part of one or more pairs.
  • If all four cards are consecutive numbers, that counts for four points. Again, this doesn't preclude cards also contributing to a total of 15.
  • If any set of three of the cards are consecutive numbers, but not part of a sequence of four, 3 points are added to the score. Again, a given card can be part of more than one such sequence.

As an example, a hand consisting of 3, 4, 5 and 5 would score 8 points, as each of the 3 and the 4 take part in two sets of 3,4,5, and there is one pair.

Another example: a hand consisting of 7, 8, 8 and 8 would score 12 points (six points for the three pairs, and 6 points the three 7+8=15 totals).

In one of the deals, each of the three players had a different score, each equal to the total of the face values of the cards in that hand.

Then just the 12 cards that made up those three hands were reshuffled and dealt to the three players again. This time, the three scores all differed from one another, but for each hand the sum of the face values was a multiple (larger than 1) of that hand's score.

What were the three hands and their scores on that last deal?

  Submitted by Charlie    
No Rating
Solution: (Hide)
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.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
Solutionre: Correction to Puzzle !!!Dej Mar2007-04-16 15:29:54
re: Solutionvj2007-04-16 15:10:14
Correction to Puzzle !!!Charlie2007-04-16 09:09:39
SolutionDej Mar2007-04-15 12:30:09
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information