Parity magic
A card trick that shows how a computer can find a mistake and fix it by adding one extra row and one extra column.
Steps
- Tell the class you have a magic trick. Ask a helper to lay out a 5 by 5 square of cards, some black and some white, in any pattern.
- Say you will add one more row and one more column. Add cards so that every row and every column has an even number of black cards.
- Now you have a 6 by 6 square. Ask the class to close their eyes while the helper flips exactly one card.
- Look at each row and column. Find the row that has an odd number of black cards, and the column that has an odd number.
- The card where that row and column cross is the one that was flipped. Flip it back.
- Let pairs try the trick on their own.
Talk about it
- Why does the trick always work?
- Where might a computer need to find mistakes, like a scratched disc or a QR code?
CC BY-SA 4.0
Adapted from CS Unplugged by the University of Canterbury Computer Science Education Research Group (CS Unplugged), licensed CC BY-SA 4.0.
Original lesson, with pictures · License: CC BY-SA 4.0
There are no pictures here. The original lesson has the pictures and printables.
Changes made: Simplified, shortened and translated by Open Cosmos with AI
This adapted lesson is shared under the same license (CC BY-SA 4.0).