# A 3x3 grid of numbers with unique row and column medians

Can you place every number from 1 to 9 into a 3x3 grid such that the median of every row and column is a unique value? The median of a row is the number that is greater than one number and smaller than another number in that row (similarly for columns).

Bonus question: Can you find 4 different solutions, such that 2, 3, 4, or 5 are not used as medians?

Good luck!

The medians have values ranging from 2 to 8, so exactly one of these values does not appear as the median of one of the 6 rows/columns.

Here are three templates that allow you to choose any missing median value.

 1 a 5  a
8 4 6  6
9 7 b  7

8 4 5
where {a,b}={2,3}

 1 2 a  2
3 8 b  b
c 9 7  7

3 8 a
where {a,b,c}={4,5,6} with a>b

 1 3 b  3
2 6 4  4
9 a 5  a

2 6 5
where {a,b}={7,8}

For completeness, here are the solutions this produces:

 No 2         No 3

1 3 5  3     1 2 5  2
8 4 6  6     8 4 6  6
9 7 2  7     9 7 3  7

8 4 5        8 4 5

No 4         No 5         No 6

1 2 6  2     1 2 6  2     1 2 5  2
3 8 5  5     3 8 4  4     3 8 4  4
4 9 7  7     5 9 7  7     6 9 7  7

3 8 6        3 8 6        3 8 5

No 7         No 8

1 3 7  3     1 3 8  3
2 6 4  4     2 6 4  4
9 8 5  8     9 7 5  7

2 6 5        2 6 5

• Love your work as always! By the way No 6 can be obtained from No 4 by doing 9-x. Jan 1 '20 at 8:05
• @DmitryKamenetsky Indeed, but you mean 10-x. That is actually how I got the 7/8 template from the 2/3 template, though I then reordered the rows to sort the first column, putting the 1 in the top left corner. Jan 1 '20 at 8:11
• Ah yes sorry it's 10-x Jan 1 '20 at 8:44

Here is one solution:

1 2 9
3 5 8
7 4 6

No 2:

 2 8 9 - 8
3 5 7 - 5
4 6 1 - 4
| | |
3 6 7

No 3:

 3 1 2 - 2
6 5 8 - 6
4 7 9 - 7
| | |
4 5 8

No 4:

 1 8 9 - 8
4 5 6 - 5
2 7 3 - 3
| | |
2 7 6

No 5:

 5 2 1 - 2
8 7 3 - 7
9 4 6 - 6
| | |
8 4 3

• Sorry but 3 is used as a median twice. Jan 1 '20 at 6:50
• @DmitryKamenetsky; fixed
– JMP
Jan 1 '20 at 8:10