Back


Programmer's way of remembering playing cards


Unless you use more abstract methods of remembering playing cards, it can be difficult to know which cards have been dealt from a pack when playing a game of cards. This method reduces the whole pack to just 13 numbers or letters. Instead of having to remember sentences such as "King of Spades, King of Clubs" you just remember a number or letter. Supposing you only want to remember Kings, Queens and Jacks then you would only have to remember 3 numbers or letters.

The downside to this method is that it requires a good understanding of hexadecimal and binary and the ability to convert from one to the other quickly. The more you practise this the easier it becomes to convert the numbers, and the easier it is to visualise the binary strings in your head.

The whole idea is based around a table of all the playing cards in a pack. To start with you need to order the suits in a way you will always remember. I use Spades, Clubs, Hearts, Diamonds. The table looks like this:

Spades Clubs Hearts Diamonds
King King King King
Queen Queen Queen Queen
Jack Jack Jack Jack
10 10 10 10
9 9 9 9
8 8 8 8
7 7 7 7
6 6 6 6
5 5 5 5
4 4 4 4
3 3 3 3
2 2 2 2
Ace Ace Ace Ace



As cards are dealt you fill in the table with a 1 for a card that has been dealt, and you leave a 0 for a card that has yet to be dealt. Therefore in the row for the Kings you may have the following:

Spades Clubs Hearts Diamonds
0101


This can then be written as 0101 in binary. Or to make it clear it is a binary number, 0101b. As everyone knows, this is the same as 5 in hex, or 0x05 or 5h depending on whether you are a C programmer or an assembly programmer. In this explanation I'll end binary numbers in a 'b' (for binary) and end hex numbers in an 'h' (for hex). (Not that I'll do it here, but for decimal numbers I would end the number in 'd'). This is the standard assembly language notation, which seems to make more sense for this explanation.

Here is a chart for converting from hex to binary for 4 bit numbers: (It is never necessary to convert to decimal numbers, and would just confuse things).

Hex Binary
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
a 1010
b 1011
c 1100
d 1101
e 1110
f 1111


Therefore if you had had the King of Clubs and the King of Diamonds you would have the number 0101b which is also 5h. Therefore you just remember the number 5.

As more Kings are dealt you fill in the zeroes in the binary number with ones. At any point you can tell from the binary number which Kings have been dealt and which are still in the pack. Technically when a new King is dealt you are "Or"ing the number with either 8, 4, 2 or 1.

To start with you will need to keep converting the easily remembered hex number to binary in order to fill in another bit, and then convert it back in order to remember it. With more practice you will be able to visualise it all in your head. It can be hard to do this fast at first, but it gets a lot easier.

- If you get a new Diamond you know that you only have to add 1 on.
- If your hex number is 0fh then you have all that type of card.
- It becomes easier to convert from hex to binary if you think of the patterns - 0ch is 1100b whilst 3h is 0011b.
- If you have 7h then you know you are waiting for the Spade.
- If you have 0eh then you know you are waiting for the Diamond.


The easiest way to develop this method is to start by remembering just Kings, Queens and Jacks, in which case you would be remembering just three numbers/letters. That way you can concentrate on the maths rather than remembering sequences of numbers/letters. When you can do that you can concentrate on remembering long sequences of numbers/letters.



Simple Example:

Here we will just concentrate on Kings and Queens meaning we only have to remember two letters or numbers.

All the Kings and Queens shuffled:
playing cards picture
No Kings of Spades, Clubs, Hearts or Diamonds
No Queens of Spaces, Clubs, Hearts or Diamonds

Our grid looks like this:
  Spades Clubs Hearts Diamonds
Kings 0 0 0 0
Queens 0 0 0 0

The King number is 0000 in binary which is 0 in hex, as is the Queen number, so we just remember the King number followed by the Queen number = 00.



playing cards picture
The King of Diamonds appears so we have to fill in its entry in our grid.
  Spades Clubs Hearts Diamonds
Kings 0 0 0 1
Queens 0 0 0 0

The King number is now 0001 in binary which is 1 in hex.
The Queen number is still 0000 which is 0 in hex.
Therefore we just remember the King number followed by the Queen number = 10.



playing cards picture
The King of Clubs now appears so we have to fill in its entry in the grid.
  Spades Clubs Hearts Diamonds
Kings 0 1 0 1
Queens 0 0 0 0

The King number is now 0101 in binary which is 5 in hex.
The Queen number is still 0000 which is 0 in hex.
Therefore we just remember the King number followed by the Queen number = 50.



playing cards picture
Now the King of Spades.
  Spades Clubs Hearts Diamonds
Kings 1 1 0 1
Queens 0 0 0 0

The King number is now 1101 in binary which is 'd' in hex.
The Queen number is still 0000 which is 0 in hex.
The number we have to remember is 'd0'.



playing cards picture
Now the Queen of Clubs.
  Spades Clubs Hearts Diamonds
Kings 1 1 0 1
Queens 0 1 0 0

The King number is still 1101 in binary or 'd' in hex.
The Queen number is now 0100 which is 4 in hex.
The number we have to remember is 'd4'.



playing cards picture
Now the Queen of Diamonds.
  Spades Clubs Hearts Diamonds
Kings 1 1 0 1
Queens 0 1 0 1

The King number is still 1101 in binary or 'd' in hex.
The Queen number is now 0101 which is 5 in hex.
The number we have to remember is 'd5'.



playing cards picture
Now the King of Hearts.
  Spades Clubs Hearts Diamonds
Kings 1 1 1 1
Queens 0 1 0 1

The King number is now 1111 in binary meaning we have all the Kings. This is 'f' in hex.
The Queen number is still 0101 or 5 in hex.
The number we have to remember now is 'f5'.



Now we can make the best use of this method of remembering cards - we know what cards have been dealt and we can work out what cards are left in the pack, by just seeing where the 0's are in the table. We have all the Kings as we can tell by the 'King number' being 'f' or 1111. The 'Queen number' is 5 which is 0101 in binary meaning we have still to expect the Spade and the Heart.

Turning over the last two cards we see we were right:
playing cards picture



If you have an entire pack of cards and remember all the Kings, Queens and Jacks as you go through it then you can almost impress people by saying which of these are left in the pack at any one point. The more rows you can add to the table in your head the more impressive it is. People generally assume you are performing a trick, but would be more impressed if they knew what you were really doing.

I don't know enough about card games to know how useful it is to remember an entire pack, or a large proportion of it, but there you go.






Back

Contact