SignGuyDino
SignGuyDino
  • Threads: 1
  • Posts: 2
Joined: Mar 31, 2021
Thanked by
Mission146
March 31st, 2021 at 8:33:13 AM permalink
I am working on a game design. To decide to go forward with the project, I am requesting verification on one mathematics question:

Supposed I had a 48 card deck, four suits, twelve cards each suit.

If I drew 15 cards, what is the probability that I will draw at least one card in each suit?

I THINK I have the correct answer, but I'm looking for anyone showing me the answer and how it came about. So if my number is not right I'll know how (if) I can adjust the criteria.

Thank you.
If at first you don't succeed, don't try sky diving.
Mission146
Mission146
  • Threads: 142
  • Posts: 16832
Joined: May 15, 2012
March 31st, 2021 at 8:49:24 AM permalink
Quote: SignGuyDino

I am working on a game design. To decide to go forward with the project, I am requesting verification on one mathematics question:

Supposed I had a 48 card deck, four suits, twelve cards each suit.

If I drew 15 cards, what is the probability that I will draw at least one card in each suit?

I THINK I have the correct answer, but I'm looking for anyone showing me the answer and how it came about. So if my number is not right I'll know how (if) I can adjust the criteria.

Thank you.



The easiest way for me to figure out this question is to determine the probability of having (at least) one suit that you don't draw any of.

nCr(12,0)*nCr(36,15)/nCr(48,15) = 0.0050929350345811

There are four suits, so we must:

0.0050929350345811 * 4 = 0.0203717401383244

We also have a way that we can verify this by doing it the long way. We're going to start with wanting to avoid a specific suit, let's say clubs:

(36/48) * (35/47) * (34/46) * (33/45) * (32/44) * (31/43) * (30/42) * (29/41) * (28/40) * (27/39) * (26/38) * (25/37) * (24/36) * (23/35) * (22/34) = 0.00509293503

Of course, that agrees with the combinatorial formula above, which is the short way of doing it. Again, you must multiply this result by the four suits.

There's also a possibility that you could draw fifteen cards AND avoid two suits, but that doesn't impact anything, because if you have avoided two suits you have also avoided one...so that's already included in the result.

EDIT TO ADD:

Sorry, forgot to finish answering the question. The probability that you will get at least one of each suit is simply 1 - the probability of that not happening, so:

1 - 0.0203717401383244 = 0.97962825986 which means that the probability of getting at least one of every suit is 97.962825986%
https://wizardofvegas.com/forum/off-topic/gripes/11182-pet-peeves/120/#post815219
SignGuyDino
SignGuyDino
  • Threads: 1
  • Posts: 2
Joined: Mar 31, 2021
Thanked by
Mission146
March 31st, 2021 at 9:02:59 AM permalink
A thousand blessings.

The number I came with was approximately 97.962%. I asked a question off Quora for a slightly different scenario and translated the gentleman's numbers to this criteria. His answer involved binomial coefficients (yikes!) but omnicalculator has that, and I came up with the same number. Basically something like 1,070,980,624,076 out of 1,093,260,079,344 possible combinations or approximately 0.97962. Ironically I tried reasoning like you had above but couldn't get it right somehow.

The game I am designing would use that for the main part of the game. I wanted something for 2% house odds.

I'll be able to continue from here.

Again, thank you so much!
If at first you don't succeed, don't try sky diving.
Mission146
Mission146
  • Threads: 142
  • Posts: 16832
Joined: May 15, 2012
March 31st, 2021 at 9:04:54 AM permalink
Quote: SignGuyDino

A thousand blessings.

The number I came with was approximately 97.962%. I asked a question off Quora for a slightly different scenario and translated the gentleman's numbers to this criteria. His answer involved binomial coefficients (yikes!) but omnicalculator has that, and I came up with the same number. Basically something like 1,070,980,624,076 out of 1,093,260,079,344 possible combinations or approximately 0.97962. Ironically I tried reasoning like you had above but couldn't get it right somehow.

The game I am designing would use that for the main part of the game. I wanted something for 2% house odds.

I'll be able to continue from here.

Again, thank you so much!



You're welcome. Welcome to WoV and thank you for posting your question here! I certainly hope you'll come back and post again if you have any other questions related to your game, or to have a look around elsewhere on the forums.
https://wizardofvegas.com/forum/off-topic/gripes/11182-pet-peeves/120/#post815219
Mission146
Mission146
  • Threads: 142
  • Posts: 16832
Joined: May 15, 2012
March 31st, 2021 at 9:07:54 AM permalink
Also, here is a link to the calculator that I like to use for combinatorics:

https://web2.0calc.com/

The good news is that you can't wear out the, "nCr," button on a virtual calculator, or I'd have done it by now.
https://wizardofvegas.com/forum/off-topic/gripes/11182-pet-peeves/120/#post815219
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6659
Joined: Jun 22, 2011
Thanked by
Mission146
March 31st, 2021 at 9:52:43 AM permalink
Quote: Mission146

There's also a possibility that you could draw fifteen cards AND avoid two suits, but that doesn't impact anything, because if you have avoided two suits you have also avoided one...so that's already included in the result.


Except that, it is included in two different results - that is, a hand with six hearts and nine spades is counted in both the "no clubs" and "no diamonds" hands.
Mission146
Mission146
  • Threads: 142
  • Posts: 16832
Joined: May 15, 2012
March 31st, 2021 at 12:44:08 PM permalink
Quote: ThatDonGuy

Except that, it is included in two different results - that is, a hand with six hearts and nine spades is counted in both the "no clubs" and "no diamonds" hands.



That's true, but does it matter in the context of what we are answering? If a hand is lacking in one suit, or lacking in two suits, it still doesn't have all four suits.
https://wizardofvegas.com/forum/off-topic/gripes/11182-pet-peeves/120/#post815219
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6659
Joined: Jun 22, 2011
Thanked by
Mission146
March 31st, 2021 at 1:04:25 PM permalink
Quote: Mission146

That's true, but does it matter in the context of what we are answering? If a hand is lacking in one suit, or lacking in two suits, it still doesn't have all four suits.


Yes, it does, because if you count the number of hands that don't contain any, say, spades, and then multiply by 4, you are counting all of the hands that don't have any spades and any hearts twice (once in the "hands with no spades" count, and once in the "hands with no hearts" count).
Mission146
Mission146
  • Threads: 142
  • Posts: 16832
Joined: May 15, 2012
March 31st, 2021 at 2:08:00 PM permalink
Quote: ThatDonGuy

Yes, it does, because if you count the number of hands that don't contain any, say, spades, and then multiply by 4, you are counting all of the hands that don't have any spades and any hearts twice (once in the "hands with no spades" count, and once in the "hands with no hearts" count).



Good point, thanks!

Okay, so we want to count only half of the hands in which two suits are completely missing. The first thing we have to do is determine how many combinations of two suits can be missing:

Hearts + Diamonds
Hearts + Clubs
Hearts + Spades
Diamonds + Clubs
Diamonds + Spades
Clubs + Spades

So, there are six ways that two suits can be missing.

The probability of a hand missing two suits under the initial parameters:

nCr(12,0)*nCr(12,0)*nCr(24,15)/nCr(48,15) = 0.0000011959679354

Which we then multiply by the six ways that can happen:

0.0000011959679354 * 6 = 0.0000071758076124

And, we only want half of those to count in order to not be duplicative, so:

0.0000071758076124/2 = 0.0000035879038062

We then subtract out our duplicative ones from the previous result:

0.0203717401383244 - 0.0000035879038062 = 0.0203681522345182

1 - 0.0203681522345182 = 0.9796318477654818 or 97.96318477654818%

In this case, it doesn't change the result much just because it's such an unlikely event. That said, I appreciate you catching this that way it's not only more precise (and hopefully correct), but I don't make the same omission on something in the future where the effect could be larger.
https://wizardofvegas.com/forum/off-topic/gripes/11182-pet-peeves/120/#post815219
coachbelly
coachbelly
  • Threads: 1
  • Posts: 1231
Joined: Oct 21, 2013
March 31st, 2021 at 2:36:30 PM permalink
Quote: Mission146

The good news is that you can't wear out the, "nCr," button on a virtual calculator, or I'd have done it by now.



Who told you that you're not a mathematician?
Mission146
Mission146
  • Threads: 142
  • Posts: 16832
Joined: May 15, 2012
April 1st, 2021 at 4:01:27 AM permalink
Quote: coachbelly

Who told you that you're not a mathematician?



I told me that I'm not. I'm not qualified to call myself one and nobody should call me one. I'd suggest that anyone with a four-year degree in any field loosely related to math has either learned to do the sort of math that I'm doing or can learn it relatively easily. Actually, most high schoolers should be able to learn it.

They'd probably be better at it than I am, too. As you can see, I made a bit of an omission above and came up with the wrong answer, at first. What's even more amusing about that is that my reasoning was exactly wrong and is what led to the omission.

That just proves, once again, that solving equations is the easy part. Most of math is about asking the right question.
https://wizardofvegas.com/forum/off-topic/gripes/11182-pet-peeves/120/#post815219
AlmondBread
AlmondBread
  • Threads: 1
  • Posts: 30
Joined: Jul 3, 2015
Thanked by
Mission146
April 7th, 2021 at 2:46:21 PM permalink
Quote: Mission146

97.96318477654818%

Your math is right, but the web calculator you're using must have rounding error or something. Using my graphing calculator, I get 97.96354357%

WolframAlpha and Google agree:
1-(4*(36 choose 15)-6*(24 choose 9))/(48 choose 15)
ThatDonGuy
ThatDonGuy
  • Threads: 122
  • Posts: 6659
Joined: Jun 22, 2011
Thanked by
Mission146
April 7th, 2021 at 3:58:47 PM permalink
Quote: AlmondBread

Your math is right, but the web calculator you're using must have rounding error or something. Using my graphing calculator, I get 97.96354357%

WolframAlpha and Google agree:

1-(4*(36 choose 15)-6*(24 choose 9))/(48 choose 15)


I heard that...
C(36,15) = 5,567,902,560
C(24,9) = 1,307,504
C(48,15) = 1,093,260,079,344
The exact solution is 57,065,021 / 58,251,283, which is about 97.9635435669288%
Wizard
Administrator
Wizard
  • Threads: 1517
  • Posts: 27009
Joined: Oct 14, 2009
Thanked by
Mission146
April 7th, 2021 at 9:02:18 PM permalink
Quote: ThatDonGuy

The exact solution is 57,065,021 / 58,251,283, which is about 97.9635435669288%



I get (COMBIN(48,15)-4*COMBIN(36,15)+6*COMBIN(24,15))/COMBIN(48,15) = 0.979635435669288.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
  • Jump to: