Cards: Difference between revisions
From charlesreid1
(Created page with "Mathematics related to cards. =Notes= One of the important features of cards is that they are sampling without replacement - so, typically, you don't want to use the binomia...") |
(→Notes) |
||
| Line 23: | Line 23: | ||
</math> | </math> | ||
but this is not correct. To give a counter-example, suppose we consider the case of a hand containing 28 cards - two more than half the deck. We know this has a zero probability of being black cards only, since there simply aren't enough black cards. But the above approach would suggest a finite probability of <math>\dfrac{1}{2^28}</math> - small, but finite. | but this is not correct. To give a counter-example, suppose we consider the case of a hand containing 28 cards - two more than half the deck. We know this has a zero probability of being black cards only, since there simply aren't enough black cards. But the above approach would suggest a finite probability of <math>\dfrac{1}{2^{28}}</math> - small, but finite. | ||
Instead, we have to account for the cards that have been removed for earlier choices when we count later choices. If we're counting the number of 5-card poker hands that contain only black cards, the first card has a 50/50 probability of being red or black, but by the time we get to the last card, supposing the prior 4 cards are all black, we are no longer looking at a 50/50 probability of the next card being red or black. There are more red card outcomes than black card outcomes, simply because there are more red cards than black cards left in the deck. | Instead, we have to account for the cards that have been removed for earlier choices when we count later choices. If we're counting the number of 5-card poker hands that contain only black cards, the first card has a 50/50 probability of being red or black, but by the time we get to the last card, supposing the prior 4 cards are all black, we are no longer looking at a 50/50 probability of the next card being red or black. There are more red card outcomes than black card outcomes, simply because there are more red cards than black cards left in the deck. | ||
To deal with this, we want to use the hypergeometric distribution, which counts the number of possible outcomes if we are doing sampling without replacement. This way, we always take one card from the deck when we "look at" one card and see if it is red or black. | To deal with this, we want to use the hypergeometric distribution, which counts the number of possible outcomes if we are doing sampling without replacement. This way, we always take one card from the deck when we "look at" one card and see if it is red or black. | ||
=Combinatorics and Counting= | =Combinatorics and Counting= | ||
==Probability of poker hand having no aces | ==Probability of poker hand having no aces | ||
Revision as of 05:55, 23 July 2017
Mathematics related to cards.
Notes
One of the important features of cards is that they are sampling without replacement - so, typically, you don't want to use the binomial coefficient. Instead, use the hypergeometric coefficient.
Consider the following hypothetical scenario, analogous to finding cards that fall into a certain class (face cards, aces, black cards, even cards, etc.): you have an urn containing N marbles, of which K have the desired characteristic. You are sampling n times, without replacement, from the urn, and counting the number of successes k. The probability mass function in this case is:
$ pmf(k) = \dfrac{ \binom{K}{k} \binom{N-K}{n-k} }{ \binom{N}{n} } $
If we look at a card and determine it is not in the class of cards we are interested in (suppose it is red, and we are interested in counting number of black cards), then it would be double-counting to put that card back in the deck and consider it for later positions!
Think about it this way: suppose we have a deck with red and black hands, and we want to know how many possible hands have only black cards. The naive approach (based on sampling with replacement) would say, each card has a 50/50 chance of being red or black. So the probability is just
$ \dfrac{1}{2} \times \dfrac{1}{2} \times \dfrac{1}{2} \times \dots $
but this is not correct. To give a counter-example, suppose we consider the case of a hand containing 28 cards - two more than half the deck. We know this has a zero probability of being black cards only, since there simply aren't enough black cards. But the above approach would suggest a finite probability of $ \dfrac{1}{2^{28}} $ - small, but finite.
Instead, we have to account for the cards that have been removed for earlier choices when we count later choices. If we're counting the number of 5-card poker hands that contain only black cards, the first card has a 50/50 probability of being red or black, but by the time we get to the last card, supposing the prior 4 cards are all black, we are no longer looking at a 50/50 probability of the next card being red or black. There are more red card outcomes than black card outcomes, simply because there are more red cards than black cards left in the deck.
To deal with this, we want to use the hypergeometric distribution, which counts the number of possible outcomes if we are doing sampling without replacement. This way, we always take one card from the deck when we "look at" one card and see if it is red or black.
Combinatorics and Counting
==Probability of poker hand having no aces