Bitwise XOR Game

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

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?

[more]

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 , , and .

[less]

Contributed by: Ed Pegg Jr (August 2016)
Open content licensed under CC BY-NC-SA


Snapshots


Details

detailSectionParagraph


Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.
Send