What would be the max number of people who could reach a score of at least 30 for this card game.

86 Views Asked by At

You're a teacher, you have a standard deck of cards with 2 jokers, so 54 cards in total. You distribute the cards equally amongst your 18 students, resulting in 3 cards per student. they can only have 3 cards at a time.

Each type of card is assigned a different number of points:

Joker - 0

Ace - 1

(2-10) - Respective values

Jack - 11

Queen - 12

King - 13

If you have a pair you are given 5 bonus points. E g. 5,5,6 = 5+5+6+5(bonus)

A triple is 10 bonus points. Ex. 6,6,6 = 6+6+6+10(bonus)

The goal is for students to reach a score of 30 or more. Students can trade cards to reach that goal but they all have to have exactly 3 cards at all times.

The question is, what is the maximum amount of students that can reach a score of 30 or more?

Also me and my friend tried calculating this and we got the max as 10 winners and 8 losers.

the 10 winners would be

  • K+6+6
  • Q+7+7
  • J+7+7
  • 10+8+8
  • 9+8+8
  • 8+9+9
  • 6+10+10
  • 4+J+J
  • 2+Q+Q
  • K+K+K
2

There are 2 best solutions below

2
On BEST ANSWER

You can solve the problem via integer linear programming as follows. Let the ranks be $R=\{0,\dots,13\}$, with "supply" $s_r=2$ if $r=0$ (two jokers) and $s_r=4$ otherwise. Let $W$ be the set of $88$ possible winning hands $(i,j,k)\in R^3$, with $i \le j \le k$. Let $d_{ijkr}\in\{0,1,2,3\}$ be the "demand" in hand $(i,j,k)$ for rank $r$, that is, the number of cards of rank $r$ among $\{i,j,k\}$. Let nonnegative integer decision variable $x_{ijk}$ represent the number of copies of hand $(i,j,k)$ that are used. The problem is to maximize $$\sum_{(i,j,k)\in W} x_{ijk}$$ subject to linear constraints $$\sum_{(i,j,k)\in W} d_{ijkr} x_{ijk} \le s_r \quad \text{for $r\in R$} \tag1\label1$$ The optimal objective value turns out to be $13$, attained by the following solution: \begin{matrix} i & j & k & \text{score} & x \\ \hline 0 &13 &13 &31 &1 \\ 3 &11 &11 &30 &2 \\ 3 &12 &12 &32 &2 \\ 5 &10 &10 &30 &2 \\ 6 & 6 &13 &30 &2 \\ 7 & 7 & 7 &31 &1 \\ 7 & 9 & 9 &30 &1 \\ 8 & 8 & 9 &30 &2 \end{matrix}

The optimal dual variables of the linear programming relaxation provide a short certificate of optimality. Explicitly, take $\pi_6=1/4$, $\pi_r=1/3$ for $r\in\{7,8,9\}$, and $\pi_r=1/2$ for $r\in\{10,11,12,13\}$. Multiply \eqref{1} by $\pi_r$ and add them up to derive upper bound $$\sum_{(i,j,k)\in W} x_{ijk} \le \sum_{r\in R} \pi_r s_r = \frac{1}{4}\cdot4 + \frac{1}{3}(4+4+4) + \frac{1}{2}(4+4+4+4) = 13.$$

5
On

(Skip below to see a proof that 13 is the maximum.)

In the comments, OP listed out ways to get a score of 30 or more.
At a quick glance, we can make 11 winners by taking the following combinations

  • 7, 7, 7 (this is only single, the rest are paired)
  • 9 9, 8
  • 9, 9, 8
  • 10, 10, 5
  • 10, 10, 5
  • J, J, 3
  • J, J, 3
  • Q, Q, 1
  • Q, Q, 1
  • K, K, 1
  • K, K, 1

We can actually do better, getting up to 13 winner sets.


First, show that 13 can indeed be achieved. This is left to the reader.

Think of this as a structure-finder-and-avoider problem. As it turns out, the cards that are important to track are those with a value of 8 or more, of which there are 24 of these cards. The main idea we use is that, if the winner set each uses 2 or more of these 8+ cards, then there are at most 12 winner sets.
So, to get more than 12 winner sets, we need to find winner sets that use 0 or 1 of these 8+ cards. However, because there are too many of them, we also have to track the winner sets that use 3 of these 8+ cards.

From this train of reasoning, we make 2 observations that are crucial to the solution:

Observation 1: Let's list out those winner sets which use 0 or 1 of these 8+ cards. We denote these as restricted sets.

  • 0 8+ card: $7-7-7$
  • 1 8+ card: $K-6-6$, $K-7-7$, $Q-7-7$, $J-7-7$.

Observation 2: Apart from $9-9-7$, any winner set with 9 will use 3 of these 8+ cards.

Now, we consider cases based on which of these restricted sets are formed by the winners.

Case 1: If the winner sets use none of these restricted sets, then

  • Each winner set uses at least 2 8+ cards, so there are at most $ \lfloor \frac{24}{2} \rfloor = 12$ winners.

Case 2: If the winner sets does not use the $7-7-7$ restricted set, then

  • If we use $ a \leq 2$ winner sets of the form $ $9-9-7$ - If we use $b \leq 2 + \lfloor \frac{4-a} { 2} \rfloor $ winner sets with 1 8+ card - If we use $ c \leq \lfloor \frac{4-2a} {3} \rfloor$ winner sets involving 9, - then we have at most $ d = \lfloor \frac{ 24 - 2a - b - 3c } { 2 } \rfloor$ winer sets with 2 8+ cards. - Show that $ a +b+c+d \leq 13$.

Case 3: If we use the $7-7-7$ restricted set, then

  • If we use $ a \leq 1$ winner sets of the form $ $9-9-7$ - If we use $b \leq 2 + \lfloor \frac{4-a} { 2} \rfloor $ winner sets with 1 8+ card - If we use $ c \leq \lfloor \frac{4-2a} {3} \rfloor$ winner sets involving 9, - then we have at most $ d = \lfloor \frac{ 24 - 2a - b - 3c } { 2 } \rfloor$ winer sets with 2 8+ cards. - Show that $ a +b+c+d \leq 13$.

Hence, we have at most 13 winners sets, and this can be achieved. Thus, it is the maximum.