All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers > Sequences
123…9 door to door (Posted on 2022-10-27) Difficulty: 3 of 5
Consider the sequence of 9 non zero distinct digits arranged in a 3 by 3 grid , like
547
398
162
Clearly there are 9! (=362880) ways to do it.
If we demand that the consecutive numbers are next-door neighbours
( horizontally or vertically) like
167
258
349
then the number is significantly lower, say N.

Find N & provide your reasoning.

See The Solution Submitted by Ady TZIDON    
Rating: 5.0000 (2 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution | Comment 1 of 27
We can start at the top-left corner and multiply any solutions we find by 4 to get rotations. Similarly we can make the first move to the right, and multiply again, this time by 2, to take care of reflections:

1 2 .
. . .
. . .

At this point we can split into cases Ia and Ib: 

1 2 .            1 2 3
. 3 .            . . .
. . .            . . .

1a, on the left, has left a cul-de-sac, or dead end, at the top right, so that's where only 9 can go, and the only way to get there is

1 2 9
4 3 8
5 6 7

Our preliminary count (before rotations and reflections) now has reached 1.

Now Ib:

This splits into Ib and Ic:

1 2 3            1 2 3
. 5 4            . . 4
. . .            . . 5

then             

 Ib
completed      then Ic split further into 1c and 1d:
1 2 3            1 2 3           1 2 3
6 5 4            8 9 4           8 7 4
7 8 9            7 6 5           9 6 5

That's it: 1a thru 1d. These four are multiplied by 8 to get the rotations and reflections making 32 that begin in a corner and start off in either a clockwise or counterclockwise direction.

Case 2: starting at the meddle of an edge:

. 1 .             . 1 2
. 2 .       or    . . .
. . .             . . .

The left figure has created two dead ends (top-left and top-right). The 9 can't be in both places, so that figure can't be.

The figure on the right has two sub-possibilities:

. 1 2             . 1 2
. 4 3      or     . . 3
. . .             . 5 4
            
but the figure on the left has also created two dead ends, and again, the 9 can't be in both places. The same is true of the right-hand figure.

So case 2 cannot work.

Case3: starting in the center:

From the center it must proceed to an edge and then one of the corners, and out again:

9 2 3
8 1 4
7 6 5

We can see the only two choices we had were which side center to go to at the beginning and the whether to proceed left or right after that. The rest of the moves were forced. This just leads to the total of 8 rotations and permutations.

In all we have N = 8*4 + 8*1 = 40.

  Posted by Charlie on 2022-10-27 09:07:23
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (9)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information