In the world of pencil puzzles, there are many puzzle types where you have to draw a loop on a lattice grid, including
Country Road
,
Masyu
,
Pure Loop
,
Slalom
, and
Yajilin
. In most of these puzzles (and all of the linked above), the loop visits some of the cells, passing through the cells' centers, and may not use a cell more than once (which also means no intersections, no touching itself, etc).
Formally, on a polyomino , a loop is a sequence of squares such that all squares are in , and share a side for all valid , and also share a side, and all squares in the loop are distinct. Loops are cyclic (it can start from any square in the loop) and don't have any orientation (reversing the loop doesn't matter), thus all describe the same loop.
There is loop on a square, loops on a rectangle, and loops on a square. Determine the number of loops on a rectangle.
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.
The board is small enough to discover all the possible loops, especially since you're also told a few examples to help double-checking your loops.
We know that there are 1 3 loops on 3 × 3 square, so we immediately have several loops: there are 1 3 that doesn't use the bottom row, and there are 1 3 that doesn't use the top row. However, there are 3 loops that don't use both the top and the bottom rows (those that fit in a 2 × 3 rectangle), and they are counted twice, so we need to subtract it. We have a current total of 1 3 + 1 3 − 3 = 2 3 loops. Now we need to count the number of loops that use both the top and the bottom rows.
There are 3 ways to use the top rows, labeled "left", "all", and "right" respectively:
Likewise, there are also 3 ways to use the bottom rows. Thus in total there are 9 cases to consider. It shouldn't be difficult if you're careful enough, and noticing the symmetry can help:
This gives a total of 1 7 additional loops, for a grand total of 2 3 + 1 7 = 4 0 .
Of course, it's easier to use programming for this, which is the task of the medium difficulty...