# Difference between revisions of "2008 UNCO Math Contest II Problems/Problem 1"

## Problem

Determine the number of $3 \times 3$ square arrays whose row and column sums are equal to $2$, using $0, 1, 2$ as entries. Entries may be repeated, and not all of $0, 1, 2$ need be used as the two examples show.

$$\begin{tabular}{c c c c c c c c c} 1 & 1 & 0 & & & & 0 & 1 & 1 \\ 0 & 0 & 2 & & & & 1 & 1 & 0 \\ 1 & 1 & 0 & & & & 1 & 0 & 1 \\ \end{tabular}$$

## Solution

Case 1: The numbers include $0,1,2$

Row 1: $0 1 1$

Row 2: $2 0 0$

Row 3: $0 1 1$

There are 3 rows to choose where to place Row 2, giving us $\boxed3$ cases.

Case 2: The numbers include $0,1,2$

Row 1: $1 0 1$

Row 2: $0 2 0$

Row 3: $1 0 1$

There are 3 rows to choose where to place Row 2, giving us $\boxed3$ cases.

Case 3: The numbers include $0, 1, 2$

Row 1: $1 1 0$

Row 2: $0 0 2$

Row 3: $1 1 0$

There are 3 rows to choose where to place Row 2, giving us $\boxed3$ cases.

Case 4: The numbers include $0, 2$

Row 1: $0 0 2$

Row 2: $0 2 0$

Row 3: $2 0 0$

There are 3 rows to choose where to place Row 2, and Row 1 can go on either top or bottom, giving us $3\times2=\boxed6$ cases.

Case 5: The numbers include $0, 1$

Row 1: $0 1 1$

Row 2: $1 0 1$

Row 3: $1 1 0$

There are 3 rows to choose where to place Row 2, and Row 1 can go on either top or bottom, giving us $3\times2=\boxed6$ cases.

This gives us a total of $3+3+3+6+6=\boxed{21}$ ways.