Perfect Riffle Shuffling
In a perfect riffle shuffle, the deck is split in half and cards are alternately interleaved from each half to form a new ordering. An out-shuffle is one in which the bottom half of the deck is used to start the interleaving, so that the bottom card always remains on the bottom. With an in-shuffle, the top half is used to start the ordering. For each type of shuffle, can you find how many shuffles are necessary to return the deck to its original ordering?