17 responses to “KenKen Conundrum – How Many Possible Puzzles Are There?”

  1. anonymous

    This is a hard question – I’m not sure how to solve it.

  2. Crystal

    At first, I thought 3,456 was correct too. But during lunch today, I think there are actually less than 3,456 possible puzzles (ignoring cages and math operations).

    Here’s my logic:

    Starting with a simpler problem and building from there:

    1×1 grid = 1
    1

    2×2 grid = 2
    2 * 1
    where:
    12 or 21
    21 12

    3×3 grid = 12
    6 * 2 * 1
    where:
    row 1 row 2 row 3
    123 <- xxx xxx(1)
    132 xxx(1) xxx(1)
    213 xxx(3) xxx(3)
    231 231 <- xxx
    312 312 312
    321 xxx(2) xxx(2)
    note, the numbers in () indicate why the arrangement was removed

    4×4 grid = 864
    24 * 9 * 4 * 1
    row 1 : 24 permutations
    row 2 : 9 permutations remain (after removing column conflicts)
    row 3 : 4 permutations remain (after removing column conflicts)
    row 4 : 1 permutation remains (after removing column conflicts)

    So there you have it, I think there are 864 different possible puzzles in a 4×4 grid.

  3. Crystal

    That didn’t turn out right, it looks like my comment lost some of its formatting. Let’s try it one more time:


    At first, I thought 3,456 was correct too. But during lunch today, I think there are actually less than 3,456 possible puzzles (ignoring cages and math operations).

    Here's my logic:

    Starting with a simpler problem and building from there:

    1x1 grid = 1
    1

    2x2 grid = 2
    2 * 1
    where:
    12 or 21
    21 12

    3x3 grid = 12
    6 * 2 * 1
    where:
    row 1 row 2 row 3
    123 <- xxx xxx(1)
    132 xxx(1) xxx(1)
    213 xxx(3) xxx(3)
    231 231 <- xxx
    312 312 312
    321 xxx(2) xxx(2)
    note, the numbers in () indicate why the arrangement was removed

    4x4 grid = 864
    24 * 9 * 4 * 1
    row 1 : 24 permutations
    row 2 : 9 permutations remain (after removing column conflicts)
    row 3 : 4 permutations remain (after removing column conflicts)
    row 4 : 1 permutation remains (after removing column conflicts)

    So there you have it, I think there are 864 different possible puzzles in a 4x4 grid.

  4. Avi Ornstein

    I find this exchange fascinating. It catches the mind and gets one thinking at several layers. Part of the problem is that the puzzle is not clearly stated, leading to multiple interpretations. If anyone is interested in similar mental exercises, you can try reading “Increase Your Brain Power”, which was just released and includes a few chapters with puzzles on this level (plus both simpler and more complicated puzzles).

  5. KenKen Conundrum - Solution of Permutations on a 4×4 Grid « Mr. L’s Math

    [...] have the solution to the KenKen Conundrum posed recently. I asked my students to solve the following problem, and several of them succeeded. [...]

  6. Jeff

    The really intersting bit is the third row. The first row has 4! =24 permutions. The second row has 9 permissable permutations for each permutaion on the first row. The 9 can be arrived at by counting the “bad” cases. Exactly one permutation would be indentical to the first row, 8 would have exactly one conflict and 6 would have exactly 6 conflicts with the first row. Subtracting 1+6+8=15 from the total of 4!=24 permutations for the second row leaves the 9 permissable permutations for the second row.

    Now based on column conflicts alone, there are 2 possible values for each value in the third row, meaning that there are 16 possible permutations that would not violate the column restrictions. 24*9*16 = 3456, Mr. L’s initial answer. However, you might see that intuitively this doesn’t make much sense, since row 3 would have more permuations than row two, despite having more constraints – this answer does not consider the row restrictions in row 3!

    So let’s consider what is known about row 3. We know the fourth element is defined by the first 3, so only has one possibility. We know the first element in the row only has column restraints so has 2 possible values for each permutation of rows 1 and 2.

    Element 2 of row 3 can have 1 or 2 possible values depending on the columnn restraints from row 1 and 2 and the row restraint provided by the first element in row 3. Similarly, element 3 can have 0 (over constrainted), 1 or 2 possibilities depending on the column restraints of row 1 and 2 and the row restraints of the first two elements in row 3. By inspection I saw that 3 of the permissable permuations for row 2 would result in 4 permissable permutations in row 3, while the other 6 permuations in row 2 would only result in 2 permissable permuations in row 3 (i.e. the row is full specified by the first element). So the total number of permutations for a 4×4 Ken Ken is (24*3*4)+(24*6*2)=576

  7. Jeff

    Crystal was right on the money through the first two rows. Things get complicated in row 3 though. For some choices of permutations in row 2, there are 4 valid permutations for row 3. For other choices of permutations in row 2, there are only 2 valid permutations in row 3. As it turns out, of the 9 valid choices of permutations for row 2, 3 will lead to 4 valid permutations of row 3, while the remaining 6 permutations of row 2 will only lead to 2 valid permutations of row 3. I didn’t have any insight to leap to the previous point – just did it by inspection. So the total number of valid permutations of a 4×4 ken ken is 24*[(6*2)+(3*4)] = 24*24 = 576.

    According to wikipedia there is not a general solution to this problem for a nxn square – and 4×4 is about the last case where it is feasible to work it out in a few minutes.

  8. Paul Kunasz

    Finally, I found a web site which tackles the problem I have been working on – thank you.

    For Ken Ken squares of size 2×2, 3×3, and 4×4, I find 2, 12, and 864 possibilities, respectively. So, I agree with a number of your responders. My goal was to work this out for 6×6, but at present I have not even finished the 5×5 case. The bigger the NxN value the more branch points there are, and there does not seem to be any obvious pattern to it that you can write down. I would like to see the formula for NxN if anybody knows it. It would be very hard to get it by empirical extrapolation from the three cases I solved.

    P. Kunasz

  9. wintix

    The problem can be generalized, if you understand how a kenken field is built. First you fill the field with numbers in a simple scheme:

    Say our field is 3×3

    123
    312
    231

    After that you shuffle the vertical lines and you get something like that:

    231
    123
    312

    After that you shuffle the horizontal lines:

    312
    231
    123

    You now have a random kenken. For each operation you have 3! possibilities. The total permutations of a 3×3 kenken is thereby (3!)^2

    And to generalise it for a n*n kenken:

    (n!)^2

    cheers,

    wintix

  10. paul Kunasz

    RESULTS OF A COLLEAGUE’S FORTRAN PROGRAMBELOW. 4X4 CASE ALSO CHECKED BY HAND, BOTH IN THE ABSTRACT, AND GRID-BY-GRID. GOING BEYOND THESE CASES GETS INTO DOUBLE, THEN QUADRUPLE PRECISION COMPUTER INSTRUCTIONS BECAUSE THE RESULT BLOWS UP SO RAPIDLY. SO,HAS ANYONE FOUND A GENERAL EXPRESSION?

    RESULTS OF CODE:

    Grid size (n): 2
    Number of grids: 2

    Grid size (n): 3
    Number of grids: 12

    Grid size (n): 4
    Number of grids: 576

    Grid size (n): 5
    Number of grids: 161280

    Grid size (n): 6
    Number of grids: 812851200

    Grid size (n): 7
    Number of grids: 61479419904000

  11. Zytheran

    This might be the number of arrangements for the underlying numbers but they do not represent the added complexity of the pattern of cages. It is not addressing the question of how many KenKen puzzles there are.
    For a 4×4 KenKen we would need to multiply 576 by the number of valid cage patterns and also realize each cage can have one of 4 mathematical operators.
    Might want to start with the 3×3… :-)

  12. Jolee

    Zytheran,

    Paul K’s answer gives ALL the possible combinations, regardless of cages, since the rules of how the numbers can be arranged in the grid will still apply. The cages and the operations they contain simply guide the player with number placement. These are determined by the KenKen Generator Programs after the numbers have been filled, and depend on a difficulty level. The possible combinations of numbers that may be chosen from is quite limited to the grid’s size, as explained by several contributors to this thread. Perhaps you would enjoy rewriting the code for one if actually playing has ceased to be diverting.

  13. Tom Davis

    A KenKen grid, before cages, is called by mathematicians a Latin square. The problem of counting the number of NxN Latin squares is still unsolved. The results of the computer program above are correct up to N=7. Look up “Latin squares” in Wikipedia for more information.

  14. ian

    extrapolation puzzle

    if 7+6 = 113 and
    9+1= 810 and
    5+3 = 28 and
    9+6 = 315 then what does 7+2 = ?

  15. Will

    The answer to the extrapolation puzzle is 59. The first digit is 7 – 2, the next digit is 7+2.

Leave a Reply