Filling in a 3x3

How many ways can you arrange the numbers 1 through 9 in a 3 × 3 3 \times 3 grid such that the following conditions hold?

  • Every number is greater than the number directly above it.
  • Every number is greater than the number immediately to the left of it.

Inspired by this problem.


The answer is 42.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

6 solutions

Nate Jellis
Sep 18, 2018

Insert the numbers into the diagram one at a time, in order from 1 to 9. Each number has to be placed in an upper-left corner (there may be more than one way to do this). Forgetting about which number is in which box, just look at the shape they make. The number of ways to arrange numbers for each shape is always equal to the sum of the shapes feeding into it. The solution (42) is at the bottom.

Great graphic!

Geoff Pilling - 2 years, 8 months ago

I thought in this direction. But was not confident to move forwards. This is a very beautiful and elegant solution.

Srikanth Tupurani - 2 years, 8 months ago

Wow but I can't understand why colouring this way will ensure that the condition of the question also holds True

Geeta . - 2 years, 8 months ago

Log in to reply

Edit: understood it after second look

Geeta . - 2 years, 8 months ago

Elegant, clear solution! Thank you!

Laurel Rogers - 2 years, 8 months ago
Jon Haussmann
Sep 10, 2018

By the hook length formula , the number of possible grids is 9 ! 5 4 3 4 3 2 3 2 1 = 42. \frac{9!}{5 \cdot 4 \cdot 3 \cdot 4 \cdot 3 \cdot 2 \cdot 3 \cdot 2 \cdot 1} = 42.

first time I've ever heard of this "hook length formula"...interesting connection with Catalan numbers

Michael Mendrin - 2 years, 8 months ago

Log in to reply

I only knew about it because a USAMO problem a few years ago was trivialised because the Hook Length Formula produces an integer.

Sharky Kesa - 2 years, 8 months ago

Log in to reply

Interesting... Do you recall the problem?

Geoff Pilling - 2 years, 8 months ago

Log in to reply

Log in to reply

@Sharky Kesa I happened to stumble upon that formula when solving this problem. (that formula in USAMO, I kinda got it through patterns) Any elementary proof about this?

Kaizer Albert De Asis - 2 years, 8 months ago

I thought left-top is 1, bottom-right is 9, and 2,3 permute, 4,5,6 permute, 7,8 permute, totally 24 isn't it?

Kelvin Hong - 2 years, 8 months ago

Log in to reply

Not exactly. Consider this arrangement: (1, 2, 7) (3, 5, 8) (4, 6, 9)

Anton Curmanschiy - 2 years, 8 months ago

Log in to reply

You're right... Thanks for the example.

Kelvin Hong - 2 years, 8 months ago

I didn't heard of that formula before...I just keep on fixing no...and making cases at last I got 52 ans....1&9 are already fixed then I fixed 8 it has 2 potential sites....and then 7....UpTo 4 isn't that right🤔

rahul raghav - 2 years, 8 months ago

Log in to reply

I agree with your approach for 9 and 8, however once 7 is in place, depending on where you put it, 6 could have 1 or 3 potential places. If you can enumerate/describe your 52 solutions, I'd be happy to take a look.

Geoff Pilling - 2 years, 8 months ago

How do you know when to use the hook length rule?

epic play Saji - 2 years, 8 months ago

Log in to reply

The hook length formula counts the number of standard Young tableaux of a given shape. The shape here is a 3×3 grid. A standard Young tableaux has every row and column increasing. This problem is a typical hook length problem.

Chris Maitland - 2 years, 8 months ago

I wonder... Is there a way to apply this formula, to, say, a problem like this ?

Geoff Pilling - 2 years, 8 months ago
Uros Stojkovic
Sep 18, 2018

Notice that grid must be of the form:

where 4 e 6 4\leq e\leq 6 . This splits up into two forms:

where 5 e 6 5\leq e\leq 6 for the first one, while still 4 e 6 4\leq e\leq 6 for the second one. Regarding 1st one, for e = 5 e = 5 there are 3 ways to fill the grid, namely:

For e = 6 e = 6 there are two ways:

Regarding 2nd form, for e = 4 , 5 e = 4,5 there are 6 ways to fill the grid:

For e = 6 e = 6 there are 4 ways:

Notice that each of our solutions can be flipped over the main diagonal ( 1 e 9 ) (1-e-9) . Hence, the total number of ways is 2 × ( 3 + 2 + 6 + 6 + 4 ) = 42 2\times (3 + 2 + 6 + 6 + 4) = 42 .

Great enumeration of all the possible answers, Uros... Thanks for posting!

Geoff Pilling - 2 years, 8 months ago

Log in to reply

I'm glad you like it, it was my pleasure.

Uros Stojkovic - 2 years, 8 months ago

This is a painful counting problem . There is a high chance we miss something unless we use some solid concept or intelligent trick. I fixed the last row. It became too tedious to handle. Some solutions here are too good.

Srikanth Tupurani - 2 years, 8 months ago
Vinod Kumar
Sep 17, 2018

This is the standard Young Tableaux and answer for n=3 is 42.

Jay Singh
Sep 22, 2018

I just guessed 42.

Ilan Yona
Sep 21, 2018

(1,1) entry must be 1. (3,3) entry must be 9. Every valid shape can be transposed so we can count only shapes that (1,2) entry is 2. Assume first row is 1,2,3. We should consider how many valid ways there are for the second row. The third row is by definition the remaining numbers in increasing order. So we have (4,5,6), (4,5,7), (4,5,8), (4,6,7), (4,6,8). 5 options. If we look on 1,2,4 as the first row and replace 4 with 3 in the second row we will get another 5 options. 1,2,5 gives another 5. (3,4,6), (3,4,7), (3,4,8), (3,6,7), (3,6,8). 1,2,6 gives another 4 (3,4,7), (3,4,8), (3,5,7) and (3,5,8). And finally 1,2,7 gives another 2 (3,4,8) and (3,5,8). Total of 21. Transpose of these options gives another 21 and in total 42.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...