CEMC Banner

Problem of the Week
Problem A and Solution
Tabulating Tokens

Problem

In the Game of Threes, players gather tokens. There are four kinds of tokens: lead, bronze, silver, and gold. Bronze tokens are \(10\) times more valuable than lead, silver tokens are \(10\) times more valuable than bronze, and gold tokens are \(10\) times more valuable than silver.

In the game, whenever you have three of the same kind of token, you can trade them for one of the next most valuable token.

Three lead tokens can be traded for one bronze token. Three
bronze tokens can be traded for one silver token. Three silver tokens
can be traded for one gold token.

The goal is to get as many of the most valuable tokens as possible. For example it would be better to have \(1\) gold token than \(20\) lead tokens, since gold tokens are \(10 \times 10 \times 10 = 1000\) times more valuable than lead tokens.

  1. Suppose you start out with \(2\) lead, \(1\) bronze, \(2\) silver, and \(1\) gold tokens, and on your next turn you gather \(1\) more of each type. After making the best possible trades, how many lead, bronze, silver, and gold tokens would you have?

  2. Suppose you start out with \(43\) lead tokens. After making the best possible trades, how many lead, bronze, silver, and gold tokens would you have?

Solution

  1. After gathering \(1\) more coin of each type, we will have \(3\) lead, \(2\) bronze, \(3\) silver, and \(2\) gold tokens. Now we can start making some trades. The following table shows the results after each trade:

    Tokens Before Trade Trade Tokens After Trade
    \(3\) lead, \(2\) bronze, \(3\) silver, \(2\) gold \(3\) lead for \(1\) bronze \(0\) lead, \(3\) bronze, \(3\) silver, \(2\) gold
    \(0\) lead, \(3\) bronze, \(3\) silver, \(2\) gold \(3\) bronze for \(1\) silver \(0\) lead, \(0\) bronze, \(4\) silver, \(2\) gold
    \(0\) lead, \(0\) bronze, \(4\) silver, \(2\) gold \(3\) silver for \(1\) gold \(0\) lead, \(0\) bronze, \(1\) silver, \(3\) gold

    This means we end up with \(0\) lead, \(0\) bronze, \(1\) silver, and \(3\) gold tokens after making the best possible trades. Note that we could have made a trade of \(3\) silver for \(1\) gold as our first or second trade and it would not have changed the final token tally.

  2. If we start with \(43\) lead tokens, we can trade as many groups of three as possible into bronze tokens. We can use skip counting or division to determine that there are \(14\) groups of \(3\) lead tokens with \(1\) lead token left over. Now we can take the \(14\) groups of \(3\) lead tokens and trade them for \(14\) bronze tokens. Next, we can determine that there are \(4\) groups of \(3\) bronze tokens with \(2\) bronze tokens left over. Now we can trade the \(4\) groups of \(3\) bronze tokens for \(4\) silver tokens. Finally, we can trade \(3\) silver tokens for \(1\) gold token with \(1\) silver token left over.

    Tokens Before Trade Trade Tokens After Trade
    \(43\) lead, \(0\) bronze, \(0\) silver, \(0\) gold \(42\) lead for \(14\) bronze \(1\) lead, \(14\) bronze, \(0\) silver, \(0\) gold
    \(1\) lead, \(14\) bronze, \(0\) silver, \(0\) gold \(12\) bronze for \(4\) silver \(1\) lead, \(2\) bronze, \(4\) silver, \(0\) gold
    \(1\) lead, \(2\) bronze, \(4\) silver, \(0\) gold \(3\) silver for \(1\) gold \(1\) lead, \(2\) bronze, \(1\) silver, \(1\) gold

    This means we end up with \(1\) lead, \(2\) bronze, \(1\) silver, and \(1\) gold token.

Teacher’s Notes

The rules of this game mimic rules that can be used in a context-free grammar. Each rule describes a substitution that can take place as you move from a starting point to an end point.

A context-free grammar is used in other disciplines including:

When you follow the rules from a starting point (such as starting with \(43\) lead coins) to a successful end point, this is called a derivation. This process is also called parsing. In Computer Science, parsing is an important step in converting code that people write in a programming language such as Java or Python into a form that a computer can understand and execute.