Bit Manipulation (thinking in bits)

The moves you can make directly on a number’s row of switches: keep what two rows agree on, turn one on, flip every switch, tell which disagree, slide the row along. This lesson is what those moves build: flags packed into one integer, the one item with no partner, every subset of a group, a faster way to count.
Before you start. One fact from Numbers for Real (signed ints, overflow, floating point): a computer stores every whole number as a row of ones and zeros, read like ordinary counting but in twos instead of tens, so 1100 is one eight and one four, twelve. Nothing past that: no calculus, just counting.