(Dr.R.K.) HOWTO - 2x2 - badly counted

Go to Top Go to Bottom blank blank Go up one level R.K.'s Home Page Keyword Index Site Map Help Linux

So instead of the full 3x3 Sudoku, let's examine the smaller and more tractable 2x2 sudoku, and start with the base solution and adopt a 0-based index labeling:


              0 1   2 3 <- columns
              a b   c d <- internal labels

       w 0    1 2 | 3 4
       x 1    3 4 | 1 2
              ----+----
       y 2    2 3 | 4 1
       z 3    4 1 | 2 3
       ^ ^
       | rows
    internal labels

The set of operations are listed as the following where the operations are also assigned a 'bit' and the order of operations are performed from top to bottom (or from least value to greatest). This then gives each generated solution a "value" and permutation, where the permutation is of the symbols "1234".

Operation Bit Value Explanation
swapRwx 0x01 swap rows 0 and 1
swapRyz 0x02 swap rows 2 and 3
swapCab 0x04 swap columns 0 and 1
swapCcd 0x08 swap columns 2 and 3
swapBR 0x10 swap block rows
swapBC 0x20 swap block columns
swapT 0x40 transpose around main diagonal

The number of different combinations becomes:
(2 x 2 x 2) x (2 x 2 x 2) x 2 x 4! = 27 x 4! = 3072

However, we shall find that this overcounts the number of solutions that can be generated by these operations by a factor of 16, and does not generate solutions that include the Christian Baune "flip".


Brought to you by: R.K. Owen,Ph.D.
This page is http://rkowen.owentrek.com/howto/sudoku2x2bad.html