# Combinatorial card game [duplicate]

This question already has an answer here:

There is a card game I've played before, where it goes as follows:

You take a standard deck of cards, and shuffle them randomly. You then proceed by flipping each card and placing them down, simultaneously you count of ace, two, three, .. , queen, king, ace(2), two(2), three(3),...., king(4). That is you go through all 52 cards.

You lose the game only if the card that you read off is the same card as you were counting to. (i.e. the sequence two, ace, seven, four would lose at four.) Whereas, seven, four, two, king, queen, two, ace, eight would lose at the eight).

My question is how many possibilities are there to win this game? Also, how many possibilities are there to lose this game?

## marked as duplicate by MJD, Micah, Michael Lugo, André Nicolas combinatorics StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Nov 15 '14 at 1:27

• Observation: In the single-suit case, you're just asking "what is the probability that a random permutation has no fixed-points?". This is a problem that's been studied before. Not so sure about the multiple-suit case. – Gregory J. Puleo Nov 14 '14 at 20:47
• I've seen this problem before. The single-suit case is interesting, in that the probability of a win approaches something like $1/e$ for large numbers of ranks. – Mark Fischler Nov 14 '14 at 21:07

For the game where you say "Ace of spades, 2 of spades ... K of spades, A of hearts, ... up to K of clubs, and lose if you get an exact match, the number of ways to get zero matchthes out of $k$ cards is $$\left\lfloor \frac{k!}{e} + \frac{1}{2} \right\rfloor$$ and since there are $k!$ possible deals, for $k = 52$ the probability of winning is exceedingly close to $\frac{1}{e}$.

I will try for the case with $s$ suits next; I've tried it before and it is not easy.

• Also denoted as $\lfloor \frac{k!}{e} \rceil$ meaning "round to nearest integer" – DavidButlerUofA Nov 14 '14 at 22:36

The number of shuffles that result in a win is

$$R_{13}=1309302175551177162931045000259922525308763433362019257020678406144$$

so the probability of winning is

\begin{align} {R_{13}\over52!}&={4610507544750288132457667562311567997623087869\over284025438982318025793544200005777916187500000000}\\ \\ &= 0.01623272746719463674 . . . . \end{align}

This is from the paper Frustration solitaire by Doyle, Grinstead, and Snell.

Building on Mark Fischler's answer: The $k=2$ case, at least, is easy enough with $s$ suits. In that case, we can just call the cards "even" if their face value is $2$ and "odd" if their face value is $1$. If we're going to win, every "even card" needs to end up in an odd location of the shuffle, and vice versa.

Consider the locations of the deck that end up occupied by the even cards. We win if and only if these locations are exactly the odd locations. There are ${2s \choose s}$ ways to pick $s$ locations for the even cards out of the $2s$ possible locations, and all of these ways are equiprobable, so we win with probability ${2s \choose s}^{-1}$. Note that by Stirling's Formula, ${2s \choose s} \sim \frac{4^s}{\sqrt{\pi s}}$.

• the $k=1$ case is also pretty easy – Gregory J. Puleo Nov 14 '14 at 23:37