Saturday 23 March 2024

The James Grimes card trick

 I recently came across a Numberphile video posted by James Grimes which I found quite diverting. James described a numerical conjuring trick for which it was not entirely obvious why it worked. His trick (minus all the conjuring patter) goes as follows:

  • The performer presents 10 playing cards with face values 1, 2, ..., 10 to the spectator and invites them to divide the cards into two arbitrary subsets A and B of 5 cards each.
  • He then gets them to arrange A into an increasing sequence; and then to arrange B into a decreasing sequence. The second sequence is placed below the first.
  • Then he gets them to write down the 5 differences of corresponding terms in the two sequences (here "difference" means absolute value of the difference).
  • Finally he gets them to add these 5 numbers together.

Surprise, surprise: the answer is always 25.

James eventually gave the reason for this surprise. Writing the increasing and decreasing sequences as a1 a2 a3 a4 a5, and b1 b2 b3 b4 b5 it turns out that, for every pair ai bi, (whose difference is to be calculated) one of ai and bi is in the range 1 to 5, and the other is in the range 6 to 10.

To see this write L (low) for any of the values from 1 to 5 and H (high) for any of the values from 6 to 10. Suppose the first sequence has r low numbers and s=5-r high numbers so that it looks like LrHs. Then the second sequence has 5-r=s low numbers and 5-s=r high numbers so that it looks like HrLs. So each pair of positions must have an L and an H.

From this it follows that each difference has the form H-L and so their sum is the sum of the H's minus the sum of the L's. This comes to 25.

I have laboured this little argument for two reasons. The first is that I found it hard to find it myself and was embarrassed by its simplicity. The second is that, from it, one can see a much more general result.

Plainly the same type of argument will apply if one starts with the first 2n integers rather than 10. In this case it turns out that the sum of differences is nwhich is rather neat. Also it applies if one starts with any collection of 2n numbers (and I said "collection" rather than "set" because repeats would be allowed). In that case the sum of differences is always the sum of the H's minus the sum of the L's whatever that turns out to be.

Both these observations were made by James himself. But even more is true. All that matters is that the two sequences are of the form LrHs and HrLs. This is a much weaker condition than that the first sequence is increasing and the second is decreasing. Even a weaker a condition can be required: so long as matching pairs comprise both an L and an H this will be enough.

In his video James asked for variations on his original trick. Here is one that exploits the more general case.

The performer presents a set of cards face down to one spectator and a second set to another spectator. Each spectator draws a card from his set and the two cards are given to the performer who places them also face down to form the first cards of a pair of rows. This is repeated until all the cards have been drawn and placed in the rows thereby producing two rows of cards. The cards are then turned over and the corresponding differences are calculated and summed. The performer predicts the sum.

Before performing the trick the performer has arranged that one set of cards contains low (L) cards and the other high (H) cards. The spectators will not notice this because the performer places each pair of cards randomly in either the first row or the second row; therefore when the cards are turned over all evidence of lowness and highness will have disappeared.