[Math] Chances of a shuffled deck being sorted only by color

card-gamesprobability

QUESTION (TL;DR)

Let's assume you are handed a deck of 52, standard cards which are already shuffled. You take the the deck and mindlessly shuffle it for a few minutes. After the shuffle, you turn over the deck to find that all of the cards are split into two piles– red on top, black on bottom (or black on top, red on bottom.) However, each color-pile is randomly sorted.

What are the chances of such an event occurring?

BONUS POINTS

Follow-up question, which doesn't have to be answered. How would the probability change if the deck was pre-color sorted?

In other words, if one started with two randomly sorted color piles and then shuffled the deck a random number of times, how would the probability change that the deck were to return to a state similar to how is started? Assume a traditional shuffle, splitting the deck into two piles and then fuzzy merging every 1 or 2 cards on each side, what would be the chances that the deck would resort itself into two color piles after an small but optimized number of shuffles?

WHY I ASK

This is important to me for my sanity. After playing a game with some friends in late-high school, I remember taking the deck of cards we were using (with no jokers) and mindlessly handling it. There is chance that at one point I sorted the deck by color or suits. I was mindlessly fiddling with the deck, so even though I never recall sorting it in any way, I know that if given a deck to hold, that is something I would very likely, mindlessly do.

After handling the deck for a while, I distinctly recall shuffling it at least a few times, turning it over and observing a color sorted deck. My heart pounded as I thumbed through the cards because I couldn't believe what I was seeing. It was… impossible.

To be fair, I've never felt that this was realistically possible. I'm too rational to accept that I started with a well shuffled deck. Before I shuffled the cards, I must have done something to the deck. For the scope of this exercise, what I did doesn't matter. I've resolved that I must have done something that my short term memory had forgotten before shuffling the deck 3-10 times which must have been a factor in the outcome.

Regardless of what really happened, this has been a math problem that has stuck in my head for over 16 years! What are the chances of this happening?

Best Answer

The answer is $$ \frac{26!\cdot 26!\cdot 2}{52!} $$ If we know that the red cards are all first, and the black cards are last, there are $26!$ ways for each of those piles to be shuffled. So there are $26! \cdot 26!$ ways of organizing a deck of cards with reds first, blacks last, and there are $52!$ total ways of organizing the deck. The last factor $2$ is there because blacks first, reds last is also a solution with the same probability.

If you want to specify that the reds and blacks are not to be ordered, you have to swap $26!$ with $(26! - n)$ where $n$ is the number of combinations you'd consider "sorted".