# number of arrangements

In a standard deck, there are 13 cards in each suit,such as hearts. For simplicity we'll number them from 1 to 13. This question is about these 13 cards.

Start with the cards in the usual order. This time you are allowed to divide the deck into three piles, consisting of the top n cards, the next m cards, and the remaining 13-n-m cards. Keeping the order within these piles unchanged, you place one pile at the top, one in the middle, and one on the bottom. You may repeat this as many times as you like, changing m and n if you wish. How many arrangements can you get?

So we can number them from 1 to 13 in the usual order: 1 2 3 4 5 6 7 8 9 10 11 12 13

So as one case I can have firs pile=4 cards, second pile=4 cards and last pile=5 cards. If I do the described permutation, I get:

1 5 9 2 6 10 3 7 11 4 8 12 13

Is this correct? If this is correct, then this question is asking me to consider different values of m and n and consider different arrangements based on these values?

-
Does "this time" in your question indicate that you had to do something similar "last time"? –  Fabian Mar 8 '11 at 9:40
@Fabian: I am not sure what you mean. –  Vafa Khalighi Mar 8 '11 at 9:45
By the way: why you get 1 5 9 2 6 10 3 7 11 4 8 12 13? Maybe I misunderstand the question, but when I take $n=m=4$ and I put the last pile on to, the second pile in the middle, and the first pile at the bottom, I get 9 10 11 12 13 5 6 7 8 1 2 3 4. –  Fabian Mar 8 '11 at 9:49
I thought that if I take n=m=4, I have first pile=4 cards, second pile=4 cards and last pile=5 cards. So I place first card from first pile at the top, then first card from second pile below that, then first card from third pile below that, and so on. But now I am not sure that I understand the question. –  Vafa Khalighi Mar 8 '11 at 9:54
I read the question that you have to shuffle the whole piles but not the individual elements. –  Fabian Mar 8 '11 at 9:56

Try to think of a generating set of $S_{13}$ that you can implement using this operation.

-
I do not understand this. $S_{13}$ has 13! elements. and how can I implement 13! elements using this operation? –  Vafa Khalighi Mar 8 '11 at 9:48
Think of a permutation which you cannot make... –  Fabian Mar 8 '11 at 9:51
Remember, you can perform the operation an arbitrary number of time with arbitrary $n$ and $m$. –  Fabian Mar 8 '11 at 9:51

To put the card in position $n$ at the top without changing the order of the other cards, split the deck into $(n-1)$, $1$ and $13-n$ piles and restack as $1$, $(n-1)$ and $(13-n)$. You don't need to do this if $n=1$, while if $n=13$ then split into something like $10$, $2$ and $1$ and restack as $1$, $10$ and $2$.

Do this up to 13 times and you can have any order.

-
Better than my solution! –  Yuval Filmus Mar 8 '11 at 11:12
Thanks but I tried very hard but could not understand. Can you please explain what the question is asking with a simple example. I just do not know what is the eaxt effect of this permutation in the question. Sorry for my dumb question. –  Vafa Khalighi Mar 8 '11 at 12:44
@Vafa Khalighi: It means that in 13 moves or fewer you can get any order. You should be able to calculate how many possible orders there are. –  Henry Mar 8 '11 at 13:01
@Henry: many thanks. I just have two more questions: (1) why I do not need to do that when $n=1$ and when $n=13$, why do I split it into something like 10,2 and 1. I thought that it is supposed to be 12,0, and 1. (2) I know that when I have 13 cards I can get 13! arrangements now how many of these 13! arrangements can I get with the original question (Start with the cards in the usual order. This time you are allowed to divide the deck into three piles, consisting of the top n cards, the next m cards, and the remaining 13-n-m cards. Keeping the order within these piles unchanged, you ...)? –  Vafa Khalighi Mar 9 '11 at 6:18
@Vafa Khalighi: (1) For $n=1$ you do not need to do anything to leave cards in the same order. For $n=13$ you are correct if one of the piles is allowed to have 0 cards; I offered an alternative if not. (2) I am not sure what you are asking, but I would have read your example as leading to something like 5 6 7 8 1 2 3 4 9 10 11 12 13 or 9 10 11 12 13 5 6 7 8 1 2 3 4 –  Henry Mar 9 '11 at 7:50

Every permutation of a finite set can be expressed as the product of transpositions.

Obviously, under the system I have described, I can transpose the top two cards. but I do not know how to devise a method of moving any two cards to the top without disturbing the other cards?

It is unclear whether m or n are allowed to be zero. Can my method deal with the situation if they are not?

-