mustangsally
mustangsally
  • Threads: 25
  • Posts: 2463
Joined: Mar 29, 2011
December 27th, 2017 at 11:54:08 AM permalink
standard deck of cards.
13 ranks, 4 of each rank (suits) so 52 total cards.

probability of drawing 27 cards (without replacement)
and getting at least 1 card of each rank

this in Wolfram Alpha
C(52,27)^-1 * sum ((-1)^k * C(13,k) * C(4*(13-k),27)) , k=0 to 12
returns
24307203072/48849343277≈0.497595
(this is inclusion-exclusion for those that want to know. I know. my head is spinning too)
for those that want to see
Wolfram Alpha

result is very close to a coin flip (it was what I was after, after all)

Question:
How to calculate the probability of drawing 27 cards (without replacement)
and getting at least 1 card of each rank

but this time with only 10 ranks
9 ranks- 4 of each rank
1 rank- 16 of that rank
so my formula needs adjusting...

in other words
a standard deck of cards using almost Blackjack ranks A-9 (A only = 1)
and 16-10 value cards for 10,J,Q and K
(simulation is actually very easy in Excel or R and I get 0.626)

I love dice
but helping out with cards this time of year
Happy New Year coming!
Sally
I Heart Vi Hart
Wizard
Administrator
Wizard
  • Threads: 1520
  • Posts: 27123
Joined: Oct 14, 2009
December 27th, 2017 at 12:09:03 PM permalink
I did it the same way. The answer is 1-probability(at least one empty rank). The first row show the probability of all 27 cards falling into 12 specific ranks. Multiply that by 13 because of 13 possible missing ranks.

However, what if all 27 cards fell into 11 ranks? You'd have double counted in the first step. So you need to subtract out the 78 ways to fit all the cards in 11 ranks.

But then you would have over-subtracted for the ways all the cards could fit in 10 ranks, so add back in the 286 ways that could happen. Keep going back and forth until you get to 7 ranks left. 27 cards can't fit into six ranks.

Ranks Ways Prob Sign 0
12 13 0.04672638286 1 0.60744297719
11 78 0.00143723611 -1 -0.11210441623
10 286 0.00002519777 1 0.00720656107
9 715 0.00000019714 -1 -0.00014095336
8 1287 0.00000000042 1 0.00000054271
7 1716 0.00000000000 -1 -0.00000000010
6 1716 0.00000000000 1 0.00000000000
5 1287 0.00000000000 -1 0.00000000000
4 715 0.00000000000 1 0.00000000000
3 286 0.00000000000 -1 0.00000000000
2 78 0.00000000000 1 0.00000000000
1 13 0.00000000000 -1 0.00000000000
Total 0.50240471127


So the probability of at least one missing rank is 0.50240471127. So the probability of no missing rank is 1-0.50240471127=0.497595289.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
mustangsally
mustangsally
  • Threads: 25
  • Posts: 2463
Joined: Mar 29, 2011
December 27th, 2017 at 12:32:00 PM permalink
Quote: Wizard

I did it the same way.

good to see I did it the same way also
and made the formula from it.
added: Actually you did yours a bit differently from mine as you showed
not getting all 13 ranks and subtracting that from 1.
That appears to me a simpler way (at first glance)
*****
but I changed the deck of card values
now only 10 ranks
"Question:
How to calculate the probability of drawing 27 cards (without replacement)
and getting at least 1 card of each rank

but this time with only 10 ranks
9 ranks- 4 of each rank
1 rank- 16 of that rank
so my formula needs adjusting..."

How would you calculate the new deck is the question?
thank you
Sally

Here is the draw distribution for 13 ranks in 52 cards
draw Xdraw X or lesson draw X
130.0001056810.000105681
140.0007397670.000634086
150.0028227950.002083028
160.0077870210.004964226
170.0173896970.009602677
180.033394480.016004783
190.0572333990.023838919
200.0897467280.032513329
210.1310526610.041305933
220.180551520.04949886
230.2370364750.056484955
240.2988682890.061831814
250.3641719450.065303656
260.4310219610.066850016
270.4975952890.066573327
280.5622821250.064686836
290.6237537750.06147165
300.6809924350.05723866
310.73329070.052298265
320.7802293980.046938697
330.8216418060.041412409
340.8575709920.035929186
350.8882254240.030654432
360.9139364860.025711061
370.9351201340.021183648
380.9522439060.017123772
390.9657996450.013555739
400.9762817970.010482152
410.9841707640.007888966
420.9899206310.005749867
430.9939505130.004029882
440.9966387590.002688246
450.9983193280.001680569
460.9992797120.000960384
470.9997599040.000480192
480.9999519810.000192077
4914.80192E-05
.total1
Last edited by: mustangsally on Dec 27, 2017
I Heart Vi Hart
  • Jump to: