News and Updates on X
SudokuWiki.org
Strategies for Popular Number Puzzles

KenKen Parity Strategy

The parity Strategy was first discussed in a 2011 paper by Reiter, Thornton and Vennebush. I am grateful to Roger Taft for finding this, composing much of this article and sending examples found from solving KenKen puzzles. At some point in 2024 I did have some reasonable code that identified some of the parity opportunities but as of Jan 2025 it is not ready to release. However the ideas here are so useful I wanted to get the documentation up. (Ed.)

Parity is easy to check for. When other strategies have been exhausted, there is a good chance an advance based on parity is possible. That advance usually solves the whole puzzle.

Take this very simple situation of a single row in a 6x6 KenKen. We know that the whole row must add up to 21. The two cages with -1 must have values that add up to an ODD number. The block (21) is also ODD so we have a total of 3 ODD elements.
Parity idea
That means the final number in the 12x cage must sum as ODD as well. That rules out {2,6} (2+6=8, EVEN) and means {3,4} (3+4=7, ODD) as the true values for that cage!

Determining Cage Parity

First, some terminology. A KenKen board is a 6x6 square grid of cells. Adjacent rows (or columns) can be grouped together as a block. Within a block there are cages, a set of contiguous cells, with an associated arithmetic operation (add, subtract, multiply, divide) and a target value. The cages may be complete (wholly inside the black) or partial (where the cage is crossed by a block boundary).

Parity is the mathematical property of being ODD or EVEN. The odd numbers, 1, 3, 5 … have odd parity. The even numbers 2, 4, 6 … have even parity. The sum of two odd numbers is even so has even parity. A set of odd numbers has the parity of the count of the number of items in the set. Each row or column in the board sums to 21 (giving rise to the “Rule of 21”) so has odd parity. A block has the parity of the width of the block. So a block 2 rows wide has EVEN parity as does the whole board.

Each cage or partial cage in a block has a parity. The parity strategy looks for a block where each cage (complete or partial) has a known parity except exactly one. Since the parity of the block is known, the parity of the single unknown cage becomes known. This new information is used to advance the solution.

The parity of a block is the parity of the block width: blocks 1, 3, and 5 wide have ODD parity, blocks 2, 4, and 6 (the whole puzzle) have EVEN parity.

The Parity Rule is: Find a block where all cages (complete and partial) have known parity except for a single cage (complete or partial). Then the parity of the unknown cage is:

Block ParityKnown Cage ParityUnknown Cage Parity
EVENEVENEVEN
ODDODD
ODDEVENODD
ODDEVEN



Innie Example

Pairs of rows or columns which must add up to 42, an EVEN number. (Larger blocks are also possible but 3 rows = ODD). This example is taken from New York Times, Nov 3rd 2024:
Parity example 1
There is one cage that sticks out of this block (an innie/outie) coloured blue and the innie C2 contains 4 or 5. Looking at the other cages wholly inside the block we quickly determine which have even or odd parity. The sum of values in the cage on A1 must be ODD, as must the 5- in the cage starting on F1.

The remaining cages starting in B1 (6+), C1 (18x) and E1 (3÷) are all EVEN when looking at their possible sums.

Only C2 is unknown. To determine the parity of the whole block, exclusive of the target cell, we simply count the number of odd parity elements and note the parity of the count. In this case there are two odds so the aggregate is EVEN, meaning the target must be EVEN. That means we must keep the 4 in C2 and remove 5. This breaks open a previously stuck puzzle.

Note: In this example the block value is 42 which is EVEN. So it does not contribute to the parity count. Whereas the single row example we started with sums to 21 - which is ODD and so it included in the count of elements.

Common Parity Cases

The parity of a complete cage depends on the operation and target value. Here are the parities of the common cases:

Cage Operation Plus or Minus. Parity of the target value.
For example, the parity of a cage with a 1- operation is ODD.

Cage Operation Division. There are only 5 total cases of which two are common:
3 = 3/1 = 6/2 EVEN
2 = 6/3 = 4/2 = 2/1 UNKNOWN

Cage Operation Multiply
- see below

The parity of a partial cage is:
  • Partial Cage, One Cell, Solved: Parity of solved cell
  • Partial Cage, One Cell, All Values Same Parity: Common parity
  • Partial Cage, Two Cell Pair: Parity of pair
  • Partial Cage, Three Cell Triple: Parity of triple

Having determined the parity of the unknown cage, some reduction in that cage is usually possible. The common cases are:
  • Cell Value Now Known. Set cell to the value.
  • Cell Parity Now Known. Eliminate numbers of the other parity from the cell.
  • Cage Parity Now Known, Two Solutions. Set cage to the valid solution.
  • Cage Parity Now Known, Three Solutions. Examine invalid solutions for values that do not appear in the valid solutions and eliminate those values. For example, a cage with the clue 2/ has the possible solutions: {1,2}, {2,4}, {3,6}. If the cage is determined to have even parity the cage is {2,4}; if the cage is determined to have odd parity all 4s can be eliminated

Example 2

This example is taken from KenKen 40924 targets the one cage inside the block with an unknown parity. It is almost the reverse of the first example in that the innie D6 has a known parity but one internal cage is unknown.
Parity example 2
The Rows C+D must add up to 42, so EVEN
Cage C1 (2÷) remaining solutions {1,2} and 3,6} both ODD
Cell C2 (4) EVEN
Cage C3 (20x) UNKNOWN
Cage C4 (3-) ODD
Cage C5 (9+) ODD
Cell D6 = {4,6} EVEN
So unknown cage C3 (20x) must be ODD
A 3-cell cage with 20x has possible values of {1,4,5} EVEN or {2,2,5} ODD so the eventual solution must be latter.

Parity Value for Common Multiply Cases

4 (2 cell)= 1*4ODD
4 (3 cell)= 1*1*4 = 1*2*2UNKNOWN
6 (2 cell)= 1*6 = 2*3ODD
6 (3 cell)= 1*1*6 = 1*2*3EVEN
8 (2 cell)= 2*4EVEN
8 (3 cell)= 1*2*4ODD
9 (3 cell)= 1*3*3ODD
10 (2 cell)= 2*5ODD
10 (3 cell)= 1*2*5EVEN
12 (2 cell)= 2*6 = 3*4UNKNOWN
12 (3 cell)= 1*2*6 = 1*3*4 = 2*2*3UNKNOWN
15 (2 cell)= 3*5EVEN
15 (3 cell)= 1*3*5ODD
16 (3 cell)=1*4*4 = 2*2*4UNKNOWN
18 (2 cell)= 3*6ODD
18 (3 cell)= 1*3*6 = 2*3*3EVEN
20 (2 cell)= 4*5ODD
20 (3 cell)= 1*4*5 = 2*2*5UNKNOWN
24 (2 cell)= 4*6EVEN
24 (3 cell)= 1*4*6 = 2*2*6 = 2*3*4UNKNOWN
25 (3 cell)= 1*5*5ODD
30 (2 cell)= 5*6ODD
30 (3 cell)= 1*5*6 = 2*3*5EVEN
32 (3 cell)= 2*4*4EVEN
36 (3 cell)= 1*6*6 = 2*3*6 = 3*3*4UNKNOWN
40 (3 cell)= 2*4*5ODD
45 (3 cell)= 3*3*5ODD
48 (3 cell)= 2*4*6 = 3*4*4UNKNOWN
48 (4 cell)= 1*2*4*6 = 2*2*3*4ODD
50 (3 cell)= 2*5*5EVEN
54 (3 cell)= 3*3*6EVEN
60 (3 cell)= 2*5*6 = 3*4*5UNKNOWN
60 (4 cell)= 1*2*5*6 = 1*3*4*5 = 2*2*3*5UNKNOWN
72 (3 cell, straight)= 3*4*6ODD
72 (3 cell, bent)= 2*6*6 = 3*4*6UNKNOWN
75 (3 cell)= 3*5*5ODD
80 (3 cell)= 4*4*5ODD
90 (3 cell)= 3*5*6EVEN
96 (3 cell)= 4*4*6EVEN
100 (3 cell)= 4*5*5EVEN
108 (3 cell)= 3*6*6ODD
120 (3 cell)= 4*5*6ODD
120 (4 cell)= 1*4*5*6 = 2*2*5*6 = 2*3*4*5UNKNOWN
144 (3 cell)= 4*6*6EVEN
150 (3 cell)= 5*5*6EVEN
180 (3 cell)= 5*6*6ODD
216 (4 cell)= 2*3*6*6ODD

Go back to Rule of 21Continue to Escargot


Comments

Your Name/Handle

Email Address - required for confirmation (it will not be displayed here)

Your Comment

Please enter the
letters you see:
arrow
Enter these letters Remember me


Please ensure your comment is relevant to this article.
Email addresses are never displayed, but they are required to confirm your comments. When you enter your name and email address, you'll be sent a link to confirm your comment. Line breaks and paragraphs are automatically converted - no need to use <p> or <br> tags.
CommentsTalk
Article created on 1-January-2025. Views: 223
This page was last modified on 2-January-2025.
All text is copyright and for personal use only but may be reproduced with the permission of the author.
Copyright Andrew Stuart @ Syndicated Puzzles, Privacy, 2007-2025