# David Copperfield

David Copperfield and his assistant perform the following magic trick. The assistant offers to a person from the audience to pick 5 arbitrary cards from a regular deck and then hand them back to him. After the assistant sees the cards, he returns one of them to the audience member and gives the rest one by one to David Copperfield. After the magician receives the fourth card, he correctly guesses what card the audience member holds in his hand. How did they perform the trick?

**SOLUTION**

Out of the five cards there will be (at least) two of the same suit, assume they are clubs. Now imagine all clubs are arranged on a circle in a cyclic manner – A, 2, 3, … J, Q, K (clock-wise), and locate the two chosen ones on it. There are two arks on the circle which are connecting them and exactly one of them will contain X cards, with X between 0 and 5. Now the assistant will pass to David Copperfield first the clubs card which is located on the left end of this ark, will return to the audience member the clubs card which is located on the right end of it and with the remaining three cards will encode the number X. In order to do this, he will arrange the three extra cards in increasing order – first clubs A-K, then diamonds A-K, then hearts A-K and finally spades A-K. Let us call the smallest card under this ordering “1”, the middle one “2” and the largest one “3”. Now depending on the value of X, the assistant will pass the cards “1”, “2” and “3” in the following order:

X=0 -> 1, 2, 3

X=1 -> 1, 3, 2

X=2 -> 2, 1, 3

X=3 -> 2, 3, 1

X=4 -> 3, 1, 2

X=5 -> 3, 2, 1

In this way David Copperfield will know the suit of the audience member’s card and also with what number he should increase the card he received first in order to get value as well. Therefore he will be able to guess correctly.

We do not know where this puzzle originated from. If you have any information, please let us know via **email**.

DC and the assistant agree on total ordering of the cards beforehand.

Out of the 5 cards there is two of the same suit. Assistant always returns one of those two to DC. The other three encode a number from 1 to 6 (=3!) based on the total ordering, which extends to ordering of permutations.

DC counts up from the first card (in the same suit), possibly cycling back (e.g. J->Q->K->A->2->3 if the first card was J and the encoded number was 5).

🙂

This is totally correct Petar! Here is a harder version – what is the maximum number of cards which can be used (more than 52), so that the magic trick would still work?