We have a normal deck of 52 cards. We want to do the following magic trick:

A person from the audience chooses 5 random cards. The magician's assistant looks at the 5 cards, chooses 4 of them, hands them to the magician one by one face up and keeps the other one hidden. The magician then guesses the fifth card (the one that the assistant kept hidden) just by looking at the 4 cards he was handed in.

Is it possible to devise a strategy, so that no matter what the original 5 cards were, the trick always works?

(In reply to

re: How i would do it by Jon)

It is a lot of mental math.

There are 24 permutations. In order of smallest to largest: 1234, 1243, 1324, 1342, 1423, 1432, 2134, 2143, 2314, 2341, 2413, 2431, 3124, 3142, 3214, 3241, 3412, 3421, 4123, 4132, 4213, 4231, 4312, 4321.

Each of these are paired to 1 to 24. Example: 3412 is paired to 17. To communicate 17, the assistant would hand the magician the second highest then the highest then the smallest then the second smallest (3412).

Using a left hand would indicate add 24 and using the right would indicate add 0.

All together, this passes a number 1 to 48 to the magician. All the magician has to do is determine the nth card of the deck excluding the four cards he is holding.