Programming Pearls: A Sample of Brilliance
How can a computer deal a poker hand? It we assign each card in the deck its own integer between 1 and 52, then we can make a hand from a "random sample" of 5 integers in the range 1..52, for instance, 4 8 31 46 47 (It is important that no number appear twice; holding more than one ace of spades can jeopardize a cardplayer's health.) Random samples also arise in applications such as simulation, program testing, and statistics.