Possibly the greatest mathematical
card trick ever!

Sixteen playing cards are dealt face up
forming a 4x4 array, like this:

I now write a note in which I identify the card, including
the suit, which will appear at the
end of the trick. This note is folded up and put aside for the moment.

Choose any four of the above cards, no two of which
are in the same row and no two of which are in the same column.
Using the values ace = 1, jack = 11, queen = 12 and king = 13, add up
the values of your four chosen cards and call the sum S.
Ask yourself: On an ordinary clock, what time would it be S
hours after midnight?

This is a number from 1 to 12. Possibly, this number is
among the 16 cards originally dealt, above. If it is, imagine pulling
it out of the array - it is your Magic Card, the one I wrote
on the note at the beginning of this paragraph. It is the 7 of hearts
(there is only one 7 in the above array, actually the 7 of hearts). If
this prediction is incorrect, please scroll down to the Appendix,
below, which also explains how, in practice, the chooser can be forced
to select 4 cards, no two of which are in the same row or column.

Now, for instructions on how to design your own array to
stack in advance at the top of the deck, see below. You'll be changing
the entries in the list TopRow and the values of A,
B and C.

You have seven degrees of freedom: the four cards to choose as the TopRow
of your array and three arbitrary (positive or negative) integers A,
B and C. It should be emphasized that A, B
and C are not necessarily card values, but the entries in TopRow
are. Highlight the values of any of these, above, and change them. Please
use lower-case letters for face cards. The prediction
of the Magic Card, above, will always be correct, unless you
get a message that your array is not "good", in which case the
trick cannot be performed with those sixteen cards. The primary objective
is to create a "good" array that looks suitably "random".
The other - equally important - objective is to figure out how the arrays
are generated from TopRow and A, B
and C.

Appendix. If the
prediction is incorrect, then one of three things
happened: (i) two cards were
chosen in the same row or in the same column; (ii)
the four cards were added incorrectly; or (iii)
S is correct, but the clock
time S hours after midnight was
computed incorrectly.

In practice, choosing the four cards could be
accomplished by first turning over a single card in
place, and then removing the other cards in the same row
and column as the chosen card, putting
them aside. From the remaining array a second card would
be turned over, and the other cards in
the same row and column as this second chosen card would
be removed to one side. The process
would be repeated two more times. In the end there are 4
face down cards, no two of which are in
the same row or in the same column.