Maths WorkshopMaths problems with full solutions
Exercise 1099Combinatorics › Pigeonhole principleOlympiadAdded 3 Nov 2026

Pigeonhole in a Latin square

#pigeonhole#Latin square#entries

Statement

In an n×nn\times n array filled with entries from {1,…,n}\{1,\ldots,n\}, show that if each row has all nn distinct values, then each column also has distinct values.

Hint

Each row is a permutation of {1,…,n}\{1,\ldots,n\}. Count occurrences of each value.

Show solutionHide solution

Solution

Row constraint. Each row contains each value exactly once. So value kk appears nn times in the whole array.

Column constraint. Value kk appears at most once per column (if it appeared twice in a column, that column would have a repeat). With nn total occurrences and nn columns, kk must appear exactly once per column.

Conclusion. Each column contains each value exactly once (Latin square property).