The Logic of Sudoku - Anderbokanderbok.se/Logic/proofread0.doc  · Web viewThe word “elegant”...

199
Contents Foreword by Michael Mepham xi PART I – What do we know about sudoku? 1 Known and Unknown in Sudoku 1.1 How Many Sudoku Puzzles Are There? 3 1.2 What is the Minimum Number of Clues? 4 1.3 Logical Strategies and Trial and Error 5 PART II – Basic Strategies 2 Starting Out 11 3 Naked Pairs 14 4 Naked Triples 16 5 Naked Quads 18 6 Hidden Pairs 20 7 Hidden Triples 22 8 Hidden Quads 24 9 Pointing Pairs 25 10 Box/Line Reduction 27 PART III – Chains of Reason 11 The X-Wing Family 31 12 Sword-Fish 35 13 Jelly-Fish 40 14 Generalizing X-Wing 42 15 Seeing is Believing 43 16 Simple Colouring (or Chains) 44 17 Multi-Colouring 48 17.1 Type 1 Multi-Colouring 49 17.2 Type 2 Multi-Colouring 50 18 Y-Wing Strategy 53 19 XYZ-Wing Strategy 56 20 WXYZ-Wing Strategy 59 21 Y-Wing Chains 60 22 XY-Chain Strategy 62 Innehåll Förord av Michael Mepham DEL I – Vad känner vi till om sudoku? 1 Känt och okänt om sudoku 1.1 Hur många sudokuer finns det? 1.2 Vad är det minsta antalet givna? 1.3 Logiska metoder och uteslutningsmetoder DEL II – Enkla metoder 2 Kom igång – singlar 3 Nakna par 4 Nakna tripplar 5 Nakna fyrtal 6 Dolda par 7 Dolda tripplar 8 Dolda fyrtal 9 Pekande par och tripplar 10 Snitt på boxar DEL III – Kedjereaktioner 11 Singelvingar 12 3-vinge 13 4-vinge 14 Andra sorters 2-vingar 15 Att se andra celler 16 Enkla kedjor (färgning) 17 Multipla kedjor (flerfärgning) 17.1 Multipla kedjor, typ 1 17.2 Multipla kedjor, typ 2 18 xy-vingar 19 xyz-vingar 20 wxy-vinge och wxyz-vinge 21 Kedjor med xy-vingar 22 xy-kedjor 3

Transcript of The Logic of Sudoku - Anderbokanderbok.se/Logic/proofread0.doc  · Web viewThe word “elegant”...

The Logic of Sudoku

Contents

Foreword by Michael Mepham xi

PART I – What do we know about sudoku?1Known and Unknown in Sudoku

1.1How Many Sudoku Puzzles Are There? 3

1.2What is the Minimum Number of Clues? 4

1.3Logical Strategies and Trial and Error5

PART II – Basic Strategies2Starting Out113Naked Pairs144Naked Triples165Naked Quads186Hidden Pairs207Hidden Triples228Hidden Quads249Pointing Pairs2510Box/Line Reduction27

PART III – Chains of Reason11The X-Wing Family3112Sword-Fish 3513Jelly-Fish4014Generalizing X-Wing 4215Seeing is Believing 4316Simple Colouring (or Chains)4417Multi-Colouring48

17.1Type 1 Multi-Colouring49

17.2Type 2 Multi-Colouring5018Y-Wing Strategy5319XYZ-Wing Strategy5620WXYZ-Wing Strategy5921Y-Wing Chains 6022XY-Chain Strategy 62

Innehåll

Förord av Michael Mepham

DEL I – Vad känner vi till om sudoku?1Känt och okänt om sudoku

1.1Hur många sudokuer finns det?

1.2Vad är det minsta antalet givna?

1.3Logiska metoder och uteslutningsmetoder

DEL II – Enkla metoder2Kom igång – singlar3Nakna par4Nakna tripplar5Nakna fyrtal6Dolda par7Dolda tripplar8Dolda fyrtal 9Pekande par och tripplar10Snitt på boxar

DEL III – Kedjereaktioner 11Singelvingar123-vinge134-vinge14Andra sorters 2-vingar15Att se andra celler16Enkla kedjor (färgning)17Multipla kedjor (flerfärgning)

17.1Multipla kedjor, typ 1

17.2Multipla kedjor, typ 218xy-vingar19xyz-vingar20wxy-vinge och wxyz-vinge 21Kedjor med xy-vingar22xy-kedjor

23Remote Pairs 6624Forcing Chains68 24.1The Dual Forcing Chain70 24.2 The Triple Forcing Chain7125X-Cycles – Introducing Nice Loops73 25.1 Nice Loop Rule 175 25.2 Discontinuous X-Cycles76 25.3 Nice Loop Rule 277 25.4 Nice Loop Rule 378 25.5 Stirring It Up: Strong Links Can Be Weak Links8026Grouped X-Cycles8327Alternating Inference Chains (AICs)88 28Grouped AICs9529 Almost Locked Sets (ALSs)98 29.1 The Almost Locked Set XZ Rule9930 Almost Locked Sets in Chains102

PART IV – Exotic Strategies31 Finned and Filleted X-Wings107 31.1 The Sashimi Observation10932 Pattern Overlay Method (POM)11033 Fillet-o-Fish Strategy116 33.1 Filleting Generalized11934 Aligned Pair Exclusion (APE)120 34.1 Extended Aligned Pair Exclusion12235 Empty Rectangles12536Sue-de-Coq13037Death Blossom134

PART V – Uniqueness Strategies38 Unique Rectangles139 38.1 Spotting the Deadly Pattern 139 38.2 Type 1 Unique Rectangles140 38.3 Type 2 Unique Rectangles142 38.4 Type 2b Unique Rectangles144 38.5 Type 3 Unique Rectangles145

23Parkedjor24Tvingande kedjor 24.1 Tvåvärda tvingande kedjor 24.2 Trevärda tvingande kedjor25 Singelslingor – Introduktion till växelslingor 25.1Växelslingor, regel 1 25.2 Diskontinuerliga singelslingor 25.3 Växelslingor, regel 2 25.4 Växelslingor, regel 3 25.5 Nu rör vi till det: starka länkar kan vara svaga länkar26Grupperade singelslingor27Alternerande kedjor 28Grupperade alternerande kedjor29 Nästan matchande mängder (ALS:er) 29.1 XZ-regeln för ALS30 Nästan matchande mängder i kedjor

DEL IV – Exotiska metoder 31 Begränsade 2-vingar 31.1 Saknade hörn32 Singelmönster (POM)33 Begränsade 3-vingar 33.1 Andra armar och saknade hörn 34 Uteslutande linjepar (APE) 34.1 Utvidgad APE35 Tomma rektanglar36Sue-de-Coq37Dödsblomman

DEL V – Unik-metoder38 Unik-rektanglar 38.1 Att upptäcka det dödliga mönstret 38.2 Unik-rektanglar, typ 1 38.3 Unik-rektanglar, typ 2 38.4 Unik-rektanglar, typ 2b 38.5 Unik-rektanglar, typ 3

38.6 Type 4 Unique Rectangles146 38.7 Type 4b Unique Rectangles14839The Hidden Unique Rectangle14940Avoidable Rectangles152 40.1Other Avoidable Rectangles15541 Bi-Value Universal Grave (BUG)156

Addition: Sudoku Puzzles157

PART VI – Jigsaw and Killer Sudoku42 Introduction to Jigsaw Sudoku171 42.1 The Law of Leftovers17143Jigsaw Sudoku Puzzles17644 Introduction to Killer Sudoku18245 Cell Combinations Strategy18246 Innies and Outies18447 Cage Splitting18748Killer Sudoku Puzzles188

PART VII – Solutions and Answers

Rev: Answers and Solutions

49Exercise Answers20850Exercise Solutions22051Sudoku Solutions22252Jigsaw Sudoku Solutions22853Killer Sudoku Solutions23054Beyond This Book234 Acknowledgements235 Appendix A: The Rules of Sudoku236 Appendix B: A Quick Glossary242

3D Medusa

38.6 Unik-rektanglar, typ 4 38.7 Unik-rektanglar, typ 4b39 Dold unik-rektangel40 Undvikbara rektanglar 40.1Andra undvikbara rektanglar41 Tvåvärdesgrav (BUG)

Diverse sudokuer

DEL VI – Pussel- och extremsudoku42 Introduktion till pusselsudoku 42.1 Regeln om överskjutande celler (”Leftovers”)43Pusselsudoku-spel44 Introduktion till extremsudoku45 Celler i samverkan 46 Inåt och utåt47 Delade hagar48Extremsudoku-spel

DEL VII – Svar och lösningar

49Svar till övningar50Lösningar till övningar51Sudoku-lösningar52Pusselsudoku-lösningar53Extremsudoku-lösningar54Vidare läsning Författarens tack Appendix A: Sudokumetoder i sammanfattning Appendix B: Snabblexikon

Medusametoden (nytt kapitel hämtat från internet)

Foreword

This book marks something of a watershed in the history of sudoku. The puzzle has been around since the mid-1980s, but it wasn’t until early in 2005 that it reached super-puzzle status world wide, and it was at this time that people like me began to look at the puzzle seriously. From the beginning of my association with the puzzle there were some things that I believed should always be true about a sudoku puzzle.

Perhaps they may not seem very ambitious now, but at the time they were setting standards. First, I felt that I should be able to guarantee that each puzzle should have a unique solution. Secondly, I set a limit on the number of clues in each sudoku and thirdly, I ensured that all my puzzles were aesthetically pleasing to look at; in other words, the pattern of clues should always be symmetrical. The only other feature that I imposed on my sudoku was that it should be graded for difficulty – easy to wish for, but not so easy to achieve.

In addition to these important features of the puzzle itself, I aimed to provide as much information about the puzzle, and how it might be solved, for the millions of puzzlers who were being introduced to sudoku each day. This was the beginning of sudoku.org.uk – a single web page of information when it was launched in February 2005. It is now one of the top sites on the web, featuring news, daily competitions, information, a sudoku helper and a forum that is visited by solvers from around the world.

Rev: as much information as I possibly could about the puzzle,

It was through the website that I first met Andrew Stuart. He had begun to add sudoku-related features to his own website including a “sudoku helper” – a step-by-step solver that showed what logic was necessary to solve particular numbers. I was so impressed with his work that I was very keen to bring him and his software into the sudoku.org.uk fold. My days were filled with producing puzzles that went into books, magazines and newspapers and, although I had done a considerable amount of work on sudoku programming in the very early days, I could see that to keep up the momentum it would take someone else with more programming skills than mine. Andrew fitted the bill perfectly. As a programmer of 20 years’ experience with a keen interest in the logic of puzzles, he brought exactly the right mix of technical skills to MM Multimedia, the company we formed to produce high-quality logic puzzles and electronic games.

One of the most difficult tasks in creating sudoku is to grade the puzzle accurately. The only way that it can be achieved properly is to solve the puzzle in the same way as a human might do it. But when one is creating hundreds of puzzles this is not a job that can sensibly be done by a human being. What is needed is computer software to emulate human methods: to search for groups of numbers that fit the patterns that allow for certain strategies to be used. Of course, this has to be done in a logical way: it would be senseless to grade a puzzle as difficult because a high-end strategy is found early on,

Förord

Den här boken är något av en vattendelare i historien om sudoku. Det här sifferpusslet har funnits sedan mitten av 1980-talet, men det var inte förrän i början av 2005 som det blev riktigt populärt och fick spridning över hela världen. Det var också vid den här tiden som människor som jag började titta på sudoku på allvar. Redan från början var det några saker, som jag tyckte alltid skulle gälla för en sudoku.

Dessa kanske inte verkar särskilt ambitiösa nu, men vid den här tiden satte de en ny standard. För det första tyckte jag att jag borde garantera att varje pussel ska ha en unik lösning. För det andra satte jag en gräns för antalet givna siffror i varje sudoku, och för det tredje såg jag till att alla mina pussel var estetiskt tilltalande att titta på; med andra ord att mönstret av givna alltid skulle vara symmetriskt. Den enda ytterligare egenskapen, som jag krävde för mina sudokuer, var att de skulle vara svårighetsgraderade – lätt att önska sig, men inte lika lätt att åstadkomma.

Förutom dessa viktiga egenskaper hos själva sudokun, försökte jag förse de miljoner av lösare, som dagligen fick kännedom om sudoku, med så mycket information som möjligt om pusslet och hur man löser det. Det här var början på sudoku.org.uk – en enstaka nätsida med information när den lancerades i februari 2005. Den är nu en av toppsajterna på nätet, med nyheter, dagliga tävlingar, information, en sudokulösare och ett forum som besöks av lösare från hela världen.

Det var genom nätplatsen som jag först träffade Andrew Stuart. Han hade börjat lägga upp sudokurelaterat material på sin egen nätplats, inklusive en ”sudoku helper” – en stegvis lösare som visar de logiska förutsättningarna för att lösa särskilda siffror. Jag var så imponerad av hans arbete, att jag väldigt gärna ville få honom och hans programvara under samma tak som sudoku.org.uk. Mina dagar fylldes av att producera pussel till böcker, tidskrifter och dagstidningar. Trots att jag hade gjort en hel del sudokuprogrammering i det tidiga skedet, förstod jag att för att hålla farten uppe skulle det krävas någon med större programmeringsskicklighet än jag hade. Andrew passade specifikationen perfekt. Som programmerare med 20 års erfarenhet och med ett nyfiket intresse för pussellogik, tog han med sig exakt rätt blandning av tekniska färdigheter till MM Multimedia, företaget som vi bildade för att skapa logiska pussel och elektroniska spel av hög kvalitet.

En av de svåraste uppgifterna när man skapar en sudoku är att göra en korrekt svårighetsgradering. Det enda sättet att göra detta riktigt bra, är att lösa sudokun på samma sätt som en människa kan tänkas göra det. Men när man skapar hundratals pussel, är detta inte en uppgift som rimligen kan utföras av en mänsklig individ. Vad som behövs är ett datorprogram som efterliknar mänskliga tänkesätt: att leta efter grupper av siffror, som bildar mönster, som gör att vissa metoder kan användas. Naturligtvis måste detta göras på ett logiskt vis: det skulle vara huvudlöst att gradera ett pussel som svårt, för att

when much easier schemes might have solved it well before the high-end strategy had been reached.

Within months Andrew had created the core algorithms that formed the basis of this book and they had been coded into software that could grade the vast majority of sudoku to a high degree of accuracy. Now, more than a year on, that nucleus of 30 strategies has grown to nearly 60 schemes that are included in the software that grades my sudoku and which we are now publishing for the first time in this volume.

I know that this book by Andrew Stuart will answer many of your questions, but the aim is to enhance your enjoyment of sudoku. If you could only manage moderate level puzzles before, this book will allow you to see how it may be possible to solve those diabolical and fiendish puzzles. I hope you will.

Happy solving!

Michael MephamFrome, Somerset, UK

November 2006

en komplicerad metod hittas tidigt, när mycket enklare tekniker leder till lösningen långt innan den komplicerade metoden behövs.

Inom några månader hade Andrew skapat de viktigaste algoritmerna, som utgjorde grunden till den här boken, och kodat dem till en mjukvara som kunde gradera den överväldigande majoriteten av sudokuerna med bra precision. Nu, mer än ett år senare, har kärnan av 30 metoder växt till nästan 60, som finns med i mjukvaran som graderar mina sudokuer, och som vi nu publicerar för första gången i den här skriften.

Jag vet att den här boken av Andrew Stuart kommer att svara på många av dina frågor, men syftet är att du ska ha mer glädje av sudoku. Om du tidigare bara klarade måttligt svåra sudokuer, kommer den här boken att låta dig förstå hur man kan lösa ”djävulska” eller jättesvåra pussel. Jag hoppas att du klarar det.

Njut nu av lösandet!

Michael MephamFrome, Somerset, Storbritannien

November 2006

1 The Known and Unknown of Sudoku

A sudoku puzzle is one of the deepest logical objects discovered in recent decades – or rather re-discovered, since it has been around from the time of the 18th-century mathematician Euler and, for a while, has existed independently among popular puzzles in Japan. Its true depth, however, was realized only at the start of 2005, when puzzle-solving minds had a chance to tackle high-quality examples published in newspapers in the West. Solvers have been motivated by a desire to impose a logical solution for any puzzle, but for every one felled with deft logic, more appear which defy any strategy. Are we ever going to arrive at a grand theory of sudoku? This is a great unknown. This book will outline where we are and what we need to build on. By doing so, it will not only arm you with the tools to challenge any sudoku you might find in a book or newspaper, but also equip you to take on the unknown.

Rev: from the time of the Swiss 18th-century mathematician Leonhard Euler

Rev: which defy any known strategy.

1.1 How Many Sudoku Puzzles Are There?

This is a popular question, but before we can attempt an answer we need to be clear about a few things. In fact, there are two questions here: how many completed sudoku boards are there, and how many possible puzzles can be derived from them? Bertram Felgenhauer used a brute force computer search to find

6,670,903,752,021,072,936,960

filled sudoku boards – an impressive number. But are all these sudokus really different? If we rotate a sudoku 90º, isn’t it really just the same sudoku? To answer our ambiguous question, let’s accept that Felgenhauer’s number is the upper bound and then try to find out how many essentially different sudokus there are. To do this we need to appreciate a couple of things about the board. Firstly:

Rev: The question of how many different puzzles there are is popular, but

(bad writing style to refer directly to the headline)

□We can transpose all the numbers and the puzzle or the board will remain essentially the same. For example, we can add 1 to all the numbers and make 9 equal to 1. Does this constitute a new sudoku? Most people would say it does not.

1 Känt och okänt om sudoku

En sudoku är ett av de djupsinnigaste logiska objekt, som upptäckts de senaste decennierna – eller snarare återupptäckts, eftersom den har funnits sedan den schweiziske 1700-talsmatematikern Leonhard Eulers tid, och oberoende av detta har varit ett av flera populära sifferpussel i Japan ett tag. Dess verkliga logiska djup upptäcktes dock först i början av 2005, när pussellösare i västvärlden fick chansen att ge sig i kast med högkvalitativa exempel i dagstidningar. En önskan att hitta en logisk lösning till varje pussel har motiverat lösare, men för varje sudoku som avverkas med skickligt tillämpad logik, dyker nya upp som motstår alla kända metoder. Kommer vi någonsin fram till en fullständig teori för sudoku? Detta är stor okänd fråga. Den här boken ska skildra var vi är idag, och vad vi behöver bygga vidare på. Detta kommer inte bara att ge dig verktygen för att ge dig i kast med varje sudoku du hittar i en bok eller tidning, utan också utrusta dig för att utmana det okända.

Översättarens anmärkning: Jag använder böjningsmönstret en sudoku, sudokun, flera sudokuer, sudokuerna. Det finns flera andra förekommande paradigm t.ex. en sudoku, sudokun, flera sudoku, sudokuna eller ett sudoku, sudokut, flera sudokun, sudokuna.

1.1 Hur många sudokuer finns det?

Frågan om hur många olika sudokuer det finns är vanlig, men innan vi försöker besvara den behöver vi klargöra några saker. Det finns faktiskt två frågor här: hur många fulla spelplaner finns det, och hur många sudokupussel kan man få från dem? Bertram Felgenhauer använde ren datorkraft (eng. brute force) för en sökning och hittade

6 670 903 752 021 072 936 960

helt ifyllda sudokuplaner – ett imponerande tal. Men är alla dessa sudokuer verkligen olika? Om vi roterar en sudoku 90º, är det då inte samma sudoku egentligen? För att svara på vår tvetydiga fråga, låt oss ta Felgenhauers siffra som en övre gräns och sedan försöka utröna hur många väsentligen olika sudokuer det finns. För detta behöver vi förstå några av spelplanens egenskaper. För det första:

□Vi kan kasta om ordningen på siffrorna och pusslet eller spelplanen blir ändå väsentligen likadan. Till exempel kan vi addera 1 till siffrorna och sätta 9 till 1. Är det här en ny sudoku? De flesta skulle svara nej.

Now there are 9! (factorial) ways to arrange nine numbers, which means that the lower bound is immediately 362,880 times smaller than the upper.

The second interesting observation about sudoku is easy to understand if we use the sudoku term “chute” – which is three boxes that contain either three whole rows or three whole columns. There are six chutes on a 9 x 9 board. The observation is:

□Rows can be swapped with other rows and columns can be swapped with other columns provided that either1) the swapping occurs within the same chute, or2) entire chutes are swapped.

We can move the central three columns, for example, and put them on the left. This can mess up a symmetrical puzzle, but the solve route will be identical, so the puzzle will be essentially the same.

Finally, we have rotation, reflection, and symmetry. Fortunately, valid sudoku boards are not naturally symmetrical, so we don’t have a choice there. We have four ways to rotate the board, and the reflections (horizontally, vertically, and down the two diagonals) add up to four as well. Not including re-labelling, it has been shown that there are 3,359,232 symmetries.1 Many of these lead to the same grid, so further juggling gives

5,472,730,538

essentially different sudoku grids, which is our lower bound.

Rev: 3,359,232 (= 68 × 2) symmetries

Rev: Some of these lead to the same grid (possibly after re-labelling), so

Note to Andrew S: We should mention the other part, how many puzzles can be derived from one full board. It differs a lot, but counting only minimal (irreducible) sudokus, most range between 4e14 and 2e16 and nearly all between 2e14 and 3e16. I don’t have processor capacity to check all the 5,472,730,538 boards, so I have mainly checked a random sample and the most symmetrical ones.

1.2 What is the Minimum Number of Clues?

Nobody has ever created a normal sudoku puzzle with 16 clues with the important property of having just one solution, but many thousands exist with 17 clues.

Rev: but about 50,000 exist Nu finns det 9! (nio fakultet) sätt att ordna nio tal, vilket betyder att den undre gränsen omedelbart blir 362 880 gånger mindre än den övre.

Den andra intressanta egenskapen hos sudoku är lätt att förstå om vi använder begreppen boxrad och boxkolumn – som är tre boxar som innehåller tre hela rader eller tre hela kolumner. Det finns sex boxrader/boxkolumner på en 9 × 9-spelplan. Det intressanta är nu:

□Rader kan byta plats med andra rader och kolumner kan byta plats med andra kolumner förutsatt att antingen(1) raderna eller kolumnerna är inom samma boxrad/boxkolumn, eller(2) hela boxrader eller boxkolumner byter plats.

Vi kan till exempel flytta de tre mittenkolumnerna, och sätta dem till vänster. Det här kan förstöra symmetrin i ett pussel, men stegen i lösningen blir precis desamma, så sudokun är väsentligen likadan.

Till slut har vi rotation, spegling och symmetri. Lyckligtvis är giltiga sudokuplaner inte naturligt symmetriska, så vi har inget val där. Det finns fyra sätt att rotera spelplanen, och de möjliga speglingarna (horisontellt, vertikalt och längs diagonalerna) är också fyra. (*) Förutom omnumrering av siffrorna, kan man visa att det finns 3 359 232 (= 68 ∙ 2) symmetrier.1 En liten del av dessa leder till samma mönster (eventuellt efter omnumrering), varför slutresultatet blir

5 472 730 538

väsentligen olika fulla sudoku-planer, vilket är vår undre gräns. (*)

(*) Men det är bara spegling i en av diagonalerna, alltså att låta rader bli kolumner och omvänt, som tillför något nytt. Övriga speglingar och rotationer fås genom omkastningar av rader eller kolumner. Övers. anm.

(*) Den andra frågan, hur många pussel man kan få från en full spelplan (som alltså ger samma lösning), är betydligt svårare att besvara. Det varierar mycket mellan de drygt fem miljarder olika planerna, men om vi bara räknar minimala (irreducibla) sudokuer, ligger de flesta fulla planer mellan 4 ∙ 1014 och 2 ∙ 1016, och nästan alla mellan 2 ∙ 1014 och 3 ∙ 1016 minimala (enligt mina egna datorberäkningar). En minimal eller irreducibel sudoku är sådan att ingen av de givna siffrorna kan tas bort utan att vi får flera lösningar. Övers. anm.

1.2 Vilket är det minsta antalet givna?

Ingen har någonsin skapat en normal sudoku med 16 givna siffror, med den viktiga egenskapen att ha blott en lösning, men ca 50 000 finns med 17 givna.2

Jigsaw sudoku puzzles allow smaller clue sets to produce puzzles of the same grade. (See Chapter 42 for jigsaws.)

The minimum number of clues for a jigsaw has been computed to be 8, as in the example from www.bumblebeagle.org.2

Such a puzzle can be solved without trial and error but is almost impossible to complete with just pen and paper.

[Figure 1.1]

The following is one of the easiest 17-clue sudokus and should take only about 10 minutes. The answer is at the end of the book.

[Figure 1.2]

1.3 Logical Strategies and Trial and Error

The title of this book asserts that logic is the key ingredient for sudoku puzzle solving. Indeed, we take the greatest satisfaction from solving a puzzle logically and avoid guessing unless we are really stumped. Puzzle creation also involves an equal amount of logic and mental gymnastics to produce pleasing puzzles, so the study of what constitutes a logical step is an important one. However, since arguments have arisen about what is a logical strategy and what is not, “logic” has become a contentious word in sudoku. A better word to use in this sense is “elegant”.

What exactly is the problem with the word “logical”? Before we can tackle this issue, it is important to understand that there are no illogical strategies, just as there are no illogical proofs in math. Every strategy is logical – but not every strategy is good. The word “elegant” allows us to compare strategies and choose the good ones. The best strategies covered in this book are ones that any person can grasp and use on a sudoku puzzle. The aim, after all, is to solve the puzzle as quickly as possible without tripping up.

When sudoku hit the newspaper stands in early 2005, Michael Mepham was the first to help solvers with some of the more difficult puzzles. He coined the metaphor of “Ariadne’s Thread” to describe the strategy of trying a number and using forking (also known as bifurcation). In Cretan myth, Ariadne gave Theseus a long thread to mark his passage around the labyrinth, in this way helping him defeat the Minotaur and retrace his steps. The thread represents the current path. By winding it back, we can backtrack to a previous fork and try another path. If we find a contradiction, then the original “guess” was wrong.

[Figure 1.3]

Rev: in early 2005 (Swedish papers started publishing in June 2005), Pussel-sudoku (eng. jigsaw sudoku) tillåter ett mindre antal givna för att skapa sudokuer av samma svårighetsgrad. (Se kapitel 42 för pusselsudoku.)

Det minimala antalet givna för en pusselsudoku är 8, som i det här exemplet från www.bumblebeagle.org.3

En sådan här pusselsudoku kan lösas utan pröva sig fram (eng. trial and error), men är ändå nästan omöjlig att lösa med endast papper och penna.

[Figur 1.1]

Nedanstående sudoku är en av de lättaste med 17 givna och bör ta ungefär 10 minuter att lösa. Svaret finns i slutet av boken.

[Figur 1.2]

1.3 Logiska metoder och uteslutningsmetoder

Titeln på denna bok gör gällande att logik är den viktigaste beståndsdelen när man löser sudoku. Det är i själva verket så, att vi blir mest nöjda om vi lyckas lösa ett pussel logiskt, och undviker gissningar utom när vi har kört fast ordentligt. Pusselskapande innehåller också stora delar logik och hjärngymnastik för att få fram tilltalande pussel, varför frågan om vad som utgör ett logiskt steg är viktig. Eftersom det har uppstått en debatt om vad som är en logisk metod och vad som inte är det, har emellertid ”logik” blivit ett omstritt ord i sudokuvärlden. Ett bättre ord i detta sammanhang är ”elegant”.

Vad är då problemet med ordet ”logisk”? Innan vi kan angripa den frågan, är det viktigt att förstå att det inte finns några ologiska metoder, precis som det inte finns några ologiska bevis inom matematiken. Alla metoder är logiska – men alla är inte bra. Ordet ”elegant” låter oss jämföra metoder och välja ut de riktigt bra. De bästa metoderna i den här boken är sådana som en människa kan begripa och använda på en sudoku. Målet är i slutändan att lösa pusslet så snabbt som möjligt utan att snubbla på vägen.

När sudoku började publiceras i tidningarna vintern och våren 2005 (svenska tidningar började i juni 2005), var Michael Mepham en av de första som hjälpte lösare med några av de svårare pusslen. Han myntade metaforen”Ariadnes tråd” för att beskriva metoden när man använder förgrening (även kallad bifurkation). I en grekisk myt från Kreta gav Ariadne Theseus en lång tråd för att markera sin väg i labyrinten, och hjälpte honom på så sätt att besegra Minotauros och hitta vägen tillbaka. Tråden motsvarar det aktuella vägvalet. Genom att rulla den tillbaka, kan vi gå tillbaka i våra spår (eng. backtrack) till en tidigare förgreningspunkt, och pröva en annan väg. Om vi kommer till en motsägelse, var den ursprungliga ”gissningen” fel.

[Figure 1.3]

Bifurcation is “logical” but suffers from two great weaknesses, which is why it’s the strategy of last resort. Firstly, there is no rhyme or reason to picking any one starting candidate, so the technique has become synonymous with guessing. Secondly, it’s very slow and error prone. It is very inelegant.

Fortunately, sudoku logic has progressed thanks to the efforts of a great number of solvers, so that such trial-and-error strategies are not required to make difficult and interesting puzzles, nor to solve them.

Most people would agree that the best strategies are ones where the solution (or candidate elimination) pops out of the grid purely because of a pattern or rule based on some identified formation. The Hidden Pairs and Triples you’ll find in the early chapters are such formations, and their elegance is hard to dispute. Many people have been devising extraordinary and beautiful strategies simply by extending the logic to new formations. Sharing these discoveries is the main purpose of this book.

There are still many sudoku puzzles that can’t be solved elegantly. They can all be solved logically by computer with brute force (after perhaps millions of operations); otherwise, it would not be possible to create them. Ironically it’s the “unsolvable” ones that are at the edge of research in this area, and we are nowhere near a general theory of sudoku logic that removes guesses from all puzzles.

Remember: every time you finish a sudoku and check you’ve got it right, you are actually providing a “proof” for the puzzle, just as a math whiz would draw a conclusion from a theorem. How elegantly it’s done is up to you.

Figure 1.3 on the previous page is an example of an intractable sudoku. The author gets only two numbers using the methods in this book. Have a go and see if you can find a logical and elegant solution. The solutions can be found at the end of the book.

1 Ed Russell and Frazer Jarvis, Mathematics of Sudoku, January 25, 2006, www.afjarvis.staff.shef.ac.uk/sudoku/russell_jarvis_spec2.pdf.

2 Du-Sum-Oh Puzzles, www.bumblebeagle.org/dusumoh/9x9/index.html.

Förgrening är en ”logisk” metod, men har två stora svagheter, varför den tillgripes som en sista utväg. För det första finns det ingen rim och reson i att välja en speciell startkandidat, varför den här tekniken har blivit synonym med att gissa. För det andra är den mycket långsam och medför stor risk för fel. Den är inte alls elegant.

Som tur är har sudoku-logiken rört sig framåt tack vare insatser av en stor skara lösare, så att den här typen av uteslutningsmetoder (eng. trial and error) inte längre behövs för att skapa – eller lösa – svåra och intressanta sudoku-pussel.

De flesta skulle hålla med om att de bästa metoderna är sådana där lösningen (eller kandidatelimineringar) följer av ett mönster eller en regel enligt ett igenkänt arrangemang. Dolda par och tripplar, som finns i de inledande kapitlen, är sådana arrangemang, och dessa metoders elegans är svår att bestrida. Många har utarbetat extraordinära och vackra metoder helt enkelt genom att utvidga logiken till nya arrangemang. Att sprida dessa upptäckter är huvudsyftet med den här boken.

Det finns fortfarande många sudokuer, som inte kan lösas elegant. Alla kan lösas med datorprogram (efter kanske miljontals instruktioner) – annars skulle man inte kunna skapa dem. Ironiskt nog är det de ”olösbara” pusslen som är vid forskningens framkant inom det här området, och vi är inte ens i närheten av en allmän teori för sudokulogik, som helt eliminerar behovet av gissningar.

Kom ihåg: varje gång du slutför en sudoku och kontrollerar att den stämmer, tillhandahåller du faktiskt ett ”bevis” för pusslet, precis som en matematiker drar en slutsats från ett teorem. Hur elegant du vill göra det, bestämmer du själv.

Figur 1.3 på föregående sida är ett exempel på en motspänstig sudoku. Författaren klarar bara två siffror med metoderna i den här boken. Gör ett försök, och se om du kan hitta en logisk och elegant lösning. Svaren finns i slutet av boken.

1 Ed Russel och Frazer Jarvis, Mathematics of Sudoku, 25 januari 2006, www.afjarvis.staff.shef.ac.uk/sudoku/russel_jarvis_spec2.pdf.

2 År 2012 kom äntligen beviset för att det inte finns några giltiga sudokuer med 16 givna. Se http://arxiv.org/abs/1201.0749. Övers. anm.

3 Du-Sum-Oh Puzzles, www.bumblebeagle.org/dusumoh/9x9/index.html.

2 Starting Out

The object of the puzzle is to fill the grid so that each row, each column, and each 3 × 3 box contains each of the numbers 1 to 9. There is no mathematics involved. The numbers 1 to 9 are only symbols; we could use letters (or even types of fruit) if we wanted. The clues on the grid are designed so as to produce only one possible solution (unless the creator has made an inexcusable mistake or the solver has missed or put a clue in the wrong place when copying the puzzle).

This book refers to rows using a letter and to columns by using a number and so a cell is a coordinate such as B6. The 3 × 3 boxes are numbered in reading order, from the top left – Box 1 – to the bottom right – Box 9. The central box is Box 5.

[Figure 2.1]

Solvers have many mental techniques for eyeballing a sudoku – that is, simply “seeing” the answer on the grid. Most of this book is about harder logical strategies that rely on careful noting down of the possible candidates in each cell, but it is essential to get a feel for cells with easy solves.

In Figure 2.1, we’re scanning rows and columns to help fill in box 6. Existing 6s in rows E and F tell us that the only place for a 6 is in D7. The 6 hogging column 8 confirms this. This technique of solving sudoku is called “slicing and dicing”.

One determined strategy is to pick a cell and look all around, counting the numbers it cannot be. Figure 2.2 is a very easy sudoku. A5 must be a 1, since the box already contains 2, 3, 4 and 5 and the row contains 6, 7, 8 and 9. If there is only one possible number to fill a cell, then we call it a Naked Single. G4 is another example.

[Figure 2.2]

A Hidden Single is a cell that appears to admit several possibilities but that actually must contain a certain digit because of the limitations of the row, column or box. A8 above, for example, could contain a 2 or a 4 if we look just at the row. There is nothing in the column, so theoretically all of 1 to 9 are admissible. But if we look at the top right box, 4 has been excluded from all cells apart from A8 because of the 4s in rows B and C. We can safely drop 4 in A8.

Sudoku Puzzle 1

[Figure]

Tip: This is a gentle to moderate sudoku, and you should be able to complete it without note making. At 22 clues, it might seem more difficult than it really is.

The solutions to all sudoku puzzles are at the end of the book.

2 Kom igång – singlar

Målet med spelet är att fylla spelplanen, så att varje rad, varje kolumn och varje 3 × 3‑box innehåller alla siffrorna 1 till 9. Ingen aritmetik är inblandad. Siffrorna 1 till 9 är bara symboler; vi kunde använda bokstäver (eller olika frukter) om vi ville. Ledtrådarna som finns på planen från början, kallade ”givna” eller givna siffror, är utplacerade på ett sådant sätt att det bara ska finnas en enda lösning (såvida inte konstruktören har begått ett oursäktligt misstag eller lösaren har gjort ett fel vid kopieringen).

Den här boken refererar till rader med en bokstav och till kolumner med en siffra, så att en cell blir en koordinat, såsom B6. 3 × 3‑boxarna är numrerade i läsordning, från längst upp till vänster – box 1 – till längst ner till höger – box 9. Mittenboxen är box 5.

[Figur 2.1]

Lösare har många mentala tekniker för att ögna igenom en sudoku – alltså att helt enkelt ”se” svaret på planen. Den här boken handlar till största delen om svårare logiska metoder, som hänger på att man noggrant skriver ner möjliga kandidater i varje cell, men det är avgörande att först få en känsla för celler som är lätta att lösa.

I figur 2.1 tittar vi igenom rader och kolumner för att fylla i box 6. Befintliga 6:or i raderna E och F talar om för oss att den enda platsen för en 6:a är i D7. 6:an i kolumn 8 bekräftar detta. Den här tekniken kallas på engelska ”slicing and dicing”, och är ett sätt att hitta en dold singel i en box.

En resolut strategi är att välja en cell och utesluta alla siffror den inte kan vara. Figur 2.2 visar en mycket lätt sudoku. A5 måste vara 1, för boxen innehåller redan 2, 3, 4 och 5 och raden innehåller 6, 7, 8 och 9. Om det bara finns en möjlig siffra för att fylla en cell, kallar vi den en naken singel. G4 är ett av flera andra exempel.

[Figur 2.2]

En dold singel är en cell som verkar tillåta flera kandidater, men som ändå måste innehålla en bestämd siffra, på grund av hur det ser ut i cellens rad, kolumn eller box. Vi tittar då på en siffra i taget (4 i det här fallet). Till exempel A8 ovan skulle kunna vara 2 eller 4, om vi bara tittar på översta raden. Det finns ingenting i kolumnen, så teoretiskt är alla 1 till 9 tillåtna. Men om vi tittar på box 3, ser vi att 4 är utesluten från alla celler utom A8, på grund av 4:orna i raderna B och C. Vi kan tryggt skriva 4 i A8.

Sudoku 1

[Figur]

Ledning: Det här är en ganska lätt sudoku, och du bör klara den utan att skriva kandidater. Med 22 givna siffror kanske den verkar svårare än den är.

Alla lösningar finns i slutet av boken.

3 Naked Pairs

Once the possibilities of “eyeballing” a puzzle have been exhausted, it’s time to start making some notes – dropping small numbers into each cell to mark the possible candidate solutions. Ideally, you’ll want to give each unknown cell its full set of candidates, since once we show that certain cells are restricted to just a few possibilities we can start using some whizzy rules.

When you start adding notes, you may notice that the puzzle contains some double candidate cells. Such cells are called bi-value cells and are very, very useful. Hopefully, you will spot some bi-value cells that contain the same two digits. Any pairs like these that are also in the same row, column or box are called Naked Pairs – “pairs” since there are two candidates only, and “naked” since there are no other candidates on those.

With a Naked Pair, it is clear that the solution will contain those values in those two cells – we just don’t know which is which at this stage. This means that all other candidates with those numbers can be removed from whatever unit or units (row, column or box) they have in common.

Figure 3.1

In Figure 3.1 we have a Naked Pair sited in box 7. It is also on row H, so this Naked Pair attacks candidates in two units – very useful. The pair is 1 and 4. Looking around in box 7, we have other 1s and 4s, which can now be scrubbed out. Looking along the row, we can do the same. A lot of clutter disappears this way – see Figure 3.2. Note that a new Naked Pair 2/7 is revealed, and a solution is available in the corner (J1).

Figure 3.2

Exercise 1 – Naked Pairs

There are 38 candidates that can be removed from this sudoku board. You are allowed to look only for Naked Pairs and tick candidates off. Some removals will reveal new Naked Pairs. Try to use them.

Correction: 42 candidates

Figure

3 Nakna par

När vi har uttömt möjligheterna att ögna igenom en sudoku, är det dags att börja skriva kandidater – små siffror i varje cell som anger de möjliga värdena. Det bästa är om man skriver alla tillåtna kandidater i varje olöst cell, för när vi har visat att vissa celler är begränsade till ett fåtal möjligheter, kan vi börja använda en mängd finurliga regler.

När du börjar göra noteringar, kanske du märker att vissa celler innehåller två kandidater. Sådana kallas tvåvärdesceller (bi-value cells) och är i högsta grad användbara. Förhoppningsvis kommer du att hitta några celler som innehåller samma två kandidater (och inga andra). Alla par som dessa, som också finns i samma grupp (rad, kolumn eller box), kallas nakna par – ”par” eftersom det bara finns två kandidater, och ”nakna” eftersom det inte finns några andra kandidater i cellerna.

När vi har ett naket par, är det uppenbart att lösningen kommer att innehålla dessa värden i dessa två celler – vi vet ännu bara inte i vilken ordning. Det betyder att alla andra kandidater med samma siffror kan tas bort från den grupp eller grupper de har gemensamma.

Figur 3.1

I figur 3.1 finns ett naket par i box 7. Det ligger också i rad H, så det här paret attackerar kandidater i två grupper – riktigt användbart. Paret är 1 och 4. Om vi tittar oss omkring i box 7, ser vi andra 1:or och 4:or, som nu kan suddas bort. Tittar vi längs raden, kan vi göra detsamma. En hel del onödig bråte försvinner på det här sättet – se figur 3.2. Notera att ett nytt naket par 2/7 framträder, och vi får en lösning i hörnet (J1, naken singel).

Figur 3.2

Övning 1 – Nakna par

Hela 42 kandidater kan tas bort från den här spelplanen. Du får bara använda nakna par för att bocka av kandidater. Vissa strykningar gör att nya nakna par framträder. Försök använda dem!

Figur

4 Naked Triples

We can certainly extend Naked Pairs to Naked Triples. Any three cells in the same unit that contain three candidate numbers and no others are an example of a Naked Triple. The rest of the unit can be scrubbed clean of any of those numbers.

But a Naked Triple is much more versatile than this rule implies. In fact it is not necessary for there to be three candidates in each cell. As long as the applicable cells contain three different candidate numbers between them and no other numbers, they can be classified as a Naked Triple. Obviously, we’re not going to apply this rule to single candidate cells, since they are solved, so the possible combinations are as follows:

(123)(123)(123)

(123)(123)(12)

(123)(12)(23)

(12)(23)(13)

The last case is interesting, and the advanced strategy XY-Wings uses this formation, but that’s skipping way ahead.

Rev: is interesting, because it may be the easiest to find, and ...

Let’s look at an example:

Figure 4.1

Here we have a Naked Triple in row B with the values 6/7/8. Number 8 is excluded from B3, but in combination 6/7/8 must fill the cells circled. There are no other possibilities. As the triple is aligned on a row, we can remove any 6 or 7 or 8 on that row, as marked. We get a nice Naked Pair of 4/9 in A9/B9, which gives us many more eliminations.

Sudoku Puzzle 2

Figure

Note: To save you the trouble of entering all the candidates in the puzzles in this book, they have been drawn for you. This is still the starting position for the puzzle. Candidates have been removed only where a clue is present in the row, column or box.

Tip: Each puzzle requires the strategy discussed in the current chapter. In this case, use Naked Triples.

4 Nakna tripplar

Vi kan definitivt utvidga nakna par till nakna tripplar. Tre celler i samma grupp, som innehåller tre kandidatsiffror och inga andra, är ett exempel på en naken trippel. Resten av gruppen kan rensas från alla dessa siffror.

Men en naken trippel är mer mångsidig än så. Det behöver faktiskt inte vara tre kandidater i varje cell. Så länge de aktuella cellerna innehåller tre olika siffror tillsammans och inga andra siffror, kan de beskrivas som en naken trippel. Naturligtvis behöver vi inte tillämpa regeln på celler med en kandidat (naken singel) eller nakna par, så de möjliga typerna av kombinationer blir:

(123)(123)(123)

(123)(123)(12)

(123)(12)(13)

(12)(13)(23)

Det sista fallet är intressant, för det kan vara lättast att hitta, och den avancerade metoden xy-vinge använder en sådan uppställning, men det är att gå händelserna i förväg.

Låt oss se på ett exempel:

Figur 4.1

Här har vi en naken trippel i rad B med värdena 6/7/8. Siffran 8 saknas i B3, men kombinationen 6/7/8 måste fylla de inringade cellerna. Det finns inga andra möjligheter. Då trippeln finns i en rad, kan vi avlägsna varje 6:a, 7:a och 8:a från resten av raden, som markerat i figuren. Vi får ett vackert naket par med 4/9 i A9/B9, vilket ger oss många fler elimineringar.

Sudoku 2

Figur

Anmärkning: För att bespara dig arbetet att skriva in alla kandidaterna för hand i boken, har de skrivits ut åt dig. Det här är ändå startläget för pusslet. Kandidater har tagits bort bara där det finns en given siffra i samma rad, kolumn eller box.

Ledning: Varje sådan här sudoku kan lösas med metoden som diskuteras i kapitlet. Nakna tripplar i det här fallet.

5 Naked Quads

A Naked Quad is rarer than a Naked Triple or Pair, especially in its full form, but still useful if it can be spotted. The same logic applies as in Naked Triples. The list of the possible combination of numbers is long, but it starts

(1234) (1234) (1234) (1234)

and can be a tortuous foursome like this:

(12) (23) (34) (14)

Figure 5.1 shows an example of a Naked Quad in a row. We have 1/3/4/8 in four cells, with two cells containing all four numbers and two others containing just three. Those numbers can’t be anywhere else in the row, so they can be removed from other cells in the row – 1 and 8 from H1, 8 from H2, 1 from H3 and 4 and 8 from H8.

Figure 5.1

Such Naked Quads made up of twos and threes are difficult to spot, but if you’re sure they are present, then they may crack a puzzle for you.

Are sets of five numbers possible, or six? Theoretically, yes – there are quintets and sextets – but as you will see in the chapter on Hidden Quads, they are of no practical use.

Exercise 2 – Quad Spot !

There are two Naked Quads on this board. Can you spot them? If you can find the first one, the second one will be revealed. The circle means that there is a candidate there that can be eliminated (among others) by the first Quad.

5 Nakna fyrtal

Ett naket fyrtal är ovanligare än nakna tripplar och par, särskilt i dess fulla form, men ändå användbart om det kan upptäckas. Samma logik gäller som för nakna tripplar. Listan med möjliga kombinationer är lång, men den börjar

(1234) (1234) (1234) (1234)

och kan vara en invecklad rad som denna:

(12) (23) (34) (14)

Figur 5.1 visar ett exempel på ett naket fyrtal i en rad. Vi har 1/3/4/8 i fyra celler, där två av dessa innehåller alla fyra siffrorna och de två andra tre siffror. Dessa siffror kan inte förekomma annorstädes i raden, varför de kan tas bort från andra celler i raden – 1 och 8 från H1, 8 från H2, 1 från H3 samt 4 och 8 från H8.

Figur 5.1

Nakna fyrtal med två eller tre kandidater i cellerna kan vara svåra att upptäcka, men om du är säker på att de finns, kan de hjälpa dig att knäcka en sudoku.

Är mängder med fem siffror möjliga, eller sex? I teorin ja – det finns femtal och sextal – men i kapitlet om dolda fyrtal kommer vi att se att de inte gör någon praktisk nytta (för vanliga 3 × 3-spelplaner).

Övning 2 – Finn fyrtalen!

Det finns två nakna fyrtal på den här spelplanen. Kan du se dem? Om du kan hitta det första, kommer det andra att avslöjas. Cirkeln betyder att det finns en kandidat där, som kan elimineras (bland flera andra) av det första fyrtalet.

Once the candidate has been removed, another Quad will be formed and one more candidate exposed for removal. Find that single candidate and you’ll have solved this exercise.

Note: The first Naked Quad is also a Hidden Triple, and the second one is better described as a Hidden Single, which is somewhat unfortunate.

När kandidaten har tagits bort, bildas ett annat fyrtal, och ytterligare en kandidat blottas och kan strykas. (*) Finn den kandidaten, och du har klarat övningen.

(*) Den andra elimineringen kan dock göras med en enklare metod. Övers. anm.

6 Hidden pairs

Hidden Pairs are real work horses for removing candidates, and they are the basis for more advanced strategies as well. Simply put:

Note to Andrew S: What does “basis for more advanced strategies” mean? In which chapters are these strategies?

If any two numbers occur only twice in just two cells in any one unit (row, column or box), then all the other candidates can be removed from those cells.

Let’s look at an example. There are two separate Hidden Pairs in this sudoku fragment, marked with two different pairs of rings.

[Figure 6.1]

1 and 5 occur in only two cells in box 2, but they are hidden by the 3 and 8 in C4 and the 3/7/8 in C6. Those numbers can go. Similarly, in the centre box, we have two occurrences of the pair 3/9. D5 and F5 can lose 1/5.

Once you’ve exposed a Hidden Pair, it becomes a Naked Pair. Should that pair share a box as well as a row or column, you can go back to the Naked Pairs strategy and see what damage you can inflict on the candidates elsewhere on the board.

Addition: In this situation, Intersection Removal (chapters 9–10) serves the same purpose.

Once we’ve cleared the board, as in Figure 6.2, we can see some attacks that the new Naked Pairs have created.

Addition: Using the pair 3/9, we can remove 9 from A5 and 3 from B5.

[Figure 6.2]

Exercise 3 – Hidden Pairs

How many Hidden Pairs are in this puzzle?

[Figure]

6 Dolda par

Dolda par är riktiga arbetshästar för att få bort kandidater, och de är även grunden för mer avancerade metoder. För att uttrycka det enkelt:

Om två siffror finns bara två gånger i två celler i en grupp (rad, kolumn eller box), då kan alla andra kandidater strykas från dessa celler.

Låt oss se på ett exempel. Det finns två separata dolda par i den här stympade sudokun, markerade med två olika par av ringar.

[Figur 6.1]

1 och 5 uppträder bara i två celler i box 2, men de döljs av 3 och 8 i C4 och 3/7/8 i C6. Dessa siffror kan vi skippa. På samma sätt har vi paret 3/9 på två ställen i mittenboxen. I D5 och F5 blir 1/5 överflödiga.

När du har hittat ett dolt par, och strukit kandidater, blir det ett naket par. Om det paret delar en box och dessutom en rad eller kolumn, kan du använda nakna par-metoden, och se vilken skada du kan orsaka på kandidaterna på resten av spelplanen. Vi kan också använda snitt (kapitel 9–10) för samma ändamål.

När vi har rensat spelplanen, som i figur 6.2, kan vi se möjligheter som de nya nakna paren har skapat. Om vi använder paret 3/9, kan vi stryka 9 i A5 och 3 i B5.

[Figur 6.2]

Övning 3 – Dolda par

Hur många dolda par finns i den här sudokun?

[Figur]

7 Hidden Triples

We can easily extend Hidden Pairs to Hidden Triples or even Hidden Quads. A Hidden Triple will consist of three numbers spread over exacly three cells in the same unit (be it row, column or box), such as 4/8/9, 4/8/9 and 4/8/9 hidden behind other candidates.

However, Hidden Triples are more interesting and follow a similar idea as Naked Triples. We don’t need exactly three sets of numbers in three cells for the rules to apply. In the example below, we have 1/4/6, 1/4 and 1/4/6 in three cells.

Rev: We don’t need three full sets Comment: We do need three sets of numbers, but they don’t have to be exactly the same.

Figure 7.1

Sudoku Puzzle 3

Figure

Tip: This is a moderate sudoku which, apart from singles, requires the Hidden Triples strategy to solve it.

7 Dolda tripplar

Vi kan utan vidare utvidga dolda par till dolda tripplar (och även dolda fyrtal). En dold trippel består av tre siffror spridda över exakt tre celler i samma grupp (rad, kolumn eller box), såsom 4/8/9, 4/8/9 och 4/8/9, dolda bakom andra kandidater.

Men dolda tripplar är intressantare än par, och följer en liknande logik som nakna tripplar. Vi behöver inte ha med alla tre siffrorna i de tre cellerna för att regeln ska kunna tillämpas. I exemplet nedan har vi 1/4/6, 1/4 och 1/4/6 i tre celler.

Figur 7.1

Sudoku 3

Figur

Ledning: Den här sudokun har svårighetsgraden ”måttlig” (moderate), och det fordras, förutom singlar, två dolda tripplar för att lösa den.

8 Hidden Quads

Just as in the case of Naked Pairs, we can extend Hidden Pairs and Triples to Quads and beyond. However, they can be hard to spot.

Figure 8.1

In column 8, we have a Hidden Quad with the numbers 3/5/6/7 spread over B8, D8, E8 and F8. The Quad is barely hidden – just by one number. But logic ensures that the 4 in B8 can be safely removed and gets us closer to solving the sudoku. Column 8 already has one solved cell, the 1 in A8, and the Hidden Quad occupies four cells using four candidates. This means the remaining four cells of the column must contain the remaining four candidates. What does it mean for four candidates to exist in four cells? Sounds like the definition of a Naked Quad. If we look at the board, we do see 2/4/8/9 in C8, G8, H8 and J8. This also allows us to remove the 4 from B8, and our logic comes full circle.

Note to Andrew S: This is a bad example of a hidden quad, for two reasons. Firstly, there are only eight unsolved cells in column 8, so the hidden quad is also a naked quad. Secondly, you still need to apply xy-wings (twice), so the quad doesn’t help us solve the sudoku. This is why I picked a better example.

Rev: In column 8, we have a Hidden Quad with the numbers 3/5/6/7 spread over C8, G8, H8 and J8. The Quad is hidden by nine numbers. Logic ensures that we can safely remove 2/4/8/9 in C8, 8 in G8, 1/9 in H8 and 8/9 in J8, and this gets us much closer to solving the sudoku. The key numbers to remove in this case are 1 and 9 in H8. We may also note that 1/2/4/8/9 occupy A8/B8/D8/E8/F8, which confirms our eliminations, and our logic comes full circle.

8 Dolda fyrtal

Precis som med nakna par, kan vi utvidga dolda par och tripplar till dolda fyrtal och uppåt. De kan emellertid vara svåra att få syn på.

Figur 8.1

I kolumn 8 har vi ett dolt fyrtal med siffrorna 3/5/6/7 utspridda över C8, G8, H8 och J8. Fyrtalet döljs av nio siffror. Logiken försäkrar oss om att vi kan ta bort 2/4/8/9 i C8, 8 i G8, 1/9 i H8 och 8/9 i J8, och detta gör att vi kommer mycket närmare att lösa sudokun. De avgörande strykningarna är i det här fallet 1 och 9 i H8. Vi kan även notera att 1/2/4/8/9 finns i A8/B8/D8/E8/F8, vilket bekräftar strykningarna och fullbordar logiken.

9 Pointing Pairs

We’re already familiar with Pairs, Triples and Quads, but so far we’ve been looking for them only in a single row, column or box. There are sound logical reasons for looking at the overlap of two units and using strategies in the Intersection Removal category. Pointing Pairs are the first strategy of this type.

Before we formulate the rule, let us identify the principle – which is very easy to spot and apply. In the bottom section of the sudoku below, we have lots of 3s, particularly in row G. However, in the middle box, we have only two 3s. These are the only two places in that whole box where 3 is permissible. Luckily, they are aligned on a row which is our intersection.

Addition: (The term intersection comes from set theory, and is the common part of two sets.)

Figure 9.1

Logically, if those two cells are the only places a 3 can go in that box, then all other 3s on that row must be illegal and we can remove them. The 3s marked in grey squares in Figure 9.1 are the eliminations. We say that the two 3s in box 8 are pointing along the row at the illegal 3s – hence “Pointing Pairs”.

Pointing Triples are also a possibility, as illustrated in Figure 9.2.

Figure 9.2

Note: The figure is the same as Figure 10.2, and should be replaced.

Here there are three 3s in box 3 and aligned on row A, which tells us that we can remove them from the rest of the box.

Rev: we can remove other 3s from the rest of the row.

Rows and columns intersect with boxes on three cells, but between a row and a column the overlap is confined to one cell – so the principle of intersection must always involve a box. This also puts a limit on the size of the intersection. We can’t find Pointing Quads, since only three cells in a box can be aligned on a row or column. If we were playing jigsaw sudoku, where boxes can be elongated, the restriction would be lifted.

Sudoku Puzzle 4

You may have to read on to Box/Line Reduction to solve this puzzle.

Figure

Tip: This sudoku is graded tough, but only because there are several Pointing Pair and Box/Line Reduction opportunities. If you can spot these, then the rest can be solved with singles.

9 Pekande par och tripplar (snitt på rader och kolumner)

Vi har redan stiftat bekantskap med par, tripplar och fyrtal, men så här långt har vi bara letat efter dem i en rad, kolumn eller box i taget. Det finns logiska skäl för att se på den gemensamma delen av två grupper och använda metoder i kategorin ”snitt” (eng. Intersection Removal). Pekande par och pekande tripplar är de första vi ska studera.

Låt oss, innan vi formulerar regeln, titta på ett exempel och identifiera principen – som är lätt att hitta och tillämpa. I den stympade sudokun nedan har vi en massa 3:or, särskilt i rad G. I mittenboxen (box 8) har vi dock bara två 3:or. Dessa är de enda två celler i boxen där 3 kan finnas, och de är ordnade på samma rad, vilket utgör vårt snitt. (Begreppet snitt kommer från mängdläran, och består av den gemensamma delen av två mängder.)

Figur 9.1

Om vi ser att dessa två celler är de enda möjliga placeringarna för 3 i boxen, följer logiskt att alla andra 3:or i raden är ogiltiga, och vi kan stryka dem. De 3:or som markerats med grå kvadrater i figur 9.1 ska elimineras. Vi kan säga att de två 3:orna i box 8 pekar längs med raden mot de otillåtna 3:orna – härav ”pekande par”.

Pekande tripplar är också möjliga, om än inte lika vanliga, som i figur 9.2.

Figur 9.2

Här finns det tre 3:or i box 3, och alla ligger i rad A, varför vi kan ta bort andra 3:or från raden.

Rader och kolumner överlappar boxar med tre celler, men för en rad och en kolumn finns det bara en gemensam cell – så ett snitt måste alltid inbegripa en box. Det sätter också en gräns för storleken, eftersom bara tre celler i en box finns i samma rad eller kolumn. Om vi studerar pusselsudoku, eller varianter med större boxar än 3 × 3, försvinner den begränsningen.

Sudoku 4

Du kanske behöver läsa även nästa kapitel, snitt på boxar, för att lösa den här.

Figur

Ledning: Den här sudokun klassas som svår, men bara för att det finns flera snitt. När du hittat dessa, då kan resten lösas med singlar.

10 Box/Line Reduction

We’re not yet at the end of the Intersection Removal story. We should also be looking to remove candidates within a box because of a row or column. This strategy is sometimes called Box/Line Reduction. Let’s look at the central strip of a sudoku in Figure 10.1.

[Figure 10.1]

The 1s in row E are the only two 1s on that row. They are both located in the same box. The row intersects box 5. Because a 1 must appear on that row, we can remove the 1s from the rest of the box. There is no problem tripling this strategy up, as in Figure 10.2. Here we have three 3s in the top row, which means that we can remove all other 3s from the rest of box 3.

[Figure 10.2]

From this knowledge we can create a general rule:

If any one number occurs twice or three times in just one unit, then we can remove that number from the intersection of another unit.

Rev: If a number occurs in only two or three cells in one unit, and these cells are all in its intersection with another unit, then we can remove that number from the rest of the other unit.

Let’s summarize the four types of intersections:

□A Pair or Triple in a box – If the numbers are aligned on a row, n can be removed from the rest of the row.

□A Pair or Triple in a box – If the numbers are aligned on a column, n can be removed from the rest of the column.

□A Pair or Triple on a row – If the numbers are all in the same box, n can be removed from the rest of the box.

□A Pair or Triple on a column – If the numbers are all in the same box, n can be removed from the rest of the box.

Exercise 4 – Intersections

[Figure]

There are a whopping 20 candidates to be removed here, using seven Pairs and three Triples. Can you spot them all?

Rev: one Triple

10 Snitt på boxar

Vi har ännu inte kommit till slutet av historien om snitt. Vi kan också stryka kandidater inom en box på grund av en korsande rad eller kolumn. Den här metoden kan vi kalla snitt på boxar (eng. Box/Line Reduction). Låt oss titta på mittendelen av en sudoku i figur 10.1.

[Figur 10.1]

De två 1:orna i rad E är de enda 1:orna in den raden. De finns båda i snittet av raden och box 5, som rad E korsar. Eftersom en 1:a måste finnas den raden, kan vi stryka 1:orna från resten av boxen. Det är inget problem att använda samma metod med tripplar, som i figur 10.2. Här har vi tre 3:or i översta raden, vilket medför att vi kan ta bort alla andra 3:or från box 3.

[Figur 10.2]

Från detta kan vi skapa en allmän regel:

Om en siffra förekommer i bara två eller tre celler i en grupp, och dessa celler finns i snittet med en annan grupp, kan vi stryka siffran i resten av den andra gruppen.

Låt oss sammanfatta de fyra sorternas snitt för en siffra n:

□Två eller tre kandidater i en box – Om kandidaterna finns i samma rad, kan n strykas i resten av raden. (Även kallad box mot rad.)

□Två eller tre kandidater i en box – Om kandidaterna finns i samma kolumn, kan n strykas i resten av kolumnen. (Även kallad box mot kolumn.)

□Två eller tre kandidater i en rad – Om kandidaterna finns i samma box, kan n strykas i resten av boxen. (Även kallad rad mot box.)

□Två eller tre kandidater i en kolumn – Om kandidaterna finns i samma box, kan n strykas i resten av boxen. (Även kallad kolumn mot box.)

Övning 4 – Snitt

[Figur]

Det finns hela 20 kandidater, som kan strykas här, med hjälp av sju par och en trippel. Kan du hitta alla?

11 The X-Wing Family

X-Wings are the start of a family of strategies with such evocative names as Sword-Fish, Jelly-Fish, Squirm-Bag and Burma. They are often considered an advanced strategy, but they are relatively easy to spot and operate on a single number, so I believe they are mid-way between basic and advanced. Only X-Wings are common, but we’ll discuss the whole family to be thorough and you’ll soon see the pattern.

Rev: with evocative English names like swordfish and jellyfish. To make it simple we may collectively call them single wings or n-wings in Swedish, where n = 2, 3, 4. They are often

X-Wings got their name from the X-pattern they make, but the person who originally named this strategy also had the Star Wars fighter in mind (although he confused it with the TIE Fighter, which has an X wing shape).

Addition: Swordfish is the name of an old aeroplane, and someone thought that the pattern of a 3-wing looked like the wings of the plane.

[Figure 11.1]

Let’s clear the clutter from an example and see the principle. On the board in Figure 11.1, with just the 1s left (candidates – not solutions), we have two columns with just two 1s left as possibilities. Now, they are aligned on the same two rows. These special 1s have been labelled 1A, 1B, 1C and 1D.

The logic goes as follows: if A is 1, then B and C will not be, which forces D to be 1. But if A is not 1, then B and C must be 1s. Whichever way round it is, any 1 trapped between A and C or B and D, along those rows, can be eliminated.

This introduces us to the idea of Locked Pairs. The 1s in A and B lock C and D into being the opposite. We won’t know what the actual solution is until much later, after we’ve cracked more of the puzzle. But a lot of information is carried in the idea that AB and CD influence each other. To re-cap: whatever A and B are, they force C and D to be the opposite if you start imagining them having a solution. But either way, there is no room for any other candidates along the alignment of these two sets of pairs.

Going back to our example, let’s fill in the board with all the numbers and overlay the X‑Wing.

[Figure 11.2]

The example in Figure 11.3 is oriented in the opposite direction, and we’re looking at number 6. Quite a few 6s can be removed in columns 2 and 5.

[Figure 11.3]

11 Singelvingar

2-vingar (ofta kallade x-vingar) är början på en klass av metoder med konstiga engelska namn som swordfish (svärdfisk) och jellyfish (manet). För enkelhetens skull kan vi sammanfattande kalla dem singelvingar eller n-vingar på svenska, där n = 2, 3, 4. De anses ofta som avancerade metoder, men de är relativt enkla att upptäcka och rör bara en siffra i taget, så jag tycker de är mittemellan grundläggande och avancerade. Bara 2‑vingar är vanliga, men vi går igenom hela klassen för att vara grundliga, och du kommer snart att se mönstret.

Namnet x-vinge (eng. X-wing) kommer från x-mönstret som de fyra hörnen bildar, men den som namngav metoden hade också en Star Wars-figur i tankarna. (*) Swordfish är namnet på ett gammalt flygplan, och någon tyckte att de tre raderna i mönstret för en 3‑vinge liknade flygplanets vingar.

(*) På svenska är tvåvinge en typ av insekt, vilket jag tyckte lät kul, när jag hittade på det för några år sedan. Övers. anm.

[Figur 11.1]

Låt oss rensa spelplanen i ett exempel och se principen. På planen i figur 11.1, med endast 1-kandidaterna kvar, har vi två kolumner med endast två 1:or. De finns på samma två rader och har markerats med 1A, 1B, 1C och 1D.

Logiken funkar så här: om A är 1, är B och C det inte, vilket gör att D blir 1. Om A inte är 1, måste B och C vara 1:or. Vilketdera som än gäller, kan vi stryka alla andra 1:or, som finns på samma rad som A och C eller B och D.

Detta introducerar idén om kopplade par. 1:or i A eller B tvingar C och D att bli det motsatta. Vi vet inte lösningen förrän senare, när vi har knäckt mer av spelet. Men vi kan ändå få ut mycket information från insikten att AB och CD är kopplade till varandra. För att rekapitulera: vad än A och B är, måste C och D vara tvärtom om man föreställer sig den slutliga lösningen. Hur som helst finns det inget utrymme för andra kandidater av samma siffra längs samma rad (eller kolumn) som dessa två par.

Låt oss så gå tillbaka till vårt exempel och fylla ut planen med alla givna siffror och kandidater.

[Figur 11.2]

Exemplet i figur 11.3 är vänt åt motsatt håll, och vi tittar på siffran 6. En hel del 6:or kan strykas i kolumnerna 2 och 5.

[Figur 11.3]

We can make a rule for X-Wings:

When there are

□only two possible cells for a value in each of two different rows, and these cells also lie in the same columns,

□then all other candidates for this value in the columns can be eliminated. The reverse is true for columns instead of rows.

There is a logical extension of X-Wings to boxes, which is somewhat counter-intuitive. But before we look at it, however, let’s glance over the rest of the strategies in the X‑Wing family, which will keep us involved with columns and rows.

Sudoku Puzzle 5

[Figure]

Tip: This is graded Tough – In this sudoku, there are at least two X-Wings if you follow the puzzle through with just singles. There might be one Pointing Pair as well, depending on the route you follow.

Rev: there is at least one X-Wing

Vi kan nu formulera regeln för 2-vingar:

När det finns

□bara två möjliga celler för en siffra i var och en av två olika rader, och

□dessa celler även ligger i samma kolumner,

då kan alla andra kandidater för den siffran i kolumnerna elimineras. Det omvända gäller för kolumner istället för rader.

Det finns en logisk utvidgning av 2-vingar till boxar, som man kanske inte tänker på direkt. Men innan vi tittar på det i kapitel 14, ska vi se på resten av metoderna i n‑vingefamiljen, som även dessa rör kolumner och rader.

Sudoku 5

[Figur]

Ledning: Den här sudokun har svårighetsgraden ”knepig” (tough). Om du löser med bara singlar, kommer du att se minst en 2-vinge. Du kan eventuellt hitta ett snitt också.

12 Sword-Fish

X-Wing operates on two rows (or columns) aligned with two columns (or rows). Can it be extended to three rows and columns? Logically, yes. We’re talking about a grid of nine cells here, not four; interestingly, not every one of the nine cells needs to contain the number under consideration as I’ll show in a moment.

Let’s examine a classic Sword-Fish “grid”, such as the one in Figure 12.1, to see what’s going on. There is a lone solution, a large 6 in D4. We can ignore that one. All the other 6s are possible places to put a 6 according to the progress we’ve made on the sudoku (see the following diagram).

[Figure 12.1]

There is something special about the nine 6s I’ve highlighted in Figure 12.1. It is true they make a 3 x 3 grid but there are so many 6s on the board it looks like there are several 3 x 3 grids we could point out. The reason this set of nine is special is that they exist in three rows AND they are the only 6s in three columns. This makes them dependant on each other. A “classic” or “full” Sword-Fish contains a candidate in all nine positions.

Let’s pretend for a moment that H9 – the circled 6 in Figure 12.1 – is a solution for that cell. This clears all the 6s in column 9 and row H. The remaining 6s in our grid form an X-Wing. We can pick any 6 in our grid and pretending it’s a solution you can make the others an X-Wing which means the X-Wing logic applies. Other 6s in the rows must be eliminated. Figure 12.2 shows the entire board with all the candidates and the crossed cells mark the 6s we can eliminate along the rows of the Sword-Fish.

[Figure 12.2]

When we identify a Sword-Fish we don’t have to break it down into X-Wings – as long as we have 3 of something in three columns and they are aligned on three rows, other occurrences on the rows can be removed. And vice versa. Unfortunately, such an exact formation of nine candidates is pretty rare.

A much more common Sword-Fish will have missing candidates in some of the nine positions, but this does not invalidate the strategy.

Consider the example in Figure 12.3. This is a Sword-Fish despite only six cells being occupied by candidate 5. And we can eliminate 5 at C1, H1 and H5. We can see there is a grid of nine cells in a 3 by 3 formation. But there is no 5 at A5, a solution or clue of 1 at G8 and a solution or clue of 6 at J1.

[Figure 12.3]

12 3-vinge

En 2-vinge verkar på två rader och två kolumner. Kan den utvidgas till tre rader och kolumner? Ja, utan tvivel. Vi talar om ett rutnät med nio celler, inte fyra. Intressant nog behöver inte alla nio cellerna innehålla siffran vi studerar, som vi ska se om ett ögonblick.

Låt oss titta på ett klassiskt rutnät för 3-vinge, som i figur 12.1, för att se vad det handlar om. Där finns redan en lösning, en stor 6:a i D4, som vi kan bortse ifrån. Alla andra 6:or är möjliga placeringar för en 6:a enligt det aktuella läget i lösningen.

[Figur 12.1]

Det är något speciellt med de nio 6:orna, som är markerade i figur 12.1. Visst bildar de ett 3 × 3-rutnät, men det finns så många 6:or på spelplanen, att man skulle kunna peka ut flera andra 3 × 3-nät. Anledningen till att dessa nio är speciella, är att de finns i tre rader OCH de är de enda 6:orna i tre kolumner. Det gör dem beroende av varandra. En ”klassisk” eller fullständig 3-vinge har kandidater i alla nio positionerna.

Låt oss för ett ögonblick sätta en 6:a som lösning i H9 – den inringade cellen i figur 12.1. Det rensar bort alla övriga 6:or i kolumn 9 och rad H. De övriga 6:orna i rutnätet bildar en 2-vinge. Vi kan välja vilken som helst av de nio 6:orna, så att de övriga bildar en 2‑vinge, och vi kan använda logiken för 2-vingar. Andra 6:or i raderna kan strykas. Figur 12.2 visar hela spelplanen med alla kandidater, och de överkorsade cellerna markerar var vi kan eliminera i 3-vingens rader.

[Figur 12.2]

När vi identifierar en 3-vinge behöver vi inte bryta ner den till 2-vingar. Så länge vi har max tre av en siffra i tre kolumner, och de finns på tre rader, kan vi ta bort andra likadana siffror på raderna. Och omvänt för rader och kolumner. Tyvärr är ett sådant arrangemang med nio kandidater rätt så ovanligt.

En betydligt vanligare 3-vinge saknar kandidater i vissa av de nio positionerna, men detta gör ingalunda metoden obrukbar.

Betrakta exemplet i figur 12.3. Detta är en 3-vinge, trots att bara sex celler i rutnätet innehåller kandidaten 5. Och vi kan eliminera 5 i C1, H1 och H5. Vi kan identifiera ett 3 × 3-rutnät, men det finns ingen 5:a i A5, en 1:a som given eller lösning i G8 och en 6:a som given eller lösning i J1.

[Figur 12.3]

In an X-Wing there must be exactly two candidates in two columns aligned in two rows for eliminations to take place in the rows (and likewise for columns). The Sword-Fish in Figure 12.2 had exactly three candidates in three columns aligned on three rows. But that is not the definition, only an example. For a Sword-Fish we must replace exactly with “in total”.

In Figure 12.3 the sudoku board has, in total, three 5s in three rows that are aligned on three columns. The rows are A, G and J. Conceptually we can compare this to Naked Triples where 1/2/3 could be in all three cells, but a Naked Triple could have three cells with 1/2, 1/3 and 2/3 – in total there are three candidates in three cells.

Now, in total, the 5s in Figure 12.3 are aligned on exactly three columns. We can eliminate other 5s not shaded grey in those columns. This example is a little extreme since it’s what we call a 2-2-2 Sword-Fish formation. Other combinations are 3-2-3, or 2-3-2 or 2-3-3 and so on, grids with different numbers of ‘holes’.

A 2-2-2 Sword-Fish breaks down into broken X-Wings – where one corner of the X-Wing doesn’t have the candidate. Pick any cell shaded grey in the example and pretend 5 is the solution. This action will “turn-off” the 5s in two other grey cells.

As an example let’s pick A8 and say it’s 5. That means Al and J8 are not 5. We are left with a 5-pair in G1 and G5 and the lone 5 in J5. So if A8 is 5 then J5 is 5 and so is G1. Pick any other grey cell and you’ll get a similar cascade. Exhaustively we can show that columns 1, 5 and 8 will have 5 as the solution somewhere in the grey cells so our Sword-Fish works.

There is a hint of the incomplete Sword-Fish in the name. The first time Sword-Fish was spotted, the grid was stepped jaggedly in a 2-3-2 formation like the first diagram in Figure 12.4. As long as there are at least two numbers in each of the three lines, the logic holds.

[Figure 12.4]

The rule for Sword-Fish can be expressed as follows:

When there are

□only three possible cells for a value in each of three different rows, and

□these cells also lie in the same columns,

then all other candidates for this value in the columns can be eliminated. The reverse is true for columns instead of rows.

Sudoku Puzzle 6

[Figure]

Tip: This is a diabolical-grade sudoku, but forewarned is forearmed: the difficult strategy that needs to be used here is Sword-Fish.I en 2-vinge måste det vara exakt två kandidater i två kolumner ordnade i två rader för att elimineringar ska bli möjliga i raderna (och motsvarande för kolumner). I figur 12.2 hade 3-vingen exakt tre kandidater i tre kolumner ordnade i tre rader. Men detta är inte definitionen, bara ett exempel. För en 3-vinge måste vi ersätta exakt med ”totalt”.

I figur 12.3 har sudokuplanen, totalt, tre 5:or i tre rader som är ordnade i tre kolumner. Raderna är A, G och J. Vi kan dra paralleller till nakna tripplar, där 1/2/3 kan vara i alla tre cellerna, men en naken trippel kan också ha tre celler med 1/2, 1/3 och 2/3 – totalt finns det tre kandidater i tre celler.

Nu är de markerade cellerna med 5:or i figur 12.3 ordnade i totalt tre kolumner. Vi kan stryka andra 5:or i dessa kolumner. Detta exempel är en aning extremt, eftersom det är en 3-vinge med arrangemanget 2-2-2. Andra kombinationer är 3-2-3, 2-3-2 eller 2-3-3 och så vidare, rutnät med olika antal ”hål”.

Ett 2-2-2-mönster kan brytas ner till ofullständiga 2-vingar – där ett hörn i 2-vingen saknar kandidat. Välj en godtycklig grå cell i exemplet och anta att 5 är lösningen där. Detta utesluter 5:orna i två andra grå celler.

Låt oss till exempel välja A8 och anta att den är 5. Det innebär att A1 och J8 inte är 5. Vi har kvar ett par 5:or i G1 och G5 och en ensam 5:a i J5. Så om A8 är 5 blir J5 och G1 också 5. Välj en annan grå cell, och du får en liknande följdverkan. På det här sättet kan vi visa att kolumnerna 1, 5 och 8 måste ha 5 som lösning någonstans i de grå cellerna, så vår 3-vinge fungerar.

Det finns en koppling till den ofullständiga 3-vingen i det engelska namnet ”Swordfish”, som är ett flygplan med två par vingar. Den första kända 3-vingen hade arrangemanget 2‑3‑2, som i det första diagrammet i figur 12.4. Så länge det finns minst två siffror i varje rad och kolumn funkar logiken.

[Figur 12.4]

Regeln för 3-vinge kan skrivas så här:

När det finns

□bara tre möjliga celler för en siffra i var och en av tre olika rader, och

□dessa celler även ligger i samma kolumner,

då kan alla andra kandidater för den siffran i kolumnerna elimineras. Det omvända gäller för kolumner istället för rader.

Sudoku 6

[Figur]

Ledning: Den här sudokun är ”djävulsk”, för att det krävs en 3-vinge. När man vet det blir det något lättare.

13 Jelly-Fish

Jelly-Fish is the fourfold extension of the 3 by 3 Sword-Fish and the 2 by 2 X-Wing. There is certainly a pattern here and, yes, it does continue – the 5 by 5 version is called a Squirm-Bag. Finding a Jelly-Fish is quite impressive since it occupies (at most) sixteen cells.

In this example, the number 4 is being Jelly-Fished.

[Figure 13.1]

As you can see, of the 16 nodes involved, only eleven actually contain a 4.

We have, in total, four 4s in four rows allowing eliminations in the columns. Pretending that any one of the eleven grey cells is a 4 reduces the remainder of the grid to a Sword-Fish and the logic of the Sword-Fish follows from there.

Interestingly, the Squirm-Bag, although conceivable, is quite redundant. I know of no puzzle that requires such a strategy, at least in a 9 by 9 sudoku.

In Figure 13.1 we know that the 4s are restricted to columns 2, 3, 5 and 6 and rows A, B, F and H. That’s why we can eliminate all those other 4s highlighted on the board. If we know a solution is bound to exactly four rows and four columns and we know there must be a total of nine of that number to place on the board, then the remaining five rows and five columns also form a restricted set. This is a 5 by 5 Squirm-Bag. So every Squirm-Bag must have a complimentary Jelly-Fish. In fact for every size-N fish there is a size‑(9‑N) counterpart. Therefore you don’t need to go larger than a Jelly-Fish.

Rev: also form a restricted set, a 5-fish. So every 5-fish must have a complimentary 4‑fish (or smaller if less than nine are unsolved). In fact for every n-fish there is a (f – n)-fish counterpart, where f is the number of free (unsolved) of one number.

Sudoku Puzzle 7

[Figure]

Tip: You’ve guessed right – this puzzle contains a Jelly-Fish, but there are other surprises as well which require inspiration or a peek into later chapters.

13 4-vinge

Utvidgar vi 3-vinge får vi förstås 4-vinge (eng. jellyfish), som är den sista metoden i familjen. I princip kan man fortsätta till ett 5 × 5-rutnät (ibland kallat Squirmbag), men det är överflödigt i en vanlig 9 × 9-sudoku. Att hitta en 4-vinge är imponerande, eftersom den upptar som mest sexton celler.

I det här exemplet blir siffran 4 föremål för en 4-vinge.

[Figur 13.1]

Som du kan se, är det bara elva av de sexton aktuella cellerna, som faktiskt innehåller en 4:a. Vi har, totalt, fyra 4:or i fyra rader, som möjliggör strykningar i kolumnerna. Om vi för ett ögonblick låter en av de elva grå cellerna bli en 4:a, reduceras resten av rutmönstret till (högst) en 3-vinge, och 3-vingelogiken kan användas.

I figur 13.1 vet vi att 4:orna är begränsade till kolumnerna 2, 3, 5 och 6 och raderna A, B, F och H. Det är därför vi kan eliminera alla de andra markerade 4:orna på spelplanen. Om vi vet att en lösning i fyra rader är bunden till exakt fyra kolumner, och vi vet att totalt nio av den siffran ska placeras ut, då utgör resterande fem rader och fem kolumner också en begränsad mängd, en 5-vinge. Så varje 5-vinge måste ha en kompletterande 4-vinge (eller lägre om färre än nio är olösta). Faktiskt finns det för varje n-vinge en motsvarande (f – n)-vinge, där f är antalet fria (olösta) av den aktuella siffran. Därför behöver vi aldrig gå högre än 4-vinge.

Sudoku 7

[Figur]

Ledning: Du har nog redan gissat det – den här sudokun innehåller en 4-vinge. Men det finns även en överraskning, som kräver en metod från ett senare kapitel.

14 Generalizing X-Wing

X-Wing is not restricted to rows and columns – we can extend the idea to boxes as well. If we generalize the rule in Chapter 11 above, we get:

When there are

□only two candidates for a value, in each of two different units of the same kind, and

□these candidates also lie on two other units of the same kind,

then all other candidates for that value can be eliminated from the latter two units.

Now we have six combinations:1. Starting from two rows and eliminating in two columns.2. Starting from two columns and eliminating in two rows.3. Starting from two boxes and eliminating in two rows.4. Starting from two boxes and eliminating in two columns.5. Starting from two rows and eliminating in two boxes.6. Starting from two columns and eliminating in two boxes.

For example, in the following spread of 2s, we can form an X-Wing from the top two rows and boxes 2 and 3.

[Figure]

This clears out the three cells marked with Xs. But there is an easy way to eliminate the same set of three 2s – by using Pointing Pair.

[Figure]

It turns out that these distorted X-Wings that use two boxes are equivalent to Intersection Removal operations, which means that the Generalized X-Wing is interesting but not that useful.

Addition: However, it can be useful in a jigsaw sudoku, that we will deal with in chapter 42, or when a row or column overlaps more than three boxes, as in an 8 × 8 sudoku with 2 × 4 boxes. 14 Andra sorters 2-vingar

En 2-vinge behöver inte vara begränsad till rader och kolumner – vi kan utvidga idén till boxar också. Om vi generaliserar regeln i kapitel 11 får vi:

När det finns

□bara två kandidater för en siffra, i två olika grupper av samma slag, och

□dessa kandidater också ligger i två andra grupper av samma slag,

då kan alla andra kandidater för den siffran elimineras i de senare två grupperna.

Nu har vi sex olika kombinationer: 1. Starta med två rader och eliminera i två kolumner.2. Starta med två kolumner och eliminera i två rader. 3. Starta med två boxar och eliminera i två rader. 4. Starta med två boxar och eliminera i två kolumner. 5. Starta med två rader och eliminera i två boxar. 6. Starta med två kolumner och eliminera i två boxar.

I följande exempel med några utspridda 2:or, kan vi bilda en 2-vinge med de två översta raderna och boxarna 2 och 3.

[Figur 14.1]

Detta rensar de tre överkryssade cellerna. Men det finns ett enkelt sätt att eliminera samma tre 2:or – genom ett pekande par.

[Figur 14.2]

Det visar sig att dessa skeva 2-vingar, som verkar på två boxar, är ekvivalenta med snitt (se kapitel 9–10). Detta innebär att den här sortens vingar visserligen är intressanta, men inte särskilt användbara för vanliga 9 × 9-sudokuer. Däremot kan de användas i pusselsudoku som vi kommer till i kapitel 42, eller om en rad eller kolumn går över fler än tre boxar, som i en 8 × 8-sudoku med 2 × 4-boxar.

15 Seeing is Believing

As a preamble to many of the more complicated logical strategies, it is worthwhile to understand how cells “see” each other. Examining cells in this light allows us to use more familiar language than technical terms such as “overlaying” or “congruence”.

There are 81 cells in a normal sudoku, each belonging to one row, column and box. Any cell can always “see” all eight other cells in the box in which it resides, plus six other cells in the row and column, which adds up to a sphere of influence of 20 cells. Consider B2 below.

[Figure]

All the shaded cells in this diagram can be “seen” by the black cell at B2. Any solution at this cell excludes the same number from the other 20 cells.

[Figure]

If we add a second cell, E7, there will be two or more cells that both cells can “see” – in this case, B7 and E2. The overlap between the two is shown in the cross hatch.

[Figure]

When the cells are more closely aligned, the number of cells they can both see increases, as shown here.

15 Att se andra celler

Som en förövning till flera av de mer komplicerade logiska metoderna, är det värt att först förstå hur celler kan ”se” varandra. Om vi analyserar celler på det här sättet kan vi använda ett ledigare språk än tekniska termer som ”överlagring” och ”kongruens”.

Det finns 81 celler i en vanlig sudoku, och var och en hör till en rad, en kolumn och en box. Varje cell kan alltid ”se” åtta andra celler i boxen, plus ytterligare sex i vardera rad och kolumn, vilket blir totalt 20 grannar. Betrakta B2 nedan.

[Figur]

Alla skuggade celler i diagrammet kan ”ses” av den svarta cellen B2. Varje lösning i den cellen utesluter samma siffra från de 20 grannarna.

[Figur]

Om vi lägger till en andra cell, E7, kommer det att finnas två eller fler celler som båda kan se – i det här fallet B7 och E2. Dessa celler visas med rutat mönster.

[Figur]

När cellerna har en tätare koppling, ökar antalet gemensamma grannar, som i den här figuren.

16 Simple Colouring (or Simple Chains)

Many of the more interesting and advanced strategies use links or chains of conjugate pairs – candidates that occur just twice in a row, column or box. This is a vital trick which we will use to build some very sophisticated rules. To start with, let’s look at a theoretical example.

Figure 16.1

In Figure 16.1, all the numbers have been removed except candidates for 7. (The known solutions for 7 have also been removed.)

Figure 16.2

Next, we look for all the pairs for 7 and join them with double arrows.

Figure 16.3

Some of these arrows (or links) are isolated and not interesting. However, one chain of links connects six pairs. To “colour” these pairs, we pick one cell (say, A3) and choose a colour. We then follow all the links, alternating with another colour. To best show this method in a black-and-white book, the letters X and Y have been used.

What we are saying when we colour pairs as in Figure 16.3 is that either all X or all Y must be 7.

When we have a pair of candidates, we have two logical statements (where “!” means ‘not’):

X => !Y (If X is 7 then Y is not 7)

Y => !X (If Y is 7 then X is not 7)

All we have done with Colouring or Chaining these pairs is extend the lengt