I Need Practice with X-Wing and Swordfish

Post the puzzle or solving technique that's causing you trouble and someone will help

I Need Practice with X-Wing and Swordfish

Postby mooker » Thu Mar 22, 2007 7:42 pm

Hi folks,

I am reading through Andrew's Logic of Sudoku book, and am really enjoying it. I am currently at the part of the book that teaches x-wing, swordfish, and jellyfish. While I understand the theory behind x-wing/swordfish, I am having difficulty seeing them in the puzzle, and have to resort to the Sudoku Solver to show me where it is (maybe I'm not being patient enough, but I really can't see them!)

Are there any sample puzzles that people can post or send to me that have x-wings or swordfishes in them? I really want to get this strategy down before I move on to further techniques. Practice makes perfect, right?:)

Thanks all!
mooker
 
Posts: 8
Joined: 15 December 2006

Postby RW » Thu Mar 22, 2007 9:26 pm

Hi mooker, welcome to the forums.

Lots of x-wings can be found in the superior thread. Not all of them have x-wings, but many. Lots of swordfishes can be found in the superior plus thread, but beware, you might run in to some jellyfish there too. You can look through the later posts in the thread, mostly when people have submitted the puzzles they've also mentioned what techniques are needed for them.

If you have problems spotting these seacreatures, maybe arcilla's method could prove useful.

RW
RW
2010 Supporter
 
Posts: 1010
Joined: 16 March 2006

Postby Pat » Sun Mar 25, 2007 1:09 pm

mooker wrote:Are there any sample puzzles
that have x-wings or swordfishes in them?




here's one with an obvious X-wing --
      [ 58 clues ]
Code: Select all
 . . . | 9 7 4 | . 6 .
 4 1 6 | 5 3 8 | 9 7 2
 . 7 . | 1 6 2 | 4 3 .
-------+-------+------
 7 2 4 | 8 1 9 | 3 5 6
 1 5 3 | 2 4 6 | 7 . .
 6 9 8 | 7 5 3 | 2 1 4
-------+-------+------
 . 4 . | 3 9 1 | 6 2 .
 . . 1 | 6 . 7 | 5 4 .
 . 6 . | 4 . 5 | . . .


for more X-wing puzzles,
see: "A Pure X-Wing Collection"


here's a Swordfish example --
tso wrote:
      [ 27 clues ]
Code: Select all
 9 . . | 4 . . | 7 . .
 . 6 . | . 3 . | . 5 .
 . . 1 | . . 8 | . . 4
-------+-------+------
 2 . . | 8 . . | 1 . .
 . 3 . | . 4 . | . 7 .
 . . 7 | . . 9 | . . 5
-------+-------+------
 5 . . | 6 . . | 2 . .
 . 2 . | . 8 . | . 9 .
 . . 6 | . . 1 | . . 3

User avatar
Pat
 
Posts: 4056
Joined: 18 July 2005

Postby Morgoth » Mon Mar 26, 2007 11:15 am

Here are 10 puzzles where the most difficult required technique is Swordfish.

Code: Select all
901000406000800050600050003000704030409000000020600000300000500080502060000000104
407080302020005000000030000070006090601020408000300000003000800040200000906010204
601000200000200000700000009050108000000020100080000070200070403000003080900060700
503000009040005010801070304030100020400030607000000080709000008000400000300050000
001070000060009020400000003010802090000000500090005080002010600000207050308000000
002080900030006040000000000090405000608000000020700090105000600040007000009000100
009000403000006000003000207000001000008040602000708030504020809080005000100000000
009050601070009050100000200080503000001000008050004020308070000060400000007000102
900020100030000000402050906050700000804000002060005040500000208000008030600010004
000000600000105070000030409020700000809000004010000000300040005060001020008060301


And here are the more interesting 10 - Jellyfish

Code: Select all
009060700040200000607030204000000000208070003000801020306000005000003080800090007
020460000800010000300000720000001604602050080000000000000000058480006032015000000
001000000940000072002000600000060004158030009700000000500704000000690003000000210
000090070800004000050100200000007010408005000002000809006000007005400006700300045
002601000050000040000080000830500010000700000000060000009002078004000100006300005
007000200009160003200000000000020509000007080000306000700003600900000830620050700
002900100048000000000000200029005700000003608030002009000200906470600000000504000
102003700000500040060000000000004650590000008008000200000085060080701304700600000
040000000000079003086100900100000500000600080905000607000810400000007090050060000
080000050003000096000463001090000018000027365000000000600050004100030000050704000


Keep in mind that Jellyfish is rated as more difficult as Unique Loops, XY-Wing, XYZ-Wing and Hidden Quad. You may need to use some of these techniques to reach the Jellyfish
Morgoth
 
Posts: 20
Joined: 06 December 2005

Postby mooker » Mon Mar 26, 2007 11:48 am

Thanks very much for the quick replies and examples! I'll get out my trusty sudoku pencil and give these a shot!! I appreciate everyone's help!
mooker
 
Posts: 8
Joined: 15 December 2006

Postby Myth Jellies » Tue Mar 27, 2007 4:01 am

My favorite way of looking at an x-wing/swordfish/jellyfish is to think of N rows intersecting with N columns. Think of the intersection cells as a fish group. For that fish group to be true, it must have N true candidates. When the fish group is true, then all of the cells that share a row or a column with the fish group cannot be that candidate. Conversely, if the fish group is false, then at least one candidate in a cell outside the fish group sharing a row with the fish group must be true. Also when the fish group is false, at least one candidate in a cell outside the fish group sharing a column with the fish group must be true. Note that if in one of these cases (rows or columns) there are no available outside candidates to share with the fish group, then the fish group must be true and you can immediately make any remaining fish group eliminations.

Thinking of x-wing/swordfish/jellyfish in this way will make it much easier to understand the finned x-wing/swordfish/jellyfish.
Myth Jellies
 
Posts: 593
Joined: 19 September 2005

Postby mooker » Tue Mar 27, 2007 6:38 pm

MythJellies: I'm trying to wrap my mind around your description, but I'm really struggling. I want to understand it, because I feel like if I can, I'll be able to understand the whole concept better. Could you possibly illustrate your point with a sample puzzle?

Thanks!
mooker
 
Posts: 8
Joined: 15 December 2006

Postby ronk » Tue Mar 27, 2007 7:49 pm

mooker wrote:MythJellies: I'm trying to wrap my mind around your description, but I'm really struggling.

It helps to realize "fish group" means the candidates within the intersection of the rows and columns. And for a fish defined by rows, "outside the fish group" means candidates in the columns but not within the row/col intersection.

Not as good as an illustration, I know, but it should help some.
ronk
2012 Supporter
 
Posts: 4764
Joined: 02 November 2005
Location: Southeastern USA

Postby Myth Jellies » Wed Mar 28, 2007 4:37 am

Lets start with the first one on Morgoth's list. At some point using the most basic methods you could get to here.
Code: Select all
 *--------------------------------------------------------------------*
 | 9      5      1      | 23     237    37     | 4      8      6      |
 | 27     347    2347   | 8      1469   169    | 79     5      179    |
 | 6      47     8      | 149    5      19     | 2      179    3      |
 |----------------------+----------------------+----------------------|
 | 158    16     56     | 7      1289   4      | 689    3      1259   |
 | 4      1367   9      | 123    1238   1358   | 678    17     1257   |
 | 1578   2      357    | 6      1389   13589  | 789    4      1579   |
 |----------------------+----------------------+----------------------|
 | 3      14679  2467   | 149    14679  1679   | 5      279    8      |
 | 17     8      47     | 5      1479   2      | 3      6      79     |
 | 257    679    2567   | 39     36789  36789  | 1      279    4      |
 *--------------------------------------------------------------------*

I'm going to remove the clutter and filter on the nines
Code: Select all
*--------------------------*
| 9  .  .| .  .  .| .  .  .|
| .  .  .| .  9  9| 9  .  9|
| .  .  .| 9  .  9| .  9  .|
|--------+--------+--------|
| .  .  .| .  9  .| 9  .  9|
| .  .  9| .  .  .| .  .  .|
| .  .  .| .  9  9| 9  .  9|
|--------+--------+--------|
| .  9  .| 9  9  9| .  9  .|
| .  .  .| .  9  .| .  .  9|
| .  9  .| 9  9  9| .  9  .|
*--------------------------*

Lets look at an x-wing first. Try the one formed by the intersection of r37 and c68.
Code: Select all
*--------------------------*
| 9  .  .| .  .  .| .  .  .|
| .  .  .| .  9 %9| 9  .  9|
| .  .  .|#9  . *9| . *9  .|
|--------+--------+--------|
| .  .  .| .  9  .| 9  .  9|
| .  .  9| .  .  .| .  .  .|
| .  .  .| .  9 %9| 9  .  9|
|--------+--------+--------|
| . #9  .|#9 #9 *9| . *9  .|
| .  .  .| .  9  .| .  .  9|
| .  9  .| 9  9 %9| . %9  .|
*--------------------------*

Now either the x-wing group (marked with stars) is true (has two true candidates), or both the group of candidates marked with '#' and the group marked with '%' must each have at least one true candidate. This doesn't look very promising, so lets try a different one. How about r79 & c28.
Code: Select all
*--------------------------*
| 9  .  .| .  .  .| .  .  .|
| .  .  .| .  9  9| 9  .  9|
| .  .  .| 9  .  9| . %9  .|
|--------+--------+--------|
| .  .  .| .  9  .| 9  .  9|
| .  .  9| .  .  .| .  .  .|
| .  .  .| .  9  9| 9  .  9|
|--------+--------+--------|
| . *9  .|#9 #9 #9| . *9  .|
| .  .  .| .  9  .| .  .  9|
| . *9  .|#9 #9 #9| . *9  .|
*--------------------------*

Either the x-wing group is true or one of the candidates marked with '#', and the single candidate marked with '%' must be true. We are getting closer. Perhaps if we added another row and column. Try the intersection of r379 and c248
Code: Select all
*--------------------------*
| 9  .  .| .  .  .| .  .  .|
| .  .  .| .  9  9| 9  .  9|
| . *.  .|*9  . #9| . *9  .|
|--------+--------+--------|
| .  .  .| .  9  .| 9  .  9|
| .  .  9| .  .  .| .  .  .|
| .  .  .| .  9  9| 9  .  9|
|--------+--------+--------|
| . *9  .|*9 #9 #9| . *9  .|
| .  .  .| .  9  .| .  .  9|
| . *9  .|*9 #9 #9| . *9  .|
*--------------------------*

Now either the swordfish group has three true candidates, or at least one of the candidates marked with a '#' and at least one of the candidates marked with a '%' must be true. But there are no candidates sharing a column with the swordfish, so there are no candidates marked with a '%'. Therefore the swordfish must be true and you can eliminate all of the candidates marked with '#'. Note as well that it doesn't matter to us if some of the intersection cells do not contain a 9. In the case of a swordfish, there just has to be enough of them to hold three 9's.

We also have a finned x-wing example in this grid, lets take a look at the x-wing group formed from the intersection of r48 and c59.
Code: Select all
*--------------------------*
| 9  .  .| .  .  .| .  .  .|
| .  .  .| . %9  9| 9  . %9|
| .  .  .| 9  .  9| .  9  .|
|--------+--------+--------|
| .  .  .| . *9  .|#9  . *9|
| .  .  9| .  .  .| .  .  .|
| .  .  .| . %9  9| 9  . %9|
|--------+--------+--------|
| .  9  .| 9 %9  9| .  9  .|
| .  .  .| . *9  .| .  . *9|
| .  9  .| 9 %9  9| .  9  .|
*--------------------------*

Note that we once again have a case where either the x-wing is true, or a single outside candidate, this time marked with '#', is true. Notice that whichever one is true (x-wing or r4c7 in sharing a box) you still get to remove the 9 in r6c9. This is an example of a finned x-wing, and they are not too hard to find when you are searching for fish groups. Note that this would work even if you had the following...
Code: Select all
*--------------------------*
| 9  .  .| .  .  .| .  .  .|
| .  .  .| . %9  9| 9  . %9|
| .  .  .| 9  .  9| .  9  .|
|--------+--------+--------|
| .  .  .| . *9  .|#9 #9 *9|
| .  .  9| .  .  .| .  .  .|
| .  .  .| . %9  9| 9  . %9|
|--------+--------+--------|
| .  9  .| 9 %9  9| .  9  .|
| .  .  .| . *9  .| .  . *9|
| .  9  .| 9 %9  9| .  9  .|
*--------------------------*

The added nine in r4c8 gives us an extra choice sharing a row with our x-group, but either choice still eliminates the nine in r6c9 as does the x-wing. Our r379/c248 swordfish is spoiled in this new grid, but the finned x-wing deduction survives.

The finned concept works for any sized constraint group. Check out our r379/c248 swordfish in this final modified grid...
Code: Select all
*--------------------------*
| 9  .  .| .  .  .| .  .  .|
| .  .  .| .  9  9| 9  .  9|
| . *.  .|*9  . #9| . *9  .|
|--------+--------+--------|
| .  .  .| .  9  .| 9  .  9|
| .  .  9| .  .  .| .  .  .|
| .  .  .| .  9  9| 9  .  9|
|--------+--------+--------|
| . *9  .|*9 #9 #9| . *9  .|
| .  .  .|%9  9  .| .  .  9|
| . *9  .|*9 #9 #9| . *9  .|
*--------------------------*

The added 9 in r8c4 on this grid messes up the swordfish a little bit, but not much. Either the swordfish is true, or the "fin" in r8c4 is true. Either way, with this finned swordfish you still get to remove all four 9's from r79c56.

Happy fishing.
Myth Jellies
 
Posts: 593
Joined: 19 September 2005

Postby daj95376 » Wed Mar 28, 2007 5:15 am

Since mooker understands the strategy of basic fish, asking for additional puzzles for practice sounds wise. Since he has Simple Sudoku at his disposal, I'm assuming that he's done all of the X-Wing and Swordfish puzzles provided by Angus Johnson.

I don't have any advice on how to spot fish -- basic or otherwise. I find anything above an X-Wing very difficult to locate on my own.
daj95376
2014 Supporter
 
Posts: 2624
Joined: 15 May 2006

Postby mooker » Mon Apr 02, 2007 8:47 pm

Thank you Myth Jellies and everyone that posted in this thread.

As daj95376 correctly assumed, I'm having trouble "seeing" the swordfish. I can spot x-wings okay, but the swordfish is what's tripping me up.

I think I'll read Andrew's chapter on Jellyfish and then complete the above exercises. I'll get it yet!! I think it's one of those things that once you get it, you can see them easier (kind of like those magic eye puzzles!)

Thanks again! I'm sure I'll be posting in the future for more help and theory questions.
mooker
 
Posts: 8
Joined: 15 December 2006

Postby daj95376 » Mon Apr 02, 2007 11:38 pm

mooker,

Correction: I do have advice on how to spot basic fish. Start your search in units with only two candidates for a value. Then look for another bi-location unit with at least one cell location in common with the first unit. If the two units aren't equal, then you don't have an X-Wing but you may have a Swordfish; so you need to look for another bi-location unit that has two cells in common with the cells from the first two units. If you don't find a Swordfish, then you can search for another bi-location unit that matches cell locations from the previous three units. If you find it, then you have a Jellyfish.

Why did I suggest that you only concentrate on bi-location cells? If you count the number of possible candiates in each unit of an X-Wing, Swordfish, and Jellyfish; and then sort them, then you end up with the following range of counts possible.

Code: Select all
X-Wing:    22                 -- only one case, so it appears with equal probability
Swordfish: 222  223  ... 333  -- the first is most common and the last is extremely rare
Jellyfish: 2222 2223 ... 4444 -- the first is most common and the last is extremely rare

Eventually, you might start catching patterns where one or more units have more than two cells for a candidate. Just remember, you can ignore all units with more than four cells for a candidate.

Happy Fishing, daj95376

Now, watch, someone will say I'm wrong about the 222 and the 2222 combinations being most common. Oh Well!
daj95376
2014 Supporter
 
Posts: 2624
Joined: 15 May 2006

Postby Myth Jellies » Tue Apr 03, 2007 6:53 am

daj95376 wrote:Now, watch, someone will say I'm wrong about the 222 and the 2222 combinations being most common. Oh Well!


Suffice it to say that only the rarest of fish will not have at least one bilocation pair. Your method will work fine in finding a marker for 223 and even 233 combinations as well.

Some theoretical stats, for grins and giggles:

For a r258/c258 swordfish there are only 6 viable 222 swordfish configurations, 18 viable 223 configurations, 9 viable 233 configurations, and 1 viable 333 configuration.

The number of viable configurations is not the only factor determining how rare a configuration is--configurations requiring more cells seem to be more difficult to achieve, especially after other basic methods have been resolved--but it is a factor, and I would guess that the 223 swordfish configuration is most common.
Myth Jellies
 
Posts: 593
Joined: 19 September 2005

re: Swordfish statistics

Postby Pat » Thu Apr 05, 2007 6:45 am

Myth Jellies wrote:I would guess that the 223 swordfish configuration is most common

that may make sense,
yet here are the reported statistics (in one small test) --
daj95376 wrote:
    Of 965 puzzles generated,
    I found 521 Swordfish
    with the following distribution for each type.
    (note: Some puzzles had more than one Swordfish.)
Code: Select all
222: 309
223: 167
233:  42
333:   3


User avatar
Pat
 
Posts: 4056
Joined: 18 July 2005

Re: re: Swordfish statistics

Postby Morgoth » Thu Apr 05, 2007 11:40 am

222: 309
223: 167
233: 42
333: 3


I suppose the distribution will be different if the Swordfish is evaluated with lower difficulty and it is the first used method:)
Morgoth
 
Posts: 20
Joined: 06 December 2005


Return to Help with puzzles and solving techniques