6. Seth has nine stones: three painted blue, three painted red and three painted yellow. The blue stones are labelled 1,2 and 3 , as are the red stones and the yellow stones. He builds a vertical tower with three stones, putting one on top of another.
Three stones form a set if any of the following hold:
(i) They all have the same colour;
(ii) They are all labelled with the same number;
(iii) They all have different colours;
(iv) They are all labelled with different numbers.
In how many ways can he build a tower that avoids creating a set?
SolUTION
We can describe a particular tower by inserting B (Bottom), $\mathrm{M}$ (Middle) and $\mathrm{T}$ (Top) into three of the nine empty cells in the table on the right:

For example, the tower made up of all blue stones, with the number 1 at the bottom, 2 in the middle and 3 at the top would look like:
In order to avoid a set as described in the question, when three empty cells are chosen we must omit exactly one row and exactly one column. Otherwise there would be one of each colour or one of each number in the tower and a set would be formed.

There are 3 choices for the omitted row and 3 choices for the omitted column. Once a row and a column have been omitted there remain four empty cells, of which we must choose three.
For example, if we omit the second row and second column, we must choose three of the four unshaded cells in the table on the right:
No matter which row and column are omitted, we can choose three of the four remaining cells by instead choosing one of the cells to omit. There are 4 choices for which cell to omit.
We then have to decide how to arrange B, $\mathrm{M}$ and $\mathrm{T}$ into these three cells. There are 3 choices for where to place B, then 2 choices for where to place $\mathrm{M}$ and finally a single choice for where to place T.
By the product rule for counting, we have that the number of towers which avoid a set is $3 \times 3 \times 4 \times 3 \times 2 \times 1=216$