All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
All Four Suits (Posted on 2006-06-06) Difficulty: 3 of 5
If you keep drawing cards from a shuffled deck, what is the expected number of draws to complete at least one card from each suit?

The expected value is the average number of draws that it would take if you repeated the experiment many times.

  Submitted by Charlie    
Rating: 4.2500 (4 votes)
Solution: (Hide)
The expected value is the sum of the probability of the process extending each given number of cards multiplied by that number.

The probability that all four suits will be present at any given number of cards drawn is equal to 1 minus the probability that exactly 1 suit is present minus the probability that exactly 2 suits are present minus the probability that exactly 3 suits are present.

The probability that c cards drawn will consist solely of cards from a particular set of n suits will be (n*13/52) * ((n*13-1)/51)* ... * ((n*13-c+1)/(53-c)). But this includes the possibility that fewer than n suits (some subset of the n suits looked for) are actually represented. So in the case of 2 suits, twice the probability of one particular suit must be subtracted out. In the case of 3 suits, 3 times the probability of one particular suit and 3 times the probability of two particular suits must be subtracted out.

The overall probability of exactly 1 suit being represented is 4 times the probability of a particular suit. That of 2 suits being represented is C(4,2)=6 times the probability of a particular pair of suits. That of 3 suits being represented is 3 times the probability of a particular set of 3. The probability that all four suits are represented is 1 minus all the other probabilities (one, wo or three represented).

The following program evaluates these, as well as the final expected value of the number of cards drawn to get all suits:

DEFDBL A-Z
CLS
FOR c = 4 TO 40
IF c <= 13 THEN
p1 = 1
FOR ct = 1 TO c
p1 = p1 * (14 - ct) / (53 - ct)
NEXT
ELSE
p1 = 0
END IF
IF c <= 26 THEN
p2 = 1
FOR ct = 1 TO c
p2 = p2 * (27 - ct) / (53 - ct)
NEXT
p2 = p2 - 2 * p1
ELSE
p2 = 0
END IF
IF c <= 39 THEN
p3 = 1
FOR ct = 1 TO c
p3 = p3 * (40 - ct) / (53 - ct)
NEXT
p3 = p3 - 3 * p1 - 3 * p2
ELSE
p3 = 0
END IF
p4Prev = p4
p4 = 1 - p1 * 4 - p2 * 6 - p3 * 4
p4diff = p4 - p4Prev
PRINT USING "## #.###### #.###### #.###### #.######"; c; p1 * 4; p2 * 6; p3 * 4; p4
total = total + c * p4diff
NEXT
PRINT total
It results in the following table of probabilities that exactly n suits are present within the first c cards:
 c  n = 1     n = 2    n = 3    n = 4
 4 0.010564 0.299640 0.584298 0.105498
 5 0.001981 0.145918 0.588355 0.263745
 6 0.000337 0.066841 0.506340 0.426482
 7 0.000051 0.029347 0.401023 0.569578
 8 0.000007 0.012436 0.302128 0.685429
 9 0.000001 0.005093 0.220211 0.774694
10 0.000000 0.002014 0.156716 0.841270
11 0.000000 0.000767 0.109455 0.889777
12 0.000000 0.000281 0.075237 0.924483
13 0.000000 0.000098 0.050967 0.948934
14 0.000000 0.000033 0.034044 0.965924
15 0.000000 0.000010 0.022420 0.977570
16 0.000000 0.000003 0.014550 0.985447
17 0.000000 0.000001 0.009298 0.990701
18 0.000000 0.000000 0.005845 0.994155
19 0.000000 0.000000 0.003610 0.996390
20 0.000000 0.000000 0.002188 0.997812
21 0.000000 0.000000 0.001299 0.998701
22 0.000000 0.000000 0.000754 0.999246
23 0.000000 0.000000 0.000427 0.999573
24 0.000000 0.000000 0.000236 0.999764
25 0.000000 0.000000 0.000126 0.999874
26 0.000000 0.000000 0.000066 0.999934
27 0.000000 0.000000 0.000033 0.999967
28 0.000000 0.000000 0.000016 0.999984
29 0.000000 0.000000 0.000007 0.999993
30 0.000000 0.000000 0.000003 0.999997
31 0.000000 0.000000 0.000001 0.999999
32 0.000000 0.000000 0.000000 1.000000
33 0.000000 0.000000 0.000000 1.000000
34 0.000000 0.000000 0.000000 1.000000
35 0.000000 0.000000 0.000000 1.000000
36 0.000000 0.000000 0.000000 1.000000
37 0.000000 0.000000 0.000000 1.000000
38 0.000000 0.000000 0.000000 1.000000
39 0.000000 0.000000 0.000000 1.000000
40 0.000000 0.000000 0.000000 1.000000

The probability of taking exactly c draws to achieve all four suits is the difference between two successive values in the last column. When multiplied by the c values the total is the expectation, which is calculated by the program as 7.665079365079367.

Comments: ( You must be logged in to post comments.)
  Subject Author Date
answerK Sengupta2008-02-06 05:48:25
Some ThoughtsToo hard by handOld Original Oskar!2006-06-12 21:30:56
A different approachBob Smith2006-06-07 10:57:48
re: End...Bob Smith2006-06-07 08:36:20
End...Eric2006-06-06 23:20:06
Middle...Eric2006-06-06 21:46:17
soooo....matthew2006-06-06 14:56:01
Beginning..Eric2006-06-06 12:08:06
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information