How does the circle leader keep spotting the lie?

In this activity, students are given sets of cards, each with a row of numbers, and each number printed in one of two colors. After giving them a chance to examine their cards, the circle leader calls on some of the students in turn: Each is instructed to choose one of their cards and tell the circle leader the sequence of colors (but not the numbers) shown on that card, but to lie about one of those colors. Somehow, the circle leader is always able to state the number corresponding to the color that the student lied about!

Computational activity (in progress): For students who've figured out the mathematics behind the circle leader's stunt, one possible next step is to tackle the task of writing a program that generates the cards for this activity. A natural extension of this is the creation of alternative card sets – using different number bases, different lengths of number sequences on the cards, etc.