I am trying to figure out the minimum number of shuffles needed to return a deck to its original state based on the number of blocks within each shuffle. The number of cards in each block must add up to the sum of the deck. The number of cards in the deck is a variable as well as the number of blocks and the sizes of each block.
An example would be if we had a deck of abcdef, and we perform an overhand shuffle with 3 blocks, the first block is 2, the second is 3 and the last is 1. Performing this shuffle gives a result of fcdeab, as we take the first 2 letters "ab" and put them at the bottom, take the next 3 "cde" and put that on top of the "ab" and then take the last block of 1 "f" and put that on top giving "fcdeab".
For a 1 block shuffle equal to the number of cards in the deck the number of minimum shuffles is 1, for a 2 block shuffle the answer is 2 and for a 3+ block shuffle the answers the vary depending on the sizes of each block. So based on that is there an algorithm I can use to calculate the minimum number of shuffles for any given amount of deck size, the number of blocks, and the size of each block within a shuffle to return a deck to its original state?
Please let me know if you want me to clarify any details, Thanks!
The procedure for finding the minimum number of shuffles for a fixed group of blocks is straightforward; the general answer might be out of reach. I'll illustrate this with a few examples that show how wide the range of possibilities is.
But first, the method to solve this problem. First, suppose that we are doing a blocks shuffle with blocks of size $\langle 2,4\rangle$, which permutes $(1,2,3,4,5,6)$ to $(3,4,5,6,1,2)$. It's common, and useful for this particular problem (finding the order of a permutation) to write it in its cycle decomposition. In this case, that's $$(1\;5\;3)\;(2\;6\;4)$$ meaning that $1$ takes the place of $5$, $5$ takes the place of $3$, and $3$ takes the place of $1$ (the first cycle) while $2$ takes the place of $6$, $6$ takes the place of $4$, and $4$ takes the place of $2$ (the second cycle).
If we apply the same permutation multiple times, then the elements in a cycle will just keep rotating around that cycle. In this case, that means that after $3$ shuffles, the $(1\;5\;3)$ cycle will return to its original position, as will the $(2\;4\;6)$ cycle, so we'll get back the original deck.
For a more complicated example, consider the $\langle 1,1,3\rangle$ shuffle, which transforms $(1,2,3,4,5)$ into $(3,4,5,2,1)$, and has cycle decomposition $$(1\;5\;3)\;(2\;4).$$ The elements of the $(1\;5\;3)$ cycle will return to their original position every $3$ shuffles, but the elements of the $(2\;4)$ cycle will return to their original position every $2$ shuffles. It takes $6 = \operatorname{lcm}(2,3)$ shuffles for both cycles to line up the way they were in the original deck.
Some examples of the possibilities: