How many ways are there to place the numbers from 1 to 8 in the boxes, such that
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.
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.