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.
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 Parity | Known Cage Parity | Unknown Cage Parity |
EVEN | EVEN | EVEN |
| ODD | ODD |
ODD | EVEN | ODD |
| ODD | EVEN |
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:
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
EVEN2 = 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.
The Rows C+D must add up to 42, so
EVENCage C1 (2÷) remaining solutions {1,2} and 3,6} both
ODDCell C2 (4)
EVENCage C3 (20x) UNKNOWN
Cage C4 (3-)
ODDCage C5 (9+)
ODDCell D6 = {4,6}
EVENSo unknown cage C3 (20x) must be
ODDA 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*4 | ODD |
4 (3 cell) | = 1*1*4 = 1*2*2 | UNKNOWN |
6 (2 cell) | = 1*6 = 2*3 | ODD |
6 (3 cell) | = 1*1*6 = 1*2*3 | EVEN |
8 (2 cell) | = 2*4 | EVEN |
8 (3 cell) | = 1*2*4 | ODD |
9 (3 cell) | = 1*3*3 | ODD |
10 (2 cell) | = 2*5 | ODD |
10 (3 cell) | = 1*2*5 | EVEN |
12 (2 cell) | = 2*6 = 3*4 | UNKNOWN |
12 (3 cell) | = 1*2*6 = 1*3*4 = 2*2*3 | UNKNOWN |
15 (2 cell) | = 3*5 | EVEN |
15 (3 cell) | = 1*3*5 | ODD |
16 (3 cell) | =1*4*4 = 2*2*4 | UNKNOWN |
18 (2 cell) | = 3*6 | ODD |
18 (3 cell) | = 1*3*6 = 2*3*3 | EVEN |
20 (2 cell) | = 4*5 | ODD |
20 (3 cell) | = 1*4*5 = 2*2*5 | UNKNOWN |
24 (2 cell) | = 4*6 | EVEN |
24 (3 cell) | = 1*4*6 = 2*2*6 = 2*3*4 | UNKNOWN |
25 (3 cell) | = 1*5*5 | ODD |
30 (2 cell) | = 5*6 | ODD |
30 (3 cell) | = 1*5*6 = 2*3*5 | EVEN |
32 (3 cell) | = 2*4*4 | EVEN |
36 (3 cell) | = 1*6*6 = 2*3*6 = 3*3*4 | UNKNOWN |
40 (3 cell) | = 2*4*5 | ODD |
45 (3 cell) | = 3*3*5 | ODD |
48 (3 cell) | = 2*4*6 = 3*4*4 | UNKNOWN |
48 (4 cell) | = 1*2*4*6 = 2*2*3*4 | ODD |
50 (3 cell) | = 2*5*5 | EVEN |
54 (3 cell) | = 3*3*6 | EVEN |
60 (3 cell) | = 2*5*6 = 3*4*5 | UNKNOWN |
60 (4 cell) | = 1*2*5*6 = 1*3*4*5 = 2*2*3*5 | UNKNOWN |
72 (3 cell, straight) | = 3*4*6 | ODD |
72 (3 cell, bent) | = 2*6*6 = 3*4*6 | UNKNOWN |
75 (3 cell) | = 3*5*5 | ODD |
80 (3 cell) | = 4*4*5 | ODD |
90 (3 cell) | = 3*5*6 | EVEN |
96 (3 cell) | = 4*4*6 | EVEN |
100 (3 cell) | = 4*5*5 | EVEN |
108 (3 cell) | = 3*6*6 | ODD |
120 (3 cell) | = 4*5*6 | ODD |
120 (4 cell) | = 1*4*5*6 = 2*2*5*6 = 2*3*4*5 | UNKNOWN |
144 (3 cell) | = 4*6*6 | EVEN |
150 (3 cell) | = 5*5*6 | EVEN |
180 (3 cell) | = 5*6*6 | ODD |
216 (4 cell) | = 2*3*6*6 | ODD |
Comments
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.