CS Unplugged has a lesson on error detection that uses secret parity bits to make a card trick work.

I wanted to use this activity as part of a timed team event, so I wrote a script to generate grids of arbitrary size where the bottom row and right column of tiles are parity bits. Check out the code on GitHub. If an adaptation of this would be useful for your classroom, email me at web@curtis.in and I’ll see if I can help you out.

Here is a handout with sixteen grids ranging from 6x6 to 9x9 tiles. I generated 10 grids each of edge size 3-10 and put them in this Google Drive folder as PDFs and PNGs. Each grid has exactly one random tile flipped.

Example grids.