You are Here: Home >< Maths

# Cards problem watch

1. Take n playing cards and order them red,black,red,black,...

(*):
Now transfer the top card to a new pile and put the next card to the back of the (n-1 size) pack. Next, transfer the top card to the smaller pile so it becomes the second card in that pile and put the next card to the back of the (n-2 size pack). Keep doing this until there is only one (size n) pile left.

The pile should look something like: R,R,R,...,B,B,B,...

Keep doing (*) until the pile is the same as how it started: R,B,R,B,...
There are two questions from here:

1) Whatever the size of n, will there always be a finite amount of (*)'s before the pile is the same as how it started?

2) How many times do you have to do (*) for the pile to go back to how it started?

I made a MATLAB script (ask if you want it) which computed the first 70 counts of (*) for n=1,2,.... The numbers did seem quite random but when there were huge jumps, the numbers always ended with a 0 which leads me to think there's some kind of pattern.

I tried answering both questions but didn't get very far. Can anyone else try? It may be not possible to answer either question but I thought it was quite interesting anyway.
2. I would say an important thing to consider is that from any arrangement of cards, you can run (*) in reverse to get another arrangement of cards. This means that there is only one arrangement that can have (*) run on it to get to any other given arrangement.

So if you start with one arrangement of cards, an keep running (*) then you can consider the following possibilities:
(i) You keep on going through an infinite number of arrangements - this can't be possible since there are only a finite number of arrangements of n cards
(ii) You eventually get into a cycle, repeating some arrangements indefinitely - suppose this did happen, and you went through arrangements a1, a2, ..., ak, b1, b2, ..., bj, b1, b2, ... then b1 would have both ak and bj leading to it, which we know is impossible.
(iii) After applying (*) a finite number of times, you eventually get back where you started - this is the only possible case.

Therefore, the answer to (a) is yes.

I'm not sure how to do part b. I suppose you could find an upper bound by calculating the number of arrangements of cards, but that wouldn't answer the question directly.
3. Without putting any thought in, try putting the sequence for n = 1,2,3, into the Sloane Sequence website (google sloane sequence).
4. (Original post by DFranklin)
Without putting any thought in, try putting the sequence for n = 1,2,3, into the Sloane Sequence website (google sloane sequence).
This page is the only result. I'm not really familiar with this website to find out more about the sequence (if there is anything more).
5. (Original post by 0-))
This page is the only result. I'm not really familiar with this website to find out more about the sequence (if there is anything more).
If it had any other significance, or if there was a formula for the values, it would usually be included in the entry. So odds are there's no known formula for it.

### Related university courses

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: January 22, 2010
Today on TSR

How do you think you'll do?

### University open days

Wed, 25 Jul '18
2. University of Buckingham
Wed, 25 Jul '18
3. Bournemouth University
Wed, 1 Aug '18
Poll
Useful resources

### Maths Forum posting guidelines

Not sure where to post? Read the updated guidelines here

### How to use LaTex

Writing equations the easy way

### Study habits of A* students

Top tips from students who have already aced their exams