Home > Mathematica, Mathematics > Playing with a full deck: solution (explanation)

Playing with a full deck: solution (explanation)


The following solution to the puzzle may not be unique but I find it instructional. It is not mine (though it is my explanation).

As you probably have surmised, the assistant’s control of the chosen cards is the key. The choice of card to hide and the sequence of display of the revealed cards are important. The sequence of the revealed cards encodes the identity of the hidden card.

The approach involves:

  • the pigeonhole principle and other combinatoric considerations
  • modular arithmetic

I make the following observations:

  • there are 48 candidates for the missing card. 4 cards can, however, yield only 24 (4!) distinct permutations. So this is insufficient to code the identity of the hidden card
  • from the pigeonhole principle: given there are five cards and four suits, at least two cards are of the same suit. Therefore, choosing a card of the repeated suit as  hidden card and one of the remaining repeated suit as first in the sequence will indicate the magician the suit of the hidden card.
  • having chosen the suit the coding has now been reduced to 12  candidate cards of the repeated suit
  • Now the remaining issues are:
  1. which card to hide and which to reveal
  2. how to encode the identity of the hidden card in the sequence of revealed cards
  • three cards to be revealed have only six permutations: insufficient to code 12 candidates
  • modular arithmetic now enters: consider the cards as a sequence from 1 (ace) to 13 (king).  A distance between two cards can be defined, e.g.  3 is 2 cards ahead of ace, queen (12) is four cards ahead of 8,  ace is 2 cards ahead of the queen ( 1-12=-11\equiv 2 mod 13). To visualize this consider 1 to 13 in a circle.  Consider the mod 13 equivalence classes -6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6.  Zero is not relevant as the hidden and first card are distinct. Therefore, the remaining three cards can be used to code the difference between the hidden card and the first card.
  • how to chose the hidden and revealed card of repeated suit: the magician and assistant must agree on whether the three cards code the number of cards ahead or behind the  hidden card is relative to the first card. Without loss of generality let us assume the former. The pair {first, hidden} are chosen such that position[hidden]-position[first]  mod 13  is one of  1,2,…5,6. This is guaranteed by the preceding item. For example: {ace (1), king (13)} would result in hidden: ace and revealed: king. As the ace is 1 card ahead of the king.
  • how to encode the identity of the hidden card with the three remaining cards: the three cards can be ordered by agreeing on suit ranking and ordering cards of the same suit by their numerical value.  The three cards can then be lexicographically ordered. To illustrate this let 1 be the lowest rank card, 2 middle,  and 3 the highest rank. The distance between the first and hidden card is between 1 and 6 inclusive. Coding could be as follows: 1-123, 2-132, …, 5-312, 6-321.

The algorithm is illustrated in solution (illustration) post.

Categories: Mathematica, Mathematics
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: