# Bitwise XOR Game

Bitwise XOR Game

You are given a random collection of nine cards with up to six black squares in each. Can you pick three to five cards so that the total number of black squares in each of the six positions is even?

This is equivalent to finding a set of numbers whose bitwise XOR equals 0.

In Mathematica, the built-in function is BitXor. yields the integer whose binary bit representation has ones at positions where an odd number of the binary bit representations of the have ones. For example, BitXor[61,15] is 50 because =111101, =001111, and =110010.

BitXor[,,…]

n

1

n

2

n

i

61

2

15

2

50

2