Parity Magic

Thinking & Engaging
Thinking & Engaging
STEM
STEM

Through learning about “bits” and “parity” in computer programming, this activity explores the distortion of messages transferred between humans and between computers and how each can evaluate if the message sent is the same as that received.

Materials

  • Deck of cards or similar objects with two different sides

Framing

When sending a message between two people, or two computers, the message can often be distorted in the process. One person can mishear another and likewise the signal being transferred between computers can be distorted by electrical interference. Humans can often detect errors when presented with new information if the information doesn’t make sense or doesn’t fit the context. However, computers do not possess this intuition and require methods of error checking when transferring information; the simplest of these methods is called “bit parity”. Introduce this activity by describing how communications have “loss” or “noise” associated with them, and that we need a way to ensure that our messages (email, text messages, phone calls etc.) get from the sender to the receiver without errors.

Instructions

  1. Announce that the class will send a coded message to one instructor, who is sent out of the room.
  2. In order to create the message that we will send to the instructor, set out the cards in a random 4x4 grid so that everyone can see, making sure that some cards are showing the back and others showing the front. You can even have participants flip over some cards to ensure that it’s truly random.
  3. Now, we need to make sure that the other instructor has enough information to know whether the message he/she is receiving, is the correct. We will add more “data” to the message by making sure that each column and row has an even number of back-facing cards. The way we do this is by placing an additional row and column of cards, now a 5x5 grid, placing a back-facing card to achieve an even number or a front-facing card to maintain an even number.
  4. Choose one participant to act as the “interference” and let them flip one card.
  5. Call in the instructor who has been patiently waiting outside and have them point out which card was interfered with.
  6. Try out this trick with your group once or twice more to see if they can figure it out.

Modify

  • Assist in the framing of this activity by playing a round of Human Telephone and afterwards explaining how computers can also distort messages.
  • Try adding a second, or more, error(s) to the card game. Can they detect them all?
  • Increase the number of rows and columns?
  • If you have a group of at least 25, try out the activity with people instead of cards.

Safety

  • There aren’t any foreseeable safety concerns.

Wrap-up

Ask to see if the group can determine how the instructor was always able to figure out which card was flipped.

  • Did you notice a pattern in the cards?
  • What did the grid look like before the extra column and row? What was the grid like after?

If the group has not figured it out, lay out another 4x4 grid of cards and ask them how many back-facing cards are in each row and column. Then place the additional row and column, making sure there that is an even number of back-facing cards in each, and ask them once more how many back-facing cards are in each row and column. What does each of these numbers have in common? Eventually describe how the card trick works. We’ve placed an extra row and column to give the other instructor a basis for knowing whether the message is correct of if there’s an error. Ground the “answer” in the context of parity and error checking for computers communicating. The parity of a number describes essentially whether that number is even or odd. Since the cards represent binary numbers (front-facing cards=0, back-facing cards=1) they only have two values. If you know a particular card is not correct, it must be the other value. Allow the group to try it themselves in pairs or small groups.Are there any limitations to error correction using parity? Yes, we can only be guaranteed to correct one error if only one error is present. Depending on how the errors are distributed in the card game we might be able to correct more than one error, but this is not true in every case, therefore we cannot make that assumption.



Adapted from Actua. “Codemakers Parity Magic.” Actua.ca. Retrieved online from: https://actua.ca/en/activities/codemakers-parity-magic/