Mathematical Recreations and Essays, by W. W. Rouse Ball. (Note that the PDF is nicely hyper-linked!)

Another common trick is to throw twenty cards on to a table in ten couples, and ask someone to select one couple. The cards are then taken up, and dealt out in a certain manner into four rows each containing five cards. If the rows which contain the given cards are indicated, the cards selected are known at once.