The XY-Wing is a special case of forcing chains, and can be considered the simplest application of that technique.
The XY-Wing can also be considered a generalization of a special case of naked triples.
"Uh?" I hear you say. "generalization of a special case?".
A naked triple is a group of three cells in the same unit that contain in total three candidates. Each cell can have two or three candidates, but the different candidates present in at least one of the cells must be three. When this happens, the three candidates can be removed from all other cells in the same unit. Examples of naked triples:
(123) (123) (123)
(123) (123) (12)
(123) (12) (23)
(12) (23) (13)
The last case is the one we are interested in. We can formulate the special case of a naked triple where every cell contains only two candidates.
If three cells in the same unit contain candidates xy, yz and xz respectively, then x y and z can be removed from the candidates of all other cells in the unit.
We can now generalize that definition, this way:
If three cells a, b, c, with a and b in the same unit, and a and c in the same unit, candidates xy, yz and xz respectively, then z can be removed from the candidates of all the cells (different from a,b,c) contained in the intersection of two units that contain b and c respectively.
The reason for that is quite simple: a containes either x or y. If a contains x, then c contains z; if a contains y, then b contains z. Therefore either b or c contains z. Therefore a cell located inside the intersection of two units containing b and c cannot contain z.
An easy example would be as follows:
- Code: Select all
. . . | . . . | . . .
. xy------yz. | . . .
. | . | . | . | . . .
---|---+---|---+-------
. | . | . | . | . . .
. xz------* . | . . .
. . . | . . . | . . .
-------+-------+-------
. . . | . . . | . . .
. . . | . . . | . . .
. . . | . . . | . . .
Here, r5c5 cannot contain Z.
The cells need not be the vertices of a rectangle:
- Code: Select all
. . . | . . . | . . .
. . . | . . . | . . .
. . . | . . . | . . .
-------+-------+-------
. xy------yz. | . . .
./. . | . .\ .| . . .
xz-----------* | . . .
-------+-------+-------
. . . | . . . | . . .
. . . | . . . | . . .
. . . | . . . | . . .
The cells need not be the vertices of a polygon either:
- Code: Select all
. . . | . . . | . . .
. . . | . . . | . . .
. . . | . . . | . . .
-------+-------+-------
. . . | *-xy------yz.
. . . | |/. . | . . .
. . . |xz . . | . . .
-------+-------+-------
. . . | . . . | . . .
. . . | . . . | . . .
. . . | . . . | . . .
I hope this figure is clear. r4c5 is either x or y. If it's x, r6c4 is z. If it's y, r4c8 is z. In either case, r4c4 cannot be z.
Some hints about how to locate a XY-Wing on the grid.
Let's do it with an example.
- Code: Select all
3 4 19 | 6 5 8 | 2 7 19
89 18 5 | 7 4 2 | 19 6 3
6 2 7 | 1 9 3 | 5 8 4
-------------------+--------------------+-------------------
4 18 19 | 3 7 5 | 89 2 6
5 6 2 | 8 1 9 | 4 3 7
89 7 3 | 4 2 6 | 189 5 19
-------------------+--------------------+-------------------
7 9 8 | 2 3 4 | 6 1 5
2 3 4 | 5 6 1 | 7 9 8
1 5 6 | 9 8 7 | 3 4 2
First of all, locate a cell that has only two candidates. For example r4c3=19. Look for another cell in the same unit that has two candidates, one of which is 1. While doing this, ignore cells with the same two candidates, i.e. 19, because the XY-Wing wouldn't work.
In this case we have r4c2=18. Now look for another cell in the same unit as the first one, having only two candidates: the one you didn't consider before (9), and the new one found in the second cell (8). There are two such cells: r4c7=89 and r5c1=89. The former isn't much use, because it completes a naked triple. The latter could allow to form a XY-Wing, but there is no cell where the candidate 8 would be removed. [Edit: the latter is a naked triple as well]
As an exercise, find the XY-Wing in the above board. Hint: the first cell is one of the 19 ones.
If you want to try more puzzles needing this technique, you can find some examples here.