Let $n\ge3$ be an integer. Each row in an $(n-2)\times n$ array consists of the numbers 1,2,...,$n$ in some order, and the numbers in each column are all different. Prove that this array can be expanded into an $n\times n$ array such that each row and each column consists of the numbers 1,2,...,$n$.
Problem
Source: ToT - 2001 Fall Junior A-Level #3
Tags: graph theory, combinatorics unsolved, combinatorics
23.08.2011 11:49
Denote the two rows to be added as row P and row Q. In each of the n columns, precisely two numbers are missing out of the set (1, n). Write these two numbers in row P and row Q of the appropriate column - doesn't matter which way round. When this is complete for all n columns, each number in the set (1,n) must appear exactly twice in rows P and Q, and it must appear in two different columns. Now it is easy to devise a process to switch numbers in row P and row Q of individual columns to obtain the set (1,n) in both row P and row Q. Start with column 1. Let row P contain 'a' and row Q contain 'b'. Find the other column (k) that contains the second occurrence of 'a', and - if necessary - switch the two entries in k to put 'a' in row Q, and its other entry, 'c' in row P. If 'c' is the same value as 'b', we are done with values 'a' and 'b', and can pick another pair of columns to repeat the procedure. If 'c' is different from 'b', then find the other column (m) that contains 'c', and switch its entries in rows P and Q if necessary. This can be continued for all columns, to give the desired result.
25.08.2011 00:45
Let $G$ be the bipartite graph with vertex set $U \cup V$, where $U$ is the set of all the columns and $V = \{1,2,\ldots,n\}$, and $(u,v) \in U \times V$ is an edge if the column $u$ does not contain $v$. For any subset $X$ of $U$ of cardinality $k$, there are exactly $2k$ edges coming out of this set. Since the degree of every vertex in $V$ is $2$ it follows that the number of neighbours in $V$ of $X$ is at least $k$. By Hall's theorem we therefore have a perfect matching. This gives us the $(n-1)$-st row, and hence the $n$-th row as well.