Sort numbers in the box

Logic Level 3

How many ways are there to place the numbers from 1 to 8 in the boxes, such that

  • boxes sharing a side or a vertex don't contain consecutive numbers;
  • every number is distinct.
1 2 3 4

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.

3 solutions

Calvin Lin Staff
Jan 9, 2017

Let's interpret this problem using graph theory.

Setting up the framework Let's create a graph, where the vertices are these boxes, and we draw an edge if the 2 boxes are not neighbors. This way, when the number are placed in sequence, each consecutive pair must be along vertices that share an edge (since these boxes are not neighbors).

Interpretation of problem The problem then becomes: How many Hamiltonian paths are there in the following graph?

Solving the problem Now, it's much easier to count. We have to start and end from either E or D, since these vertices have degree 1.
If we start from E, then we have to go to C. From there, there are 2 choices of C-B-H-A-G-F-D, or C-H-B-G-A-F-D.
Similarly, if we start from D, then we have to go to F. From there, there are 2 choices of G-A-H-B-C-E or A-G-B-H-C-E.

Hence, there are a total of 4 ways.

What a great solution. Thanks!

Ronald Chén - 4 years, 5 months ago
Kevon Marks
Feb 18, 2017

With 1 and 8 being the two extremes of the # series with only 1 adjoining "consecutive number" for each, they must occupy the two central squares with the other 6 surrounding squares. Their respective corresponding "single adjoining number 2 and 7 cannot occupy the squares above or below so they must occupy the 2 opposite outer squares to the left and right depending on the placement of the 1 and 8. The remaining 4 numbers 3, 4, 5, and 6 will then be used in the 2 upper and 2 lower cells based on the horizontal row of 7, 1, 8, 2 or 2, 8, 1, 7 which is the mirror of your first solution. With the exchange of 3, 4, 5, and 6 within the parameters of the 7, 1, 8, 2 or 2, 8, 1, 7....only 4 solutions are available.

Thanks Marks

Wacntn Tina - 4 years, 3 months ago

Clear - thanks. Had to look up "vertex'.

Carson Foard - 4 years, 3 months ago
Naren Bhandari
Feb 19, 2017

If we place each first 8 digits as per mentioned conditions that one way and remaining 3ways can done by horizontal and vertical placement of digits so total ways are 1 + 3 = 4 1+3 = \boxed{4}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...