Thread Rating:

BruceZ
BruceZ
  • Threads: 2
  • Posts: 57
Joined: May 23, 2015
July 13th, 2015 at 7:43:12 PM permalink
A deck has 12 diamonds, 11 spades, 10 hearts, and 8 clubs. Each of 4 players is assigned a suit. The cards are turned up one by one, and the player whose suit is first to be turned up 5 times wins. What is the probability that each player wins? The answer to this and similar problems may surprise you.


Let the number of cards in each suit be denoted by n1, n2, n3, n4. Then



We are summing the probabilities that we draw 4 of the n1 cards of the first suit, and i,j,k of of the n2, n3, n4 cards of the other 3 suits respectively where these can each range from 0 to 4, followed by one of the n1-4 cards of the first suit. The denominators are the total ways to draw 4+i+j+k cards out of 41 total cards, and 37-i-j-k possible choices for the final card This is a negative multivariate hypergeometric distribution.

The results are:

P(diamonds wins) ≈ 0.39889980027131

P(spades wins) ≈ 0.299888688275984

P(hearts wins) ≈ 0.214386103738293

P(clubs wins) ≈ 0.0868254077144126

This agrees with simulated results. So a seemingly small starting advantage makes a big difference. As a simpler example, if there were only 2 suits with 6 of one and 5 of the other, the player with 6 would win over 72% of the time. This makes sense when you consider that he wins whenever card 10 or 11 is the opponent's card.

Below is an R function which allows you to enter arbitrary starting numbers for each suit, and optionally, the number needed to win which defaults to 5 if it is not given by the 5th function input. For the above problem, you would enter

> race(12,11,10,8)
[1] 0.39889980027131

for the probability that the 12 diamonds wins, and

> race(11,12,10,8)
[1] 0.299888688275984

for the probability that the 11 spades wins, etc. Just make the one you want to win the first input.

The upper limit of the sum uses a min function to permit cases where there some players can't win due to having too few cards. This allows races between fewer than 4 players by setting some of the inputs to 0.



### P(w of suit with n1 cards are drawn before w of suits with n2,n3,n4)

race = function(n1,n2,n3,n4,w=5) {
C = function(n,k) choose(n,k)
cards = n1 + n2 + n3 + n4
s = 0
for (i in 0:min(w-1,n2))
for (j in 0:min(w-1,n3))
for (k in 0:min(w-1,n4))
s = s + C(n1,w-1)*C(n2,i)*C(n3,j)*C(n4,k)/C(cards,i+j+k+w-1)*(n1-w+1)/(cards-w+1-i-j-k)
s
}


mustangsally
mustangsally
  • Threads: 25
  • Posts: 2463
Joined: Mar 29, 2011
July 16th, 2015 at 8:10:05 AM permalink
thank you Bruce

I knew it was a simple route to take

instead of Draw 5 game
it could be
1st Draw to 5 game

or even
1st Draw to 7 game

la la
la tea da

what i find more fun with a deck of cards
is to play a race game with patterns (using the 2 colors)

RBR for example (it could be RBRB also)
vs. the opposite, BRB
(RRR and BBB works well too)
players bet on the pattern they think will show first

shuffle up and deal!

you did a program for this some time back
I Heart Vi Hart
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
July 16th, 2015 at 8:39:34 AM permalink
To add a historical note, it was a problem like this that actually launched probability theory back in the 1600s. I don't think the original "problem of points" was selection-without-replacement like drawing cards without reshuffling is, but the fundamental question is the same: if you're playing a 2-player game to 10 points for a pot of $2 (you each put in $1), where each point is determined by a coin flip, and the score is 8 to 9, how do you divide the stakes if you have to stop early? The "fair" way to answer the question is "divide the pot according to the chances of winning."

In the 1600s, nobody knew how to figure "the chances of winning" until Pascal and Fermat invented probability theory and the concept of expectation:
https://en.wikipedia.org/wiki/Problem_of_points
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
PeeMcGee
PeeMcGee
  • Threads: 1
  • Posts: 115
Joined: Jul 23, 2014
July 19th, 2015 at 4:19:58 PM permalink
Yea, this is similar to the solution I provided in an recent thread (the One Die Horse Game by seven).

This has become one of my favorite types of problem.
  • Jump to: