rec.puzzles Archive

Shuffle a deck of cards, then deal one card at a time, counting off "Ace, deuce, ...

probability/card/counting.match New

New entry, edited from material collected for the archive and not yet in a released version.

Problem

Shuffle a deck of cards, then deal one card at a time, counting off
"Ace, deuce, ... King, Ace, deuce, ..." etc.  If you deal a card
matching the card you just said, you lose.  If you deal out all the
cards (without losing, of course) you win.  What is the probability of
winning?

-- James Layland <jlayland@kilroy.Jpl.Nasa.Gov>, December 1993
Show solution
No solution was found in the collected postings.

[ Editor: the collected reply corrects a proposed answer but gives no
exact value for the 52-card deck.  For a single suit (all cards
different) see probability/derangement. ]

In article <CHpJ7E.HG0@news.chalmers.se> lubin@fy.chalmers.se replies:

>For a single suit, that is if each card is uniquely labelled, the
>probability of losing on a given card is 1/n. The probability of not
>losing on all of them is:
>
>(1-(1/n))^n which approaches exp(-1)=0.3688 for large n.

[ Editor: exp(-1) = 0.3679. ]

Try a few small cases:

If n = 2, the probability of no match is 1/2 (overall).
(1 - (1/n))^n = (1/2)^2 = 1/4, incorrect.

If n = 3, there are six possible permutations, of which only two have
no match (by inspection).  The probability of no match then is 1/3
overall.  (1 - (1/n))^n = (2/3)^3 = 8/27, incorrect.

The actual probability of not matching exactly on any of n cards is

  p_n = 1 - 1/1! + 1/2! - 1/3! + - ... +/- 1/n!

which is a truncated Taylor series expansion of f(x) = e^x centered at
0 and evaluated at x = -1.

For n = 2, p_n = 1 - 1 + 1/2 = 1/2, correct.
For n = 3, p_n = 1 - 1 + 1/2 - 1/6 = 1/3, correct.

In other words you have the wrong p_n, though it has the right limit.

>(1-(s/n))^n
>
>is exact for a pack of n cards divided into s suits.

Test cases:

For s = 1, we already found this formula incorrect.

For s = 2, n = 4, there are 24 ways to deal 4 cards.  By inspection
only 4 of these have no matches, so the probability is 1/6.
(1 - (s/n))^n = (1/2)^4 = 1/16, incorrect.

For s = 4, n = 8, there are 8! = 40320 ways to deal the cards, and only
(4!)^2 = 576 have no matches.  The probability is 1/70.
(1 - (s/n))^n = (1/2)^8 = 1/256, incorrect.

The limiting case e(-s) may be correct, I don't know.  But I don't
think (1 - 1/13)^52 is the exact answer to the original question.

-- David A. Karr <karr@cs.cornell.edu>

[ Editor: the rest of Dror Lubin's reply, part of which is quoted in
the entry above. ]

Now if you have s suits, the probability of losing on a SPECIFIC card
is s/n.  The probability of not losing on all of them is:

(1-(s/n))^n which approaches exp(-s) for large n.

Substitute s=4, n=52 we find the exact probability:

(1-(1/13))^52 = 0.01557, like you have computed empirically.  This is
slightly smaller than exp(-4)=0.01832 which is the limiting value for 4
suits, many cards in each.  In any case, the formula:

(1-(s/n))^n

is exact for a pack of n cards divided into s suits.

-- Dror Lubin <lubin@fy.chalmers.se>, December 1993

[ Editor: the formula is not exact; see David Karr's test cases in the
entry above, e.g. s = 2, n = 4 gives 1/6, not (1/2)^4 = 1/16. ]