## Riddler Express

You are creating a variation of a Romulan pixmit deck. Each card is an equilateral triangle, with one of the digits $0$ through $9$ (written in Romulan, of course) at the base of each side of the card. No number appears more than once on each card. Furthermore, every card in the deck is unique, meaning no card can be rotated so that it matches (i.e., can be superimposed on) any other card.

What is the greatest number of cards your pixmit deck can have?

Extra credit: Suppose you allow numbers to appear two or three times on a given card. Once again, no card can be rotated so that it matches any other card. Now what is the greatest number of cards your pixmit deck can have?

## Solution

The number of ways of choosing $3$ distinct digits from the $10$ digits for each card is ${10 \choose 3}$.Once three digits have been chosen for a card, they can be permuted in $3!=6$ ways. These $6$ permutations can be grouped into two equivalence classes of three permutations each such that the permutations in each class are rotations of other permutations in that class. Therefore, the greatest number of cards in the deck is $2{10 \choose 3} = \bf{240}$.

### Extra credit

Case 1: When a digit can be repeated thrice in each card.

We choose one digit for each card and this can be done in $10$ ways.

Case 2: When two digits are chosen for each card and one of them is repeated twice.

Number of ways of choosing $2$ digits from $10$ digits is ${10 \choose 2}$. Once two digits have chosen for a card, there is only one way of assigning digits to each side of the card (ignoring rotations). Therefore, the number of cards in this case is $2{10 \choose 2}$.

The greatest number of cards in the deck after allowing the digits to be repeated is $240 + 10 + 90 = \bf{340}$.