Photographic Memory Card Game

You have an amazing photographic memory which helps you to quickly memorise patterns. You prove this skill by pointing out what card, in an array of many random cards (from thousands of possible combinations) has changed. Welcome to the Photographic Memory Card Game! 

Memory Card Game for Schools

For the purpose of this explanation, I am going to use a set of cards that are red on one side and blue on the other. A spectator / student deals sixteen cards onto the table in a 4 x 4 grid choosing to place each card either red-facing or blue-facing. Whilst they do this you turn your back and look away.

You then turn back around and explain that such a small grid would be where a novice would start but you can make it much more difficult by adding an extra row and column to make it a 5 x 5 grid. You do this as quickly as possible whilst explaining that you are going to try and memorise the grid.

You then turn away as soon as you complete the grid. Your spectator chooses any card from the 5 x 5 grid and flips it over. No-one speaks. You are still turned away. If your ability to memorise patterns is as good as you say it is,  you will  immediately be able to tell the spectator if it was a red card or blue card that was flipped over.

You turn back to face the grid and immediately tell the spectator what colour of card was flipped over. Better still, you then take it a stage further by pointing out the exact card that was flipped!

You have successfully demonstrated your amazing photographic memory in action. This is a fantastic memory game card trick, perfect for STEM Learning in schools.

Watch the Full Performance of Photographic Memory Here

Photographic Memory: Secret Knowledge

The trick is a flamboyant variation of the one invented by a New Zealand computer scientist called, Tim Bell and also published by CS4FN.


You add an extra row and column of cards to make it seem more complicated but in fact you are setting up the outcome. You are not making things harder, as you suggest, but easier!

What you do is look at the number of blue-facing cards in the first row and if that number is odd, you extend the grid with a new blue-facing card to ensure that the amount of blue-facing cards in that row is even!

If the number of blue-facing cards is even then place the new card as red-facing. You always want an even number of blue-facing cards in every row.

The same procedure applies when adding the extra cards to the columns. Every card you add should create an even number of blue-facing cards. The final card on the bottom right of the last row finishes the set. The set up is complete.

Detecting the Change

Detecting the change doesn’t rely on pattern recognition but your ability to spot the row and column with an odd amount of blue-facing cards. You look at the cards and start from the top, scanning down row by row, looking for blue-facing cards. Remember you added the extra cards to ensure there was an EVEN number of blue-facing cards in each row.

There will now be one row where there is now an ODD number of blue-facing cards: one of the cards in this row was turned over, but which one?

Start to scan the columns now, again looking for the column where there is an ODD number of blue-facing card showing.

When you find it, you’ve found the column with the flipped card!

You now know the row and column position. Like GPS, in a way – you have the longitude and latitude. That is the position of the flipped card is where the row and column intersect.


Can you spot the card that has been turned over?


Photographic Memory game for Schools Grid Setup


Photographic Memory game for Schools - Grid Pattern change

The Computer Science

Now that you have a photographic memory, you can now repeat the effect by using cards that have 1’s on one side and 0’s on the other as a way of introducing the computer science.

Photgraphic Memory computer science theory

Data parity

What does this effect have to do with computer science? The extra row and column you add have a technical name: the ‘parity row’ and the ‘parity column’. (Parity means equal). Instead of thinking about blue-facing cards or red-facing cards think about binary 1 and 0.

Binary 1 = face-down
Binary 0 = face-up

You can see that your block of cards could just as easily represent a segment of computer data, with the data encoded in 1’s and 0’s.

Data sent over a computer network is just a series of 1’s and 0’s (each called a ‘bit’) packaged into blocks. Trouble is the real world is a ‘noisy’ place. Signals can be corrupted in all sorts of ways: cosmic rays, radio signals, nearby power lines and the like can all zap bits. It’s easy for them to be flipped as they pass over a network. One change can destroy the whole meaning of the message.

To ensure that when you send data over a computer network all the data makes it to the other end without getting scrambled, computer scientists and engineers came up with the idea of adding parity bits to each block of data. It is no different to the way you added the extra cards.


Suppose you want to send a message over a network consisting of the numbers: 6, 13, 2 and 12.

First of all, we convert the numbers into binary.

6 = 0 1 1 0
13 = 1 1 0 1
2 = 0 0 1 0
12 = 1 1 0 0

Even Row and Column Parity

Rather than send only those digits, we add the parity bits to all the rows and all the columns. With the extra bits added for even parity (an even amount of 1’s) , when the data arrives the receiving computer can see if one of the bits has an error (i.e. it’s 1 when it should be 0 or vice versa).

Computer Science Grid Pattern Row Parity
Computer Science Game - Grid Pattern Column Parity

Let us create an error

Let the error be the second bit in the second packet of data. We can see where the parity has been broken in row 2 and column 2 as they both now have an odd number of 1’s when everything else is even. It is just like finding which card has been flipped over!

Computer Science Memory Game - Row and grid intersection

Computers can then use the parity bit information to correct the single bit flip. That would just be like you turning the flipped card over again after working out which one it was.

So this effect isn’t really about your amazing skills of pattern recognition but about computers using mathematics to know about something they couldn’t see happen. Without this kind of parity trick, all the digital data transmitted around the world that is an integral part of our lives would be full of errors. That also includes the bits in digital radio and TV, DVDs, websites and emails. For more amazing routines like this, check out Computer Science FX.

Download the Full Photographic Memory Workshop including Learning Outcomes, Experiences and Extended Tasks

Showmanship for Photographic Memory

By first of all naming the colour of the flipped-over card you are subconsciously leading the audience to believe that you have secretly counted the amount of red and blue cards. That will be the assumption made by most people. By then pointing to the exact location of the card you are then creating a much stronger magical effect.

The easiest way to perform this memory card game is to use normal deck of playing cards. The cards can either be face-down or face-up (obviously the value of the face-up cards is not important!). You could even be creative and make your own. As one student suggested once… you could even use chocolate digestives!

After performing the effect using colour cards, I would suggest that you then perform the effect using paper with 1’s and 0’s as a natural lead-in to the computer science.

We had 35 students in the Arithmetrix show today… it was absolutely magic! The most amazing thing was the pupil who put his hand up and stepped forward to reveal the answer. This pupil does not engage with numbers or maths in anyway. It was amazing to see how engaged he was and the level of computational thinking that he demonstrated. Fantastic to see this!

Primary Teacher

Arithmetrix Alternative Presentation

When performing this routine for Arithmetrix (Be A Number Ninja!) I recommend using a whiteboard with magnets. Why? This improves visibility for everybody.

The magnets I use have a green symbol on one side and a temple symbol on the other. These symbols are from The Adventures of STEM Island and makes the routine colourful and a lot of fun.

Alternative Presentation using symbols instead of cards
arithmetrix dvd

Perform Arithmetrix (Be A Number Ninja!)

✓  User Guide
✓  DVD with Full Show Performance
✓  Over 1 Hour of Discussion
✓  Educational Support Material
✓  Number Ninja Notebook
✓  Marketing Tips
✓  Arithmetrix Logo & Flyer
✓  Performers Notes
✓  Bonus Material