How many cards for a Flush?

You shuffle a standard deck of cards, draw the top card, and place it on the table. You keep doing this until you can form a flush from the cards you have drawn.

What is the expected number of cards you will draw (rounded to the nearest integer)?

Note: A standard deck of cards has 52 cards in total, with 4 different suits. A flush is formed when there are 5 cards of the same suit.

8 10 12 14 17

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

5 solutions

Mark Hennings
Oct 30, 2018

Let E a , b , c , d E_{a,b,c,d} be the expected number of additional cards that have to be drawn to obtain a flush, given that a a Spades, b b Hearts, c c Diamonds and d d Clubs have already been drawn. Conditioning on the outcome of the next draw, we see that E a , b , c , d = 1 + ( 13 a ) E a + 1 , b , c , d + ( 13 b ) E a , b + 1 , c , d + ( 13 c ) E a , b , c + 1 , d + ( 13 d ) E a , b , c , d + 1 52 ( a + b + c + d ) 0 a , b , c , d 4 E_{a,b,c,d} \; = \; 1 + \frac{(13-a)E_{a+1,b,c,d} + (13-b)E_{a,b+1,c,d} + (13-c)E_{a,b,c+1,d} + (13-d)E_{a,b,c,d+1}}{52-(a+b+c+d)} \hspace{2cm} 0 \le a,b,c,d \le 4 and we also have that E a , b , c , d = 0 E_{a,b,c,d} = 0 when any one of a , b , c , d a,b,c,d is equal to 5 5 or more. It is a simple matter to plug this recursive relation into a computer programme, and obtain the expected number of draws to obtain a flush as E 0 , 0 , 0 , 0 = 12.3598016 E_{0,0,0,0} \; = \; 12.3598016 making the answer 12 \boxed{12} .


Trying a little harder, we note that, if we define F a , b , c , d = ( 52 a b c d 13 a 13 b 13 c 13 d ) E a , b , c , d F_{a,b,c,d} \; = \; \binom{52-a-b-c-d}{13-a\;\;13-b\;\;13-c\;\;13-d}E_{a,b,c,d} where ( p + q + r + s p q r s ) \binom{p+q+r+s}{p\;\;q\;\;r\;\;s} is the multinomial coefficient ( p + q + r + s p q r s ) = ( p + q + r + s ) ! p ! q ! r ! s ! \binom{p+q+r+s}{p\;\;q\;\;r\;\;s} \; = \; \frac{(p+q+r+s)!}{p!\,q!\,r!\,s!} then we have the recurrence relation F a , b , c , d = ( 52 a b c d 13 a 13 b 13 c 13 d ) + F a + 1 , b , c , d + F a , b + 1 , c , d + F a , b , c + 1 , d + F a , b , c , d + 1 F_{a,b,c,d} \; = \; \binom{52-a-b-c-d}{13-a\;\;13-b\;\;13-c\;\;13-d} + F_{a+1,b,c,d} + F_{a,b+1,c,d} + F_{a,b,c+1,d} + F_{a,b,c,d+1} for 0 a , b , c , d 4 0 \le a,b,c,d \le 4 , and hence F 0 , 0 , 0 , 0 = a , b , c , d = 0 4 ( 52 a b c d 13 a 13 b 13 c 13 d ) N a , b , c , d F_{0,0,0,0} \; =\; \sum_{a,b,c,d=0}^4 \binom{52-a-b-c-d}{13-a\;\;13-b\;\;13-c\;\;13-d}N_{a,b,c,d} where is N a , b , c , d N_{a,b,c,d} is the number of ways of getting from ( 0 , 0 , 0 , 0 ) (0,0,0,0) to ( a , b , c , d ) (a,b,c,d) by taking steps of size 1 1 in any one of the components at any one time. In other words, N a , b , c , d = ( a + b + c + d a b c d ) N_{a,b,c,d} \; = \; \binom{a+b+c+d}{a\;\;b\;\;c\;\;d} and hence F 0.0.0.0 = a , b , c , d = 0 4 ( 52 a b c d 13 a 13 b 13 c 13 d ) ( a + b + c + d a b c d ) = 663038316898820188679631600000 F_{0.0.0.0} \; = \; \sum_{a,b,c,d=0}^4 \binom{52-a-b-c-d}{13-a\;\;13-b\;\;13-c\;\;13-d}\binom{a+b+c+d}{a\;\;b\;\;c\;\;d} \; = \; 663038316898820188679631600000 To obtain E 0 , 0 , 0 , 0 E_{0,0,0,0} , we need to divide this by ( 52 13 13 13 13 ) = 53644737765488792839237440000 \binom{52}{13\;\;13\;\;13\;\;13} \; = \; 53644737765488792839237440000 obtaining E 0 , 0 , 0 , 0 = 1173956396185 94981815404 = 12.35980162 E_{0,0,0,0} \; = \; \frac{1173956396185}{94981815404} \; = \; 12.35980162


Yet another approach! For any 0 a , b , c , d 13 0 \le a,b,c,d \le 13 , the probability p a , b , c , d = ( a + b + c + d a b c d ) ( 52 a b c d 13 a 13 b 13 c 13 d ) ( 52 13 13 13 13 ) p_{a,b,c,d} \; = \; \frac{\binom{a+b+c+d}{a\;\;b\;\;c\;\;d} \, \binom{52-a-b-c-d}{13-a\;\;13-b\;\;13-c\;\;13-d}}{\binom{52}{13\;\;13\;\;13\;\;13}} is the probability that, when a pack is dealt, the first a + b + c + d a+b+c+d cards consist of a a Spades, b b Hearts, c c Diamonds and d d Clubs. If N N is the number of cards that have to be dealt to obtain a flush, then P [ N k + 1 ] P[N \ge k+1] is the probability that there is no flush in the first k k cards, and hence P [ N k + 1 ] = { 0 a , b , c , d 4 a + b + c + d = k p a , b , c , d 0 k 16 0 k 17 P[N \ge k+1] \; = \; \left\{ \begin{array}{lll} \sum_{{0 \le a,b,c,d \le 4} \atop {a+b+c+d=k}}p_{a,b,c,d} & \hspace{1cm} & 0 \le k \le 16 \\ 0 & & k \ge 17 \end{array}\right. and hence E [ N ] = k 0 P [ N k + 1 ] = k = 0 16 0 a , b , c , d 4 a + b + c + d = k p a , b , c , d = a , b , c , d = 0 4 p a , b , c , d = E 0 , 0 , 0 , 0 E[N] \; = \; \sum_{k \ge 0}P[N \ge k+1] \; = \; \sum_{k=0}^{16} \sum_{{0 \le a,b,c,d \le 4} \atop {a+b+c+d=k}}p_{a,b,c,d} \; = \; \sum_{a,b,c,d =0}^4 p_{a,b,c,d} \; = \; E_{0,0,0,0} retrieving the previous result.

I used your formulas to compute the probability distribution of the number of cards that have to be drawn to form a flush.

Yannick Ruffiner - 2 years, 7 months ago

Log in to reply

Why 17 is not the answer? Since Drawing 17 cards assures a flush

prince zarzees - 2 years, 7 months ago

Log in to reply

We are talking about probability here. You will certainly have drawn a flush after 17 17 cards, but you might have drawn a flush after just 5 5 cards. There are different probabilities for the number of cards it takes to drawn a flush (see the graph above), and the expected value of the associated random variable is slightly greater than 12 12 .

This is a calculation like asking what the expected value obtained after rolling a die. Each of the values 1 , 2 , 3 , 4 , 5 , 6 1,2,3,4,5,6 occurs with probability 1 6 \tfrac16 , and so the expected value is 1 6 ( 1 + 2 + 3 + 4 + 5 + 6 ) = 3.5 \tfrac16(1+2+3+4+5+6) = 3.5

Mark Hennings - 2 years, 7 months ago

Another simple approach... 5card flush from say 10 cards... Then no of flush combinations is C(10,5)=252. Probability each flush is (1/4)^5.=1/1024 (this is actually probability of 5 or more cards of same suite). Then Probability all flush combinations =252/1024.=24.6% Using same approach For 11 cards flush probability 45% For 12 cards flush probability 77%. ANSWER 12 cards.

Phil Greene - 2 years, 7 months ago

Log in to reply

The probability of any particular flush is not ( 1 4 ) 5 \left(\tfrac14\right)^5 - that would be the probability if the cards were replaced in the pack each time. We are interested in the probability of getting a flush when the cards are dealt without replacement.

You also seem to be assuming that the mean (expectation) of the distribution is the same as the mode of the distribution. This is not true, since (as the graph below shows) the mode is 13 13 .

Mark Hennings - 2 years, 7 months ago

This will not be an exact solution, but more of an educated guess. But maybe it is still valuable for people to get a feeling for probability. The minimum number of cards you need to draw for a flush is obviously 5. The maximum number is 17. Because if you haven't hit a flush with 16 cards, it means you have 4 cards of each color. Therefore the 17th card has to complete one flush. Now the average of 5 and 17 is 11. But since the distribution of probability in a situation like this (drawing something with a probability lower than 1/2 from a large set) is typically shifted towards the right, 12 is a good guess. Especially considering the possible choices.

I decided to ignore the deck part of the problem, and just assume an infinite “shoe”. I wrote a little program, using some of the symmetries in the probability tree, so I didn’t have to deal with a billion nodes or so.

The answer I came up with was 11.736762030050159.

Nicholas Palevsky - 2 years, 7 months ago

Log in to reply

I guess that "infinite shoe" is the same as "selection with replacement". That would make things a lot easier, and explain why your calculated answer was smaller than the true value.

Mark Hennings - 2 years, 7 months ago
Dede Dede
Nov 7, 2018

Here is some quick python code implementing Mark brilliant solution :

1
2
3
4
5
6
7
8
9
from functools import lru_cache

@lru_cache(maxsize=1296)
def F(a,b,c,d):
    if (a==5 or b==5 or c==5 or d==5):
        return 0
    return 1 + ((13-a)*F(a+1,b,c,d)+(13-b)*F(a,b+1,c,d)+(13-c)*F(a,b,c+1,d)+(13-d)*F(a,b,c,d+1))/(52-a-b-c-d)

print(F(0,0,0,0))

Zac Mann
Nov 10, 2018

I wrote a bit of code in processing to simulate drawing cards and ran it 100,000,000 times to get 12.359815. With this method the number of cards needed for a flush, the number of suits and the number of cards in a suit are each variables so it could be worked out for other variations. I know there's undoubtedly better and more elegant solutions in both code and concept but this worked for me. I should probably have a go at Python though.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* 
  The Code:
    -Sets all cards to not have been picked
    -Picks a random card that hasn't been picked
    -Checks if there's a flush and stops if there is
    -Repeats then averages all results
*/


//number of repeats
int countNumber = 10000;

//number of cards to make a flush
int flushNumber = 5;

//number of suits
int suitNumber = 4;

//number of cards in each suit
int valNumber = 13;


int cardNumber = suitNumber * valNumber;
boolean cards [][];


void setup()
{
  cards = new boolean[suitNumber][valNumber]; 
  int total = 0;

  for (int i =0; i<countNumber; i++)
  {
     total += countCards();
  }

  print(float(total)/float(countNumber));
}

int countCards()
{  
  int count = 0;

  refreshCards();

  while(count < cardNumber)
  {
    count ++;
    if(pickCard()) return count;
  }

  return -1;
}

boolean pickCard()
{
  while(true)
  {
    int suit = int(random(cards.length));
    int num = int(random(cards[0].length));
    if (cards[suit][num] == false) 
    {
      cards[suit][num] = true;
      return flushCheck();
    }
  }
}


boolean flushCheck()
{
  boolean verdict = false;

  for (int i = 0; i<cards.length; i++)
  {
    int val = 0;
    for(int j = 0; j<cards[0].length; j++)
    {
      if (cards[i][j]) val ++;
      if (val >= flushNumber) verdict = true;
    }
  }

  return verdict;  
}



void refreshCards()
{
  for (int i = 0; i<cards.length; i++)
    {
      for (int j = 0; j<cards[0].length; j++)
      {
        cards[i][j] = false;
      }
    }
}

Tolga Gürol
Nov 5, 2018

Not a solution

Let me define some questions as,

Q 5 Q_5 What is the probablity of forming exactly one flush on your 5th pick?

Q 6 Q_6 What is the probablity of forming exactly one flush on your 6th pick?

..

Q 17 Q_{17} What is the probablity of forming exactly one flush on your 17th pick? (since 17th pick guarantees the flush)

And the answers of these questions as A 5 , A 6 , . . . , A 17 A_5,A_6,...,A_{17} , respectively

So finally our answer will be 5 × A 5 + 6 × A 6 + . . . + 17 × A 17 12 5 \times A_5 + 6 \times A_6 + ... + 17 \times A_{17} \approx12

I found that

Answers Probabilities
A 5 A_5 0.00198
A 6 A_6 0.00986
A 7 A_7 0.02851
A 8 A_8 0.06251
A 9 A_9 0.11509
A 10 A_{10} ?
A 11 A_{11} ?

.. ..

But I could not find a formula for A 10 A_{10} to A 17 A_{17}

If we get a flush on the 5th pick we are done so your questions and answers need revising.

Your Q6 should really be: What is the probability of not forming a flush on the 5th pick, but forming one on your 6th.

The actual A6 is your A6-A5.

Jeremy Galvagni - 2 years, 7 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...