Wikipedia has an article about the math and methods for shuffling playing cards.