Problem: A game of solitaire is played with $R$ red cards,
$W$ white cards, and $B$ blue cards.
A player plays all the cards one at a time.
With each play he accumulates a penalty.
If he plays a blue card, then he is charged a penalty
which is the number of white cards still in his hand.
If he plays a white card, then he is charged a penalty
which is twice the number of red cards still in his hand.
If he plays a red card, then he is charged a penalty
which is three times the number of blue cards still in his hand.

Find, as a function of $R$, $W$, and $B$, the minimal total penalty
a player can amass and the number of ways in which this minimum can be achieved.

Solution: The minimum penalty is
\[ f(B,W,R) = \min (BW, 2WR, 3RB) \]
or equivalently, the natural guess of
``discard all cards of one color first''
is actually optimal (though not necessarily unique).

This can be proven directly by induction.
Indeed the base case $BWR = 0$
(in which case zero penalty is clearly achievable).
The inductive step follows from
\[ f(B,W,R) = \min
  \begin{cases}
    f(B-1,W,R) + W \\
    f(B,W-1,R) + 2R \\
    f(B,W,R-1) + 3B.
  \end{cases}
\]

It remains to characterize the strategies.
This is an annoying calculation, so we just state the result.
\begin{itemize}
  \ii If any of the three quantities $BW$, $2WR$, $3RB$
  is strictly smaller than the other three,
  there is one optimal strategy.
  \ii If $BW = 2WR < 3RB$,
  there are $W+1$ optimal strategies,
  namely discarding from $0$ to $W$ white cards,
  then discarding all blue cads.
  (Each white card discarded still preserves $BW = 2WR$.)
  \ii If $2WR = 3RB < BW$,
  there are $R+1$ optimal strategies,
  namely discarding from $0$ to $R$ red cards,
  and then discarding all white cards.
  \ii If $3RB = RB < 2WR$,
  there are $B+1$ optimal strategies,
  namely discarding from $0$ to $B$ blue cards,
  and then discarding all red cards.
  \ii Now suppose $BW = 2WR = 3RB$.
  Discarding a card of one color
  ends up in exactly one of the previous three cases.
  This gives an answer of $R+W+B$ strategies.
\end{itemize}