2
$\begingroup$

I tried a hard sudoku and I can't figure out what the next number is. I tried some online tools without any success (I don't want to have the final solution without any explanation).

I would be very pleased if anyone could give me a hint.

sudoku

$\endgroup$
1
  • $\begingroup$ There might be an online solver that can work this one out, and it might need to rely on "extreme strategies" more than a dozen times to eliminate candidates one-by-one before solving a single cell beyond what you have. $\endgroup$ Commented Apr 8, 2023 at 23:28

2 Answers 2

3
$\begingroup$

Start by filling in candidates. You should fill them all in, of course, but I'm just keeping things to what's relevant immediately.

candidates filled in

Now buckle in, we've got to do a bit of work to get even one number filled in!

Step 1: neither R1,C7 nor R3,C7 can be a 3

R7,C7 can be a 3 or a 7.
- making it a 3 rules out 3 in R1,C7 or R3,C7 as the 3 is taken for C7.
- making it a 7 rules out 7 in R5,C7, so R6,C9 must be the 7 for that block,
  ... which means R1,C9 must be the 3 for C9,
  ... which means 3 is taken for the top-right block, ruling out 3 in R1,C7 or R3,C7.
As both possibilities lead to the same conclusion we know R1,C7 and R3,C7 are not 3.

after step 1

Step 2: R1,C9 cannot be a 9

In R8, the 6 can be in R8,C1 or R8,C7.
- putting it in R8,C1 means R8,C7 is not a 6, leaving only R9,C8 to be 6 in bottom-right block.
  ... this in turn leaves only R9,C9 to be 9 in that block.
  ... and this in turn means the 9 for C9 is taken, so R1,C9 cannot be 9.
- putting the 6 in R8,C7 rules out 6 in R1,C7 and R3,C7 as the 6 is taken for C7.
  ... so R3,C7 must be 5.
  ... so R1,C7 must be 9, so R1,C9 cannot be.
As both possibilities lead to the same conclusion we know R1,C9 is not 9.

after step 2

Step 3: R1,C4 cannot be at 9

In C7, the 9 can be in R1,C7 or R4,C7.
- putting it in R1,C7 rules out 9 in R1,C4 as the 9 is taken for R1.
- putting it in R4,C7 rules out 9 in R4,C5 as the 9 is taken for R4.
  ... so R6,C4 must be the 9 for the middle block.
  ... which rules out 9 in R1,C4 as the 9 is taken for C4.
As both possibilities lead to the same conclusion we know R1,C4 is not 9.

after step 3

Step 4: neither R3,C4 nor R2,C8 can be a 5

R3,C7 can be a 5 or a 6.
- making it a 5 rules out 5 in R3,C4 as the 5 is taken for R3,
  and rules out 5 in R2,C8 as the 5 is taken for the middle-right block.
- making it a 6 rules out 6 in R3,C2 as the 6 is taken for R3.
  and rules out 6 in R8,C7 as the 6 is taken for C7.
  ... which means R8,C1 must be the 6 for R8,
  ... which rules out 6 for R1,C1, as the 6 is taken for C1,
  ... which means R2,C2 must be the 6 for the top-left block (we already ruled out 6 in R3,C2),
  ... which rules out 6 for R2,C6 as the 6 is taken for R2,
  ... making R2,C6 a 5,
  ... which rules out 5 for R3,C4 as the 5 is taken for the top-middle block,
  ... and also rules out 5 for R2,C8 as the 5 is taken for R2.
As both possibilities lead to the same conclusion we know R3,C4 and R2,C8 are not 5.

after step 4

Step 5: R1,C9 cannot be a 5.

This is rule-out by candidate exhaustion at R7,C3:
5 at R1,C9 means: R3,C7 is 6; R1,C7 is 9; R2,C8 is 4; R3,C8 is 3;
      R8,C9 is 7; R9,C9 is 9; R7,C7 is 3; R7,C8 is 1;
      ... R7,C3 cannot be 1 as the 1 is taken for R7;
      R8,C7 is 5; R9,C8 is 6;
      ... R9,C1 and R9,C2 cannot be 6 as the 6 is taken for R9;
      R8,C1 is 6; R1,C1 is 1; R1,C9 is 5; R1,C3 is 4;
      ... R7,C3 cannot be 4 as the 4 is taken for C3;
      ... R6,C9 is 3; R5,C7 is 7; R5,C1 is 2; R7,C1 is 7;
      ... R7,C3 cannot be 7 as the 7 is taken for R7.

This leaves no candidates for R7,C3, so R1,C9 cannot be 5.

Finally(!) after all that, we can conclude:
R1,C9 must be 3.

Yes, that's a long way to go to get there; if there are any less painful methods to do it than to start exhaustively eliminating candidates in this sort of way, I'm not aware of any.

$\endgroup$
1
  • $\begingroup$ thanks, this is very well explained. I think the step 4 could be removed, we would find the same result without it. The last step could be simplified with R6, C9 is 3, R6, C2 is 7, R3, C3 is 7 so R7, C3 cannot be a 7. $\endgroup$ Commented Apr 9, 2023 at 15:38
-1
$\begingroup$

This one is hard indeed!

The bottom right cell must be either $5$ or $9$. I tried

putting $5$ there and reached a contradiction, but only after a looooong time:

gif showing progress after this assumption

At this point, all possible options lead to contradictions. (The last deduction here, the 6s and 1 on the left, came after assuming the opposite and reaching a contradiction; at the final stage of the gif, there are only two options for the top right 3x3 box, and either of them leads to a contradiction.)

Therefore, the bottom right cell must be

$9$.

$\endgroup$
3
  • 1
    $\begingroup$ This is not the kind of answer I expected. I knew the cell in bottom right could either be a 5 or a 9. I could have tried one of them like you did until reaching a contradiction. There are too many steps to find the contradiction. For sure there must be a more elegant way to solve it. $\endgroup$ Commented Apr 8, 2023 at 21:25
  • $\begingroup$ @OlivierBoissé I have created hundreds of Sudoku puzzle and for some of them complicated logic is necessary. Not all Sudoku puzzles have simple solutions. $\endgroup$ Commented Apr 8, 2023 at 22:09
  • 2
    $\begingroup$ the solution described here is not complicated logic. This is just "try a number until reaching an error". This solution is not conceivable if you can't erase the numbers on the grid once the contradiction has been found. $\endgroup$ Commented Apr 8, 2023 at 22:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.