You are on page 1of 5

Matthew Burger

Professor Buckingham
MATH 3096 – Math of Games and Puzzles
2 November 2017

Project 2: Bit Blocks Puzzle Design

Bit Blocks is a logic puzzle similar to both sudoku and KenKen (also known as
mathdoku). As the name suggests, this puzzle takes advantage of base-2 or binary numbers
(which are referred to as bits), as well as basic Boolean algebra. The underlying structure of the
game is an N by N gridded structure. For the sake of simplicity, this project will focus on the 4-
by-4 (2 bit) and 8-by-8 (3 bit) forms of this puzzle; however, this puzzle may be generalized to
any N by N grid where N is a multiple of two. The condition on the value of N is optional, but it
prevents situations in which out-of-bound values may be inadvertently used (e.g. NOT 00002/010
yields 11112/1510 in a 9 by 9 grid). The rules are as follows:

(1) Enter the numbers 0002 (010) through 1112 (710) such that they each appear once in each
row and column. For a 4-by-4 grid, the range would naturally be 002 through 113.
(2) The numbers in each bolded region must satisfy the given bitwise operation and result.
(3) Numbers shall not be repeated in a bolded region.

Bitwise operations are operations that compare two bits of the same relative position (i.e. the first
bit of number A is compared to the first bit of number B, etc.). There are many potential bitwise
operations that could utilized; however, Bit Blocks uses only the four rudimentary bitwise
operators: NOT, OR, AND, and XOR. Furthermore, Bit Blocks uses bolded regions that include
two blocks or fewer, restricting the mathematics required to two-element Boolean operations.
NOT, also denoted by the tilde character ~, is a unary bitwise operator that yields the
complement of a given number. For example, the operation ~ 0102 yields the value 1012.
Because this is a unary logic operator, there is only one input that will produce a given output.
The truth table for the NOT operator is given in Table 1.

A ~A
0 1
1 0
Table 1: NOT Operator Truth Table

OR, also denoted by the pipe character |, is a binary bitwise operator that yields 1 if either
A or B is 1. For example, the operation 1002 | 0012 yields the value 1012. The truth table for the
OR operator is given in Table 2.

A B A|B
0 0 0
0 1 1
1 0 1
1 1 1
Table 2: OR Operator Truth Table
AND, also denoted by the ampersand character &, is a binary bitwise operator that yields
1 if both A and B are 1. For example, the operation 1112 & 0112 yields the value 0112. The truth
table for the AND operator is given in Table 3.

A B A&B
0 0 0
0 1 0
1 0 0
1 1 1
Table 3: AND Operator Truth Table

XOR, also denoted by the enclosed cross character , is a binary bitwise operator that
yields 1 if the values of A and B are different. For example, the operation 1112 & 0112 yields the
value 1002. The truth table for the XOR operator is given in Table 4.

A B AB
0 0 0
0 1 1
1 0 1
1 1 0
Table 4: XOR Operator Truth Table

The possible combinations for the NOT operator and a given result in a 4-by-4 puzzle are
detailed in Table 5.

C = ~A A
00 11
01 10
10 01
11 00
Table 5: NOT Operator Combinations for 4-by-4 Puzzle

The possible combinations for the OR operator and a given result in a 4-by-4 puzzle are
detailed in Table 6. Multiple matches for B for a certain value of A are given in parentheses.
Furthermore, repeated matches are not given (e.g. if 102 OR 112 is given, 112 OR 102 is not).

C=A|B A|B
00 Not Possible (Rule 3)
01 00 OR 01
10 00 OR 10
11 00 OR 11; 01 OR (10, 11); 10 OR 11
Table 6: OR Operator Combinations for 4-by-4 Puzzle
The possible combinations for the AND operator and a given result in a 4-by-4 puzzle are
detailed in Table 7.

C=A&B A&B
00 00 AND (01, 10, 11); 01 AND 10
01 01 AND 11
10 10 AND 11
11 Not Possible (Rule 3)
Table 7: AND Operator Combinations for 4-by-4 Puzzle

The possible combinations for the XOR operator and a given result in a 4-by-4 puzzle are
detailed in Table 8.

C=AB AB
00 Not Possible (Rule 3)
01 00 XOR 01; 10 XOR 11
10 00 XOR 10; 01 XOR 11
11 00 XOR 11; 01 XOR 10
Table 8: XOR Operator Combinations for 4-by-4 Puzzle

The possible combinations for a given operator and result in an 8-by-8 puzzle are
lengthy. Therefore, an exhaustive list of the combinations will not be given; however, these
determinations are rather straight forward.
A simple 4-by-4 puzzle example is given in Figure 1. The construction of this puzzle is
detailed following the figure and a solution is given in the appendix.

00~ 10&

11|

01& 10

Figure 1: 4-by-4 Bit Blocks Example Puzzle

One may begin construction of the puzzle by placing an arbitrary clue into a space.
Because the NOT operator gives the most information regarding the value of the box, this will be
the first operator used.
Since this is arbitrary (within the confines of the rules and value range), we shall begin
with the clue 00~ in the upper-left corner. This clue yields a value of 112 (310); therefore, the next
steps shall seek to restrict the placement of other 112s. There are several possible clues that may
accomplish this; one such case is the placement of the clue 10& in the upper-right corner,
extending downwards. This clue has only one combination, 102 AND 112. Because there is
already a 112 in the first row, the 112 must go in the second row. Further restricting the
placement of 112, the clue 01& may be placed in row 3, column 1, extending rightward. This
clue has only one combination, 012 AND 112. Because there is already a 112 in the first column,
the 112 must go in the second column; there must also be a 112 in row 4, column 3.
Now that the placement of 112 is restricted, one may move on to the restriction of either
012 or 102. If one chooses to restrict 10, one may place the clue 10 in R3C3. This clue restricts
R3C3 to 10 and R3C4 to 00, per Table 8 and the previous clues. R4C4 is also restricted to 01 by
Rule 1. Further placement of the clue 11| in R2C2 restricts R2C2 to 10 and R2C3 to 01, due to
previous clues. From here, the puzzle may be solved without the addition of more clues through
the use of Rule 1.
A more advanced 8-by-8 puzzle example was planned. However, the construction of this
puzzle, while theoretically very similar to that of the 4-by-4 puzzle, turned out to be
exponentially more difficult. While it was trivial to obtain a working 8-by-8 puzzle using a
significant number of NOT operations, this was deemed unchallenging and was therfore not
included in the report.
Appendix

The solution to the puzzle in Figure 1 is given in Figure 2.

00~ 10&

11 01 00 10
11|

00 10 01 11
01& 10

01 11 10 00

10 00 11 01
Figure 2: Solution to 4-by-4 Example Puzzle

You might also like