Friday, March 3, 2017

logical deduction - Quick Yajilin Puzzles: Scatter and Gather


enter image description here



Yajilin (adapted from Nikoli)



  • Draw a line to make a single loop.

  • Lines pass through the centers of cells, horizontally, vertically, or turning. The loop never crosses itself, branches off, or goes through the same cell twice.


  • The numbers with arrow show how many black cells there are in the direction of the arrow.

  • The number 0 without arrow denotes nothing (it can be treated as a "white wall").

  • The loop does not pass through the black cells or the cells with numbers, and black cells cannot touch horizontally or vertically. The loop has to pass through all of the other (white) cells.

  • Some parts of the loop are already given by the blue lines.




Answer



Second puzzle



There are many cells on the border which can't be walls because that would create a dead-end cell next to them (i.e. an empty cell with only one open side). Mark those as empty.

enter image description here

There can't be a wall-empty-wall sequence on the border, because the middle cell would be a dead end. That solves the 2s at the top and along the right-hand border.

enter image description here

Fill in the line in empty cells which have only two open sides.

enter image description here

The bottom 2 is trivially solved now.

enter image description here

This cell cannot be empty, because in that case the only way to fill the 2 to the right of it would make a dead end in between.

enter image description here

So it has to be a wall.

enter image description here

Some more cells that can't be walls because they would create a dead end.

enter image description here

So all those have to be empty.

enter image description here

Now, the 2 near the top-right corner has three possibilities for wall cells. The adjacent cells can't both be walls, so this cell has to be a wall.

enter image description here

Regardless of how the 2 is filled, neither of the cells marked pink can be a wall or there'd be either two adjacent walls or a dead end somewhere.

enter image description here

So mark those cells empty.

enter image description here

Now, there is no way to put three walls in four adjacent cells, so the cell directly next to the 3 must be a wall.

enter image description here

Only one way to fill this 2 now.

enter image description here

Having the two cells marked pink be walls would make a dead end. So the only legal way to complete the 3 is if the circled cell is a wall.

enter image description here

Marking that cell a wall solves the entire bottom-left corner. Fill in the loop.

enter image description here

There's a dead-end cell on row 3, column 2. That has to be a wall, and marking it a wall allows resolving the loop even further.

enter image description here

Neither of these cells can be a wall. Making the topmost one a wall would create a dead end, and making the bottom-most one a wall would create a closed loop. Also, there needs to be a line between these cells to prevent a closed loop.

enter image description here

The loop can't continue this way, because we'd force a closed loop near the top-left corner.

enter image description here

So it must continue upwards. This solves the entire left part of the grid.

enter image description here

We need to get both ends of the loop out of the bottom-right corner, so none of these cells can be walls. In fact, we can already fill in how the ends of the loop come out since there are only two spaces where they can go.

enter image description here

Like so.

enter image description here

Both of the pink cells cannot be walls, because that would force a dead end. So the circled cell must be a wall to satisfy the 2 below.

enter image description here

This solves the entire bottom-right corner.

enter image description here

This cell would be a dead end, so it has to be a wall.

enter image description here

Now, the same story with this cell. This solves the rest of the grid.

enter image description here

Final solution.

enter image description here




No comments:

Post a Comment

classical mechanics - Moment of a force about a given axis (Torque) - Scalar or vectorial?

I am studying Statics and saw that: The moment of a force about a given axis (or Torque) is defined by the equation: $M_X = (\vec r \times \...